diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index 723303c1ba..a5583563b1 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -58,6 +58,7 @@ netbsd-*-tools/* netbsd-*-xen0/* netbsd-*-xenU/* netbsd-*.patch +patches/*/.makedep patches/ebtables-brnf-5_vs_2.4.25.diff patches/ebtables.diff patches/tmp/* diff --git a/Makefile b/Makefile index 7b468d1723..7e589f098c 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,6 @@ KERNELS ?= linux-2.6-xen0 linux-2.6-xenU # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU # You may use wildcards in the above e.g. KERNELS=*2.4* -ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*)) -ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse)) XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) ) export DESTDIR @@ -87,7 +85,7 @@ world: $(MAKE) dist # clean doesn't do a kclean -clean: +clean:: $(MAKE) -C xen clean $(MAKE) -C tools clean $(MAKE) -C docs clean diff --git a/buildconfigs/Rules.mk b/buildconfigs/Rules.mk index 11f4009525..1e65484b36 100644 --- a/buildconfigs/Rules.mk +++ b/buildconfigs/Rules.mk @@ -6,6 +6,9 @@ include Config.mk DISTDIR ?= $(CURDIR)/dist DESTDIR ?= $(DISTDIR)/install +ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*)) +ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse)) + .PHONY: mkpatches mrproper # Setup pristine search path @@ -49,24 +52,30 @@ else OS_VER = $(NETBSD_VER) endif -pristine-%: %.tar.bz2 - rm -rf tmp-$(@F) $@ - mkdir -p tmp-$(@F) - tar -C tmp-$(@F) -jxf $< - mv tmp-$(@F)/* $@ - touch $@ # update timestamp to avoid rebuild +$(patsubst %,pristine-%/.valid-pristine,$(ALLSPARSETREES)) : pristine-%/.valid-pristine: %.tar.bz2 + rm -rf tmp-pristine-$* $(@D) + mkdir -p tmp-pristine-$* touch $@/.bk_skip - @rm -rf tmp-$(@F) + tar -C tmp-pristine-$* -jxf $< + mv tmp-pristine-$*/* $(@D) + @rm -rf tmp-pristine-$* + touch $@ # update timestamp to avoid rebuild -OS_PATCHES = $(shell echo patches/$(OS)-$(OS_VER)/*.patch) +PATCHDIRS := $(wildcard patches/*-*) -ref-%: pristine-% $(OS_PATCHES) - rm -rf $@ - cp -al $< tmp-$(@F) +-include $(patsubst %,%/.makedep,$(PATCHDIRS)) + +$(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: + @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@ + +clean:: + rm -f patches/*/.makedep + +ref-%/.valid-ref: pristine-%/.valid-pristine + rm -rf $(@D) + cp -al $( $@ || true + diff -Nurp $( $@ || true rm -rf tmp-$@ %-mrproper: %-mrproper-extra diff --git a/buildconfigs/mk.linux-2.4-xen0 b/buildconfigs/mk.linux-2.4-xen0 index e28b3a1981..6044268d09 100644 --- a/buildconfigs/mk.linux-2.4-xen0 +++ b/buildconfigs/mk.linux-2.4-xen0 @@ -24,9 +24,9 @@ patches/tmp/ebtables.diff: wget http://www.cl.cam.ac.uk/netos/xen/downloads/ebtables-brnf-5_vs_2.4.27.diff.gz -O- | gunzip -c > $@ $(LINUX_DIR)/include/linux/autoconf.h: patches/tmp/ebtables.diff -$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER) +$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref rm -rf $(LINUX_DIR) - cp -al $< $(LINUX_DIR) + cp -al $(