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 compile
: $(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
59 $(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
: $(PKG_BUILD_DIR
)/.built
60 mkdir
-p
$(STAGING_DIR
)/stampfiles
65 package-rebuild
: FORCE
66 @
-rm -f
$(PKG_BUILD_DIR
)/.built
68 define Build
/DefaultTargets
73 $(eval
$(Package
/Default
))
74 $(eval
$(Package
/$(1)))
76 # <HACK> Support obsolete DESCRIPTION field
77 ifndef Package
/$(1)/description
78 define Package
/$(1)/description
85 $(foreach FIELD
, TITLE CATEGORY PRIORITY SECTION VERSION
,
87 $$(error Package
/$(1) is missing the
$(FIELD
) field
)
91 $(call shexport
,Package
/$(1)/description
)
92 $(call shexport
,Package
/$(1)/config
)
99 $(call Build
/Prepare
/Default
,)
102 define Build
/Configure
103 $(call Build
/Configure
/Default
,)
107 $(call Build
/Compile
/Default
,)
115 prepare
: $(PKG_BUILD_DIR
)/.prepared
116 configure
: $(PKG_BUILD_DIR
)/.configured
120 $(Build
/UninstallDev
)
121 @
rm -f
$(STAGING_DIR
)/stampfiles
/.
$(PKG_NAME
)-installed
122 @
rm -rf
$(PKG_BUILD_DIR
)