forked from CoronaWhy/befair
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (53 loc) · 2.3 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
include mk/helpers.mk
#################################################################
# NOTE: this targets valid when no active distro is choosing
#################################################################
MAKEFLAGS += --no-print-directory
# help: show all targets with tag 'help'
help:
@if [ ! -L $(DISTRO_ACTIVE_LINK) ]; then \
$(call generate-help,$(MAKEFILE_LIST)); \
else \
$(MAKE) -C $(DISTRO_ACTIVE_LINK) $@; \
fi
.PHONY: help
# help: run configurator
menuconfig:
@$(MAKE) -f $(PWD)/mk/distro-include.mk $@
.PHONY: menuconfig
# help: run configurator inside ubuntu container [portable]
menuconfig-docker:
@$(MAKE) -f $(PWD)/mk/distro-include.mk $@
.PHONY: menuconfig-docker
# help: check all distros consistency
check-all:
@for DIR in $(DISTROS_DIR)/*; do \
printf "============================="; \
printf " Checking %-20s " $$DIR; \
printf "=============================\n"; \
$(MAKE) -C $$DIR -f $(PWD)/mk/distro-makefile.mk check; \
echo; \
done
.PHONY: check-all
#################################################################
%:
@if [ ! -L $(DISTRO_ACTIVE_LINK) ]; then \
if [ -e $(DISTRO_ACTIVE_LINK) ]; then \
echo "$(DISTRO_ACTIVE_LINK) is not a symbolic link." \
"It should be a link to an active distro" >&2; \
exit 1; \
fi; \
echo "There is no symbolic link '$(DISTRO_ACTIVE_LINK)'"; \
echo "You can create it manually to some distro, for ex.:";\
echo "$$ ln -s distros/hello-world $(DISTRO_ACTIVE_LINK)"; \
echo "or run '$(MAKE) menuconfig' and choose active distro";\
echo ; \
exit 1; \
elif [ ! -e $(DISTRO_ACTIVE_LINK) ]; then \
echo "$(DISTRO_ACTIVE_LINK) is brocken symbolic link." \
"It should be a link to an active distro" >&2; \
exit 1; \
fi; \
[ -L $(DISTRO_ACTIVE_LINK) ] && $(MAKE) -C $(DISTRO_ACTIVE_LINK) $@
.PHONY: %
# vim: noexpandtab tabstop=4 shiftwidth=4 fileformat=unix