2 # Copyright (C) 2006,2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 all: $(if
$(DUMP
),dumpinfo
,compile
)
10 PKG_BUILD_DIR ?
= $(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
11 PKG_INSTALL_DIR ?
= $(PKG_BUILD_DIR
)/ipkg-install
13 include $(INCLUDE_DIR
)/prereq.mk
14 include $(INCLUDE_DIR
)/host.mk
15 include $(INCLUDE_DIR
)/unpack.mk
16 include $(INCLUDE_DIR
)/package-defaults.mk
17 include $(INCLUDE_DIR
)/package-dumpinfo.mk
18 include $(INCLUDE_DIR
)/package-ipkg.mk
20 export CONFIG_SITE
:=$(INCLUDE_DIR
)/site
/$(REAL_GNU_TARGET_NAME
)
22 define Build
/DefaultTargets
23 ifneq ($(strip $(PKG_SOURCE_URL
)),)
24 download
: $(DL_DIR
)/$(PKG_SOURCE
)
26 $(DL_DIR
)/$(PKG_SOURCE
):
28 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL
)
30 $(PKG_BUILD_DIR
)/.prepared
: $(DL_DIR
)/$(PKG_SOURCE
)
34 ifeq ($(CONFIG_AUTOREBUILD
),y
)
35 ifneq ($$(shell $(SCRIPT_DIR
)/timestamp.pl
-p
$(PKG_BUILD_DIR
) .
$(PKG_FILE_DEPEND
)),$(PKG_BUILD_DIR
))
36 $$(info Forcing package rebuild
)
37 $(PKG_BUILD_DIR
)/.prepared
: clean
42 $(PKG_BUILD_DIR
)/.prepared
:
43 @
-rm -rf
$(PKG_BUILD_DIR
)
44 @mkdir
-p
$(PKG_BUILD_DIR
)
48 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.prepared
52 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/.configured
56 ifdef Build
/InstallDev
57 ifneq ($$(shell $(SCRIPT_DIR
)/timestamp.pl
-p
-x ipkg
-x ipkg-install
$(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
$(PKG_BUILD_DIR
)),$(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
)
58 $(PKG_BUILD_DIR
)/.built
: package-rebuild
61 compile
: $(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
62 $(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
: $(PKG_BUILD_DIR
)/.built
63 mkdir
-p
$(STAGING_DIR
)/stampfiles
68 package-rebuild
: FORCE
69 @
-rm -f
$(PKG_BUILD_DIR
)/.built
71 define Build
/DefaultTargets
76 $(eval
$(Package
/Default
))
77 $(eval
$(Package
/$(1)))
79 # <HACK> Support obsolete DESCRIPTION field
80 ifndef Package
/$(1)/description
81 define Package
/$(1)/description
88 $(foreach FIELD
, TITLE CATEGORY PRIORITY SECTION VERSION
,
90 $$(error Package
/$(1) is missing the
$(FIELD
) field
)
94 $(call shexport
,Package
/$(1)/description
)
95 $(call shexport
,Package
/$(1)/config
)
102 $(call Build
/Prepare
/Default
,)
105 define Build
/Configure
106 $(call Build
/Configure
/Default
,)
110 $(call Build
/Compile
/Default
,)
118 prepare
: $(PKG_BUILD_DIR
)/.prepared
119 configure
: $(PKG_BUILD_DIR
)/.configured
123 $(Build
/UninstallDev
)
124 @
rm -f
$(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
125 @
rm -rf
$(PKG_BUILD_DIR
)