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 include $(INCLUDE_DIR
)/prereq.mk
11 include $(INCLUDE_DIR
)/host.mk
12 include $(INCLUDE_DIR
)/unpack.mk
13 include $(INCLUDE_DIR
)/package-defaults.mk
14 include $(INCLUDE_DIR
)/package-dumpinfo.mk
15 include $(INCLUDE_DIR
)/package-ipkg.mk
17 export CONFIG_SITE
:=$(INCLUDE_DIR
)/site
/$(REAL_GNU_TARGET_NAME
)
19 define Build
/DefaultTargets
20 ifneq ($(strip $(PKG_SOURCE_URL
)),)
21 download
: $(DL_DIR
)/$(PKG_SOURCE
)
23 $(DL_DIR
)/$(PKG_SOURCE
):
25 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL
)
27 $(PKG_BUILD_DIR
)/.prepared
: $(DL_DIR
)/$(PKG_SOURCE
)
31 ifeq ($(CONFIG_AUTOREBUILD
),y
)
32 ifneq ($$(shell $(SCRIPT_DIR
)/timestamp.pl
-p
$(PKG_BUILD_DIR
) .
$(PKG_FILE_DEPEND
)),$(PKG_BUILD_DIR
))
33 $$(info Forcing package rebuild
)
34 $(PKG_BUILD_DIR
)/.prepared
: clean
39 $(PKG_BUILD_DIR
)/.prepared
:
40 @
-rm -rf
$(PKG_BUILD_DIR
)
41 @mkdir
-p
$(PKG_BUILD_DIR
)
45 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.prepared
49 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/.configured
53 ifdef Build
/InstallDev
54 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
)
55 $(PKG_BUILD_DIR
)/.built
: package-rebuild
58 $(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
: $(PKG_BUILD_DIR
)/.built
59 mkdir
-p
$(STAGING_DIR
)/stampfiles
63 compile
: $(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
66 package-rebuild
: FORCE
67 @
-rm -f
$(PKG_BUILD_DIR
)/.built
69 define Build
/DefaultTargets
74 $(eval
$(Package
/Default
))
75 $(eval
$(Package
/$(1)))
77 # <HACK> Support obsolete DESCRIPTION field>
78 ifndef Package
/$(1)/description
79 define Package
/$(1)/description
86 $(foreach FIELD
, TITLE CATEGORY PRIORITY SECTION VERSION
,
88 $$(error Package
/$(1) is missing the
$(FIELD
) field
)
92 $(call shexport
,Package
/$(1)/description
)
93 $(call shexport
,Package
/$(1)/config
)
100 $(call Build
/Prepare
/Default
,)
103 define Build
/Configure
104 $(call Build
/Configure
/Default
,)
108 $(call Build
/Compile
/Default
,)
116 prepare
: $(PKG_BUILD_DIR
)/.prepared
117 configure
: $(PKG_BUILD_DIR
)/.configured
121 $(Build
/UninstallDev
)
122 @
rm -f
$(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
123 @
rm -rf
$(PKG_BUILD_DIR
)