source: freewrt/mk/package.mk@ 587c2aa

freewrt_1_0 freewrt_2_0
Last change on this file since 587c2aa was 9036ea5, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

move some makefiles to mk

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

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