more buildroot-ng bugfixes
[openwrt.git] / package / Makefile
1 # Main makefile for the packages
2 include $(TOPDIR)/rules.mk
3 COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
4 INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
5
6 all: compile
7 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
8 compile: $(COMPILE_PACKAGES)
9 install: base-files-install $(INSTALL_PACKAGES)
10
11 $(COMPILE_PACKAGES): base-files-compile
12 $(INSTALL_PACKAGES): base-files-install
13
14 $(STAMP_DIR):
15 mkdir -p $@
16
17 $(TARGET_DIR):
18 mkdir -p $(TARGET_DIR)
19
20 %-prepare: $(STAMP_DIR) $(TARGET_DIR)
21 @[ -f $(STAMP_DIR)/.$@ ] || { \
22 $(START_TRACE) "package/$(patsubst %-prepare,%,$@)-prepare: "; \
23 $(MAKE) -C $(patsubst %-prepare,%,$@) prepare && { \
24 touch $(STAMP_DIR)/.$@; \
25 $(CMD_TRACE) " done"; \
26 $(END_TRACE); \
27 } \
28 }
29
30 %-compile:
31 @[ -f $(STAMP_DIR)/.$@ ] || { \
32 $(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile: "; \
33 $(MAKE) -C $(patsubst %-compile,%,$@) compile && { \
34 touch $(STAMP_DIR)/.$(patsubst %-compile,%,$@)-prepare; \
35 touch $(STAMP_DIR)/.$@; \
36 $(CMD_TRACE) " done"; \
37 $(END_TRACE); \
38 } \
39 }
40
41 %-install: %-compile
42 @$(START_TRACE) "package/$(patsubst %-install,%,$@)-install: "
43 @$(MAKE) -C $(patsubst %-install,%,$@) install
44 @$(CMD_TRACE) " done"
45 @$(END_TRACE)
46
47 %-rebuild:
48 @$(START_TRACE) "package/$(patsubst %-rebuild,%,$@)-rebuild: "
49 @rm -f $(STAMP_DIR)/.$(patsubst %-rebuild,%,$@)-*
50 $(MAKE) -C $(patsubst %-rebuild,%,$@) rebuild
51 @$(CMD_TRACE) " done"
52 @$(END_TRACE)
53
54 %-clean:
55 @$(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean: "
56 @$(MAKE) -C $(patsubst %-clean,%,$@) clean
57 @rm -f $(STAMP_DIR)/.$(patsubst %-clean,%,$@)-*
58 @$(CMD_TRACE) " done"
59 @$(END_TRACE)
60
This page took 0.045301 seconds and 5 git commands to generate.