better handling of failures during spec2make - not enough to get make to fail though
[build.git] / Makefile
index b6a8051..b405fac 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -131,6 +131,20 @@ include $(PLDISTROCONTENTS)
 PLDISTROTAGS := $(PLDISTRO)-tags.mk
 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
+# we set a default in case we run the build manually:
+# if the local directory was svn checked out, then use the corresponding URL
+svn-info-url-line := $(shell svn info 2> /dev/null | grep URL:)
+default-build-SVNPATH := $(lastword $(svn-info-url-line))
+# otherwise, use this hard-coded default
+ifeq "$(default-build-SVNPATH)" ""
+default-build-SVNPATH := http://svn.planet-lab.org/svn/build/trunk
+endif
+# use default if necessary
+build-SVNPATH ?= $(default-build-SVNPATH)
+
 ########## stage1 and stage1iter
 # extract specs and compute .mk files by running 
 # make stage1=true
@@ -294,8 +308,7 @@ spec2make: spec2make.c
 define target_mk
 MAKE/$(1).mk: $($(1).specpath) spec2make .rpmmacros
        mkdir -p MAKE
-       ./spec2make $($(1)-RPMFLAGS) $($(1).specpath) $(1) > MAKE/$(1).mk
-       @if [ -z MAKE/$(1).mk ] ; then rm MAKE/$(1).mk ; exit 1 ; fi
+       ./spec2make $($(1)-RPMFLAGS) $($(1).specpath) $(1) > MAKE/$(1).mk || rm MAKE/$(1).mk
 endef
 
 $(foreach package,$(ALL),$(eval $(call target_mk,$(package))))
@@ -637,15 +650,6 @@ $(foreach package,$(sort $(ALL)), $(eval $(call rpm_version_target,$(package))))
 versions: myplc-release version-build version-svns version-rpms
 .PHONY: versions version-build version-rpms version-svns
 
-#################### include install Makefile
-# the default is to use the distro-dependent install file
-# however the main distro file can redefine PLDISTROINSTALL
-ifndef PLDISTROINSTALL
-PLDISTROINSTALL := $(PLDISTRO)-install.mk
-endif
-# only if present
--include $(PLDISTROINSTALL)
-
 #################### package info
 PKGKEYS := tarballs source codebase srpm rpms rpmnames rpm-release rpm-name rpm-version rpm-subversion
 %-pkginfo: package=$(subst -pkginfo,,$@)
@@ -679,6 +683,11 @@ info: packages modules branches
 
 .PHONY: info packages modules branches module-tools
 
+####################
+tests_svnpath:
+       @$(if $(TESTS_SVNPATH), echo $(TESTS_SVNPATH) > $@, \
+       echo "http://svn.planet-lab.org/svn/tests/trunk" > $@)
+
 ####################
 help:
        @echo "********** Run make in two stages:"