1 ifneq ($(strip $(PKG_CAT)),)
2 ifeq ($(PKG_CAT),unzip)
3 UNPACK=unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
5 UNPACK=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) -
7 define Build/Prepare/Default
9 @if [ -d ./patches ]; then \
10 $(PATCH) $(PKG_BUILD_DIR) ./patches; \
16 $(call Build/Prepare/Default)
19 define Build/Configure/Default
20 @(cd $(PKG_BUILD_DIR)/$(3); \
23 CPPFLAGS="-I$(STAGING_DIR)/host/include" \
24 LDFLAGS="-L$(STAGING_DIR)/host/lib" \
26 --target=$(GNU_TARGET_NAME) \
27 --host=$(GNU_TARGET_NAME) \
28 --build=$(GNU_HOST_NAME) \
35 --libexecdir=/usr/lib \
37 --datadir=/usr/share \
38 --localstatedir=/var \
47 define Build/Configure
48 $(call Build/Configure/Default)
51 define Build/Compile/Default
52 $(MAKE) -C $(PKG_BUILD_DIR) $(1)
56 $(call Build/Compile/Default)
60 ifneq ($(strip $(PKG_SOURCE)),)
61 source: $(DL_DIR)/$(PKG_SOURCE)
63 $(DL_DIR)/$(PKG_SOURCE):
65 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
67 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
71 $(PKG_BUILD_DIR)/.prepared:
72 @-rm -rf $(PKG_BUILD_DIR)
73 @mkdir -p $(PKG_BUILD_DIR)
77 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
78 $(call Build/Configure)
81 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
85 $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed: $(PKG_BUILD_DIR)/.built
90 install-targets: $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed
95 $(call Build/Uninstall)
96 rm -f $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed
99 prepare: $(PKG_BUILD_DIR)/.prepared
100 configure: $(PKG_BUILD_DIR)/.configured
102 compile-targets: $(PKG_BUILD_DIR)/.built
103 compile: compile-targets
106 install: install-targets
110 @$(MAKE) clean-targets
112 rm -rf $(PKG_BUILD_DIR)