summaryrefslogtreecommitdiff
path: root/openwrt/package/rules.mk
diff options
context:
space:
mode:
authorNicolas Thill <nico@openwrt.org>2005-04-18 06:17:39 +0000
committerNicolas Thill <nico@openwrt.org>2005-04-18 06:17:39 +0000
commitefe2803a1d4c3deadbdea3e402185abd4556944a (patch)
tree055a798b8356050fa4d0f072aaf975ca50a674a8 /openwrt/package/rules.mk
parent6cf7392bce0c5ec09f085446714ca448e19de6cf (diff)
downloadmtk-20170518-efe2803a1d4c3deadbdea3e402185abd4556944a.zip
mtk-20170518-efe2803a1d4c3deadbdea3e402185abd4556944a.tar.gz
mtk-20170518-efe2803a1d4c3deadbdea3e402185abd4556944a.tar.bz2
Add common rules and templates Makefile includes for packages
SVN-Revision: 662
Diffstat (limited to 'openwrt/package/rules.mk')
-rw-r--r--openwrt/package/rules.mk26
1 files changed, 26 insertions, 0 deletions
diff --git a/openwrt/package/rules.mk b/openwrt/package/rules.mk
new file mode 100644
index 0000000..ffcbe1a
--- /dev/null
+++ b/openwrt/package/rules.mk
@@ -0,0 +1,26 @@
+ifneq ($(strip $(PKG_SOURCE)),)
+$(DL_DIR)/$(PKG_SOURCE):
+ $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
+endif
+
+ifneq ($(strip $(PKG_CAT)),)
+$(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
+ rm -rf $(PKG_BUILD_DIR)
+ $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+ if [ -d ./patches ]; then \
+ $(PATCH) $(PKG_BUILD_DIR) ./patches ; \
+ fi
+ touch $(PKG_BUILD_DIR)/.prepared
+endif
+
+all: compile
+
+source: $(DL_DIR)/$(PKG_SOURCE)
+prepare: $(PKG_BUILD_DIR)/.prepared
+compile: $(COMPILE_TARGETS)
+install: $(INSTALL_TARGETS)
+
+clean: $(CLEAN_TARGETS)
+ rm -rf $(PKG_FILES) $(PKG_BUILD_DIR)
+
+.PHONY: all source prepare compile install clean \ No newline at end of file