Disable openvswitch for rc26 build
[build.git] / Makefile
index 6271105..78533ca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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))))
@@ -423,8 +418,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 +434,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 +712,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