X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=3cab844fcf344bed3b04addf903aa41e4f82d806;hb=5da2eeb4dbd16471a58223a38fff67aa04bd293c;hp=62711055f9a3b460a5a799344e3dc065960147c9;hpb=548c6e6ad3bc706f2b327e9147c4d5e7f0a69108;p=build.git diff --git a/Makefile b/Makefile index 62711055..3cab844f 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,7 @@ #################### # exported to spec files as plrelease -PLANETLAB_RELEASE = 5.0 +PLANETLAB_RELEASE = 5.1 # # Default values @@ -137,15 +137,15 @@ all: PLDISTRO := planetlab RPMBUILD := rpmbuild -########## savedpldistro.mk holds PLDISTRO - it is generated at stage1 (see below) +########## envfrompreviousrun.mk holds PLDISTRO and others - it is generated at stage1 (see below) ifeq "$(stage1)" "" -include savedpldistro.mk +include envfrompreviousrun.mk endif # when re-running the nightly build after failure, we need to gather the former values # do this by running make stage1=skip +PLDISTRO ifeq "$(stage1)" "skip" -include savedpldistro.mk +include envfrompreviousrun.mk endif #################### include onelab.mk @@ -163,14 +163,9 @@ include $(PLDISTROTAGS) # this used to be set in the -tags.mk files, but that turned out to require # error-prone duplicate changes # so now the nightly build script sets this to what it is currently using -# in case we run this manually, i.e. if neither build-SVNPATH nor build-GITPATH is set -ifeq "$(build-SVNPATH)$(build-GITPATH)" "" -build-GITPATH-local := $(shell git config remote.origin.url) -ifneq "$(build-GITPATH-local)" "" -build-GITPATH := $(build-GITPATH-local) -else -build-SVNPATH := $(lastword $(shell svn info 2> /dev/null | grep URL:)) -endif +# in case we run this manually, i.e. if build-GITPATH is not set +ifeq "$(build-GITPATH)" "" +build-GITPATH := $(shell git config remote.origin.url) endif #################### pldistros that are defined remotely @@ -295,7 +290,7 @@ $(1).module := $(firstword $($(1)-MODULES)) $(1).specpath := SPECS/$(notdir $($(1)-SPEC)) $(1).moduledir := MODULES/$$($(1).module) $(1).codespec := MODULES/$$($(1).module)/$($(1)-SPEC) -$(1).spec2makeflags := $(if $($(1)-NEEDSPEC2MAKEHACK),$(if $(filter $(DISTRONAME),f8 centos5),--hack,),) +$(1).spec2makeflags := $(if $($(1)-WHITELIST-RPMS),--whitelist-rpms $($(1)-WHITELIST-RPMS),) endef $(foreach package, $(ALL), $(eval $(call stage1_package_vars,$(package)))) @@ -394,6 +389,10 @@ $(foreach module,$(ALL.modules),$(eval $(call target_extract_module,$(module)))) ### the tests area # use this makefile to extract tests rather than extracting manually in vbuild-nightly +build-clean: + rm -rf MODULES/build +.PHONY: build-clean + tests-clean: rm -rf MODULES/tests .PHONY: tests-clean @@ -423,8 +422,9 @@ endif ### this utility allows to extract various info from a spec file ### and to define them in makefiles +# use the C code where it works as it's the original one, use the python code otherwise spec2make: spec2make.c - $(CC) -g -Wall $< -o $@ -lrpm -lrpmbuild -lrpmio -lpopt + $(CC) -g -Wall $< -o $@ -lrpm -lrpmbuild -lrpmio -lpopt || ln -s spec2make.py $@ ### run spec2make on the spec file and include the result # usage: spec2make package @@ -438,23 +438,28 @@ endef $(foreach package,$(ALL),$(eval $(call target_mk,$(package)))) -# stores PLDISTRO in a file +# stores env variables in a file # this is done at stage1. later run wont get confused -SAVED_VARS=PLDISTRO PLDISTROTAGS build-SVNPATH PERSONALITY MAILTO BASE WEBPATH TESTBUILDURL WEBROOT -savedpldistro.mk: +SAVED_VARS=PLDISTRO PLDISTROTAGS build-GITPATH PERSONALITY MAILTO BASE WEBPATH TESTBUILDURL WEBROOT +# also remember variable settings in alias, like sfa-GITPATH=git://git.f-lab.fr/sfa.git@generic +# but don't save stage1 +ASSIGNS=$(foreach chunk,$(MAKEFLAGS),$(if $(findstring =,$(chunk)),$(if $(findstring stage1,$(chunk)),,$(chunk)),)) +envfrompreviousrun.mk: @echo "# do not edit" > $@ @$(foreach var,$(SAVED_VARS),echo "$(var):=$($(var))" >> $@ ;) + @$(foreach chunk,$(ASSIGNS),echo "override $(chunk)" | sed -e s,=,:=, >> $@;) @echo "# do not edit" > aliases @echo -n "alias m=\"make " >> aliases @$(foreach var,$(SAVED_VARS),echo -n " $(var)=$($(var))" >> aliases ;) + @echo -n $(ASSIGNS) >> aliases @echo "\"" >> aliases @echo "alias m1=\"m stage1=true\"" >> aliases -savedpldistro: savedpldistro.mk -.PHONY: savedpldistro +envfrompreviousrun: envfrompreviousrun.mk +.PHONY: envfrompreviousrun # always refresh this -all: savedpldistro +all: envfrompreviousrun #################### regular make @@ -711,7 +716,7 @@ clean-help: ### brute force clean distclean1: - rm -rf savedpldistro.mk .rpmmacros spec2make header.spec SPECS MAKE $(DISTCLEANS) + rm -rf envfrompreviousrun.mk .rpmmacros spec2make header.spec SPECS MAKE $(DISTCLEANS) distclean2: rm -rf MODULES SOURCES BUILD BUILDROOT RPMS SRPMS tmp distclean: distclean1 distclean2