forked from SynoCommunity/spksrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (63 loc) · 1.84 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 -,/,$(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
local.mk:
@echo "Creating local configuration \"local.mk\"..."
@echo "PUBLISH_METHOD=REPO" > $@
@echo "PUBLISH_REPO_URL=https://packages.synocommunity.com/" >> $@
@echo "PUBLISH_REPO_KEY=" >> $@
@echo "PUBLISH_FTP_URL=ftp://synocommunity.com/upload_spk" >> $@
@echo "PUBLISH_FTP_USER=" >> $@
@echo "PUBLISH_FTP_PASSWORD=" >> $@