X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=blobdiff_plain;f=package%2FMakefile;h=31f03c01bbc878e3973f76c148325fa15fc4021f;hp=af746715bace17867a576b27e7b4d0902a34e704;hb=af927159a9e65228875999840012a1cde1c36b6a;hpb=95bdcf394e439d688a5290a26a15e0bc31144f91 diff --git a/package/Makefile b/package/Makefile index af746715b..31f03c01b 100644 --- a/package/Makefile +++ b/package/Makefile @@ -1,31 +1,43 @@ -# Main makefile for the packages -include $(TOPDIR)/rules.mk -include $(TOPDIR)/.config -include .pkgdeps - -COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m)) -INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y)) - -$(STAMP_DIR) $(TARGET_DIR): - mkdir -p $@ - -%-prepare: $(STAMP_DIR) $(TARGET_DIR) - $(MAKE) -C $(patsubst %-prepare,%,$@) prepare - -%-compile: $(STAMP_DIR) $(TARGET_DIR) - @echo "-> make $@" - $(MAKE) -C $(patsubst %-compile,%,$@) compile - -%-clean: $(STAMP_DIR) $(TARGET_DIR) - $(MAKE) -C $(patsubst %-clean,%,$@) clean - - -.pkgdeps: $(TOPDIR)/.pkginfo FORCE - @$(TOPDIR)/scripts/gen_deps.pl < $< > $@ || rm -f $@ - -all: compile -clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m)) -compile: $(COMPILE_PACKAGES) -install: base-files-install $(INSTALL_PACKAGES) - - +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +curdir:=package + +include .config +-include $(TMP_DIR)/.packagedeps +$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m)) +$(curdir)/builddirs-compile:=$(sort $(package-y) $(package-m)) +$(curdir)/builddirs-install:=. $(sort $(package-y)) +$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m)) + +$(curdir)//compile:=.config prereq +$(curdir)/install:=$(curdir)/install-cleanup +$(curdir)/install-cleanup: + rm -rf $(BUILD_DIR)/root + $(MAKE) install-targets + $(MAKE) preconfig + @if [ -d $(TOPDIR)/files ]; then \ + $(CP) $(TOPDIR)/files/. $(BUILD_DIR)/root; \ + fi + @mkdir -p $(BUILD_DIR)/root/etc/rc.d + @( \ + cd $(BUILD_DIR)/root; \ + for script in ./etc/init.d/*; do \ + grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \ + IPKG_INSTROOT=$(BUILD_DIR)/root $(which bash) ./etc/rc.common $$script enable; \ + done || true \ + ) + @-find $(BUILD_DIR)/root -name CVS | $(XARGS) rm -rf + @-find $(BUILD_DIR)/root -name .svn | $(XARGS) rm -rf + @-find $(BUILD_DIR)/root -name '.#*' | $(XARGS) rm -f + +$(curdir)/index: FORCE + (cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages) + +$(eval $(call stampfile,$(curdir),package,prereq)) +$(eval $(call subdir,$(curdir)))