source: freewrt/package/rules.mk@ 835bc14

freewrt_1_0 freewrt_2_0
Last change on this file since 835bc14 was 601a699, checked in by Thorsten Glaser <tg@…>, 19 years ago

GNU make can't do relative includes? OMFG. BSD make is so much better.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@436 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 1.8 KB
Line 
1# $FreeWRT$
2
3WRKDIR_BASE:= ${BUILD_DIR}
4
5include ${TOPDIR}/package/buildhlp.mk
6
7define PKG_template
8IPKG_$(1)= $(PACKAGE_DIR)/$(2)_$(3)_$(4).ipk
9IDIR_$(1)= $(WRKDIR)/ipkg/$(2)
10INFO_$(1)= $(IPKG_STATE_DIR)/info/$(2).list
11
12ifneq ($(FWRT_PACKAGE_$(1)),)
13compile-targets: $$(IPKG_$(1))
14endif
15ifneq ($(DEVELOPER),)
16compile-targets: $$(IPKG_$(1))
17endif
18ifeq ($(FWRT_PACKAGE_$(1)),y)
19install-targets: $$(INFO_$(1))
20endif
21
22IDEPEND_$(1):= $$(strip $(5))
23
24$$(IDIR_$(1))/CONTROL/control: $(WRKBUILD)/.prepared
25 $(SCRIPT_DIR)/make-ipkg-dir.sh $$(IDIR_$(1)) ./ipkg/$(2).control $(3) $(4)
26 [ -z "$$(IDEPEND_$(1))" ] || echo "Depends: $$(IDEPEND_$(1))" >>$$(IDIR_$(1))/CONTROL/control
27 for file in conffiles preinst postinst prerm postrm; do \
28 [ ! -f ./ipkg/$(2).$$$$file ] || cp ./ipkg/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file; \
29 done
30
31$$(IPKG_$(1)): $$(IDIR_$(1))/CONTROL/control $(WRKBUILD)/.built $(PACKAGE_DIR)
32
33$$(INFO_$(1)): $$(IPKG_$(1))
34 $(IPKG) install $$(IPKG_$(1))
35
36$(2)-clean:
37 rm -f $$(IPKG_$(1))
38clean: $(2)-clean
39endef
40
41
42all: compile
43
44source: ${DISTFILES}
45prepare: source
46 @[ -f $(WRKBUILD)/.prepared ] || { \
47 $(CMD_TRACE) "preparing... "; \
48 $(MAKE) $(WRKBUILD)/.prepared $(MAKE_TRACE); \
49 }
50
51configure: prepare
52 @[ -f $(WRKBUILD)/.configured ] || { \
53 $(CMD_TRACE) "configuring... "; \
54 $(MAKE) $(WRKBUILD)/.configured $(MAKE_TRACE); \
55 }
56
57compile-targets:
58compile: configure
59 @$(CMD_TRACE) "compiling... "
60 @$(MAKE) compile-targets $(MAKE_TRACE)
61
62install-targets:
63install:
64 @$(CMD_TRACE) "installing... "
65 @$(MAKE) install-targets $(MAKE_TRACE)
66
67$(WRKBUILD)/.configured:
68$(WRKBUILD)/.built:
69
70$(PACKAGE_DIR):
71 mkdir -p $@
72
73clean-targets:
74clean:
75 @$(CMD_TRACE) "cleaning... "
76 @$(MAKE) clean-targets $(MAKE_TRACE)
77 rm -rf ${WRKDIR}
78
79
80.PHONY: all source prepare compile install clean
Note: See TracBrowser for help on using the repository browser.