forked from SynoCommunity/spksrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (62 loc) · 1.76 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
SUPPORTED_TCS = $(notdir $(wildcard toolchains/syno-*))
SUPPORTED_ARCHS = $(notdir $(subst syno-,/,$(SUPPORTED_TCS)))
SUPPORTED_SPKS = $(patsubst spk/%/Makefile,%,$(wildcard spk/*/Makefile))
all: $(SUPPORTED_SPKS)
clean: $(addsuffix -clean,$(SUPPORTED_SPKS))
clean: native-clean
dist-clean: clean
dist-clena: toolchain-clean
native-clean:
@for native in $(dir $(wildcard native/*/Makefile)) ; \
do \
(cd $${native} && $(MAKE) clean) ; \
done
toolchain-clean:
@for tc in $(dir $(wildcard toolchains/*/Makefile)) ; \
do \
(cd $${tc} && $(MAKE) clean) ; \
done
cross-clean:
@for cross in $(dir $(wildcard cross/*/Makefile)) ; \
do \
(cd $${cross} && $(MAKE) clean) ; \
done
spk-clean:
@for spk in $(dir $(wildcard spk/*/Makefile)) ; \
do \
(cd $${spk} && $(MAKE) clean) ; \
done
%: spk/%/Makefile
cd $(dir $^) && env $(MAKE)
%-clean: spk/%/Makefile
cd $(dir $^) && env $(MAKE) clean
prepare: downloads
@for tc in $(dir $(wildcard toolchains/*/Makefile)) ; \
do \
(cd $${tc} && $(MAKE)) ; \
done
downloads:
@for dl in $(dir $(wildcard cross/*/Makefile)) ; \
do \
(cd $${dl} && $(MAKE) download) ; \
done
natives:
@for n in $(dir $(wildcard native/*/Makefile)) ; \
do \
(cd $${n} && $(MAKE)) ; \
done
.PHONY: toolchains kernel-modules
toolchains: $(addprefix toolchain-,$(SUPPORTED_ARCHS))
kernel-modules: $(addprefix kernel-,$(SUPPORTED_ARCHS))
toolchain-%:
-@cd toolchains/syno-$*/ && MAKEFLAGS= $(MAKE)
kernel-%:
-@cd kernel/syno-$*/ && MAKEFLAGS= $(MAKE)
setup: local.mk dsm-4.3
local.mk:
@echo "Creating local configuration \"local.mk\"..."
@echo "PUBLISH_URL=https://api.synocommunity.com/" > $@
@echo "PUBLISH_API_KEY=" >> $@
dsm-%:
@echo "Setting default toolchain version to DSM-$*"
@echo "DEFAULT_TC=$*" >> local.mk