X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=blobdiff_plain;f=package%2FMakefile;h=31f03c01bbc878e3973f76c148325fa15fc4021f;hp=e0bd23c7ecb7352172ac9e0b69d4252f68ae1b49;hb=af927159a9e65228875999840012a1cde1c36b6a;hpb=dd2b3f1c125a74f2f3c44d9114d316a861566cc4 diff --git a/package/Makefile b/package/Makefile index e0bd23c7e..31f03c01b 100644 --- a/package/Makefile +++ b/package/Makefile @@ -1,22 +1,43 @@ -# Main makefile for the packages -include $(TOPDIR)/rules.mk -COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m)) -INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y)) +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ -all: compile -clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m)) -compile: $(COMPILE_PACKAGES) -install: base-files-install $(INSTALL_PACKAGES) +curdir:=package -$(STAMP_DIR) $(TARGET_DIR): - mkdir -p $@ +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)) -%-prepare: $(STAMP_DIR) $(TARGET_DIR) - $(MAKE) -C $(patsubst %-prepare,%,$@) prepare +$(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 -%-compile: $(STAMP_DIR) $(TARGET_DIR) - $(MAKE) -C $(patsubst %-compile,%,$@) compile - -%-clean: $(STAMP_DIR) $(TARGET_DIR) - $(MAKE) -C $(patsubst %-clean,%,$@) clean +$(curdir)/index: FORCE + (cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages) +$(eval $(call stampfile,$(curdir),package,prereq)) +$(eval $(call subdir,$(curdir)))