forked from SynoCommunity/spksrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspksrc.depend.mk
61 lines (50 loc) · 1.55 KB
/
spksrc.depend.mk
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
### Dependency rules
# Build all dependencies listed in DEPENDS.
# Target are executed in the following order:
# depend_msg_target
# pre_depend_target (override with PRE_DEPEND_TARGET)
# depend_target (override with DEPEND_TARGET)
# post_depend_target (override with POST_DEPEND_TARGET)
# Variables:
# DEPENDS List of dependencies to go through
# REQ_KERNEL If set, will compile kernel modules and allow
# use of KERNEL_DIR
# BUILD_DEPENDS List of dependencies to go through, PLIST is ignored
DEPEND_COOKIE = $(WORK_DIR)/.$(COOKIE_PREFIX)depend_done
ifeq ($(strip $(PRE_DEPEND_TARGET)),)
PRE_DEPEND_TARGET = pre_depend_target
else
$(PRE_DEPEND_TARGET): depend_msg_target
endif
ifeq ($(strip $(DEPEND_TARGET)),)
DEPEND_TARGET = depend_target
else
$(DEPEND_TARGET): $(PRE_DEPEND_TARGET)
endif
ifeq ($(strip $(POST_DEPEND_TARGET)),)
POST_DEPEND_TARGET = post_depend_target
else
$(POST_DEPEND_TARGET): $(DEPEND_TARGET)
endif
ifeq ($(strip $(REQ_KERNEL)),)
KERNEL_DEPEND =
else
KERNEL_DEPEND = kernel/syno-$(ARCH)-$(TCVERSION)
endif
depend_msg_target:
@$(MSG) "Processing dependencies of $(NAME)"
pre_depend_target: depend_msg_target
depend_target: $(PRE_DEPEND_TARGET)
@for depend in $(KERNEL_DEPEND) $(BUILD_DEPENDS) $(DEPENDS) ; \
do \
env $(ENV) $(MAKE) -C ../../$$depend ; \
done
post_depend_target: $(DEPEND_TARGET)
ifeq ($(wildcard $(DEPEND_COOKIE)),)
depend: $(DEPEND_COOKIE)
$(DEPEND_COOKIE): $(POST_DEPEND_TARGET)
$(create_target_dir)
@touch -f $@
else
depend: ;
endif