X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=788205cd7543baf5fa507884a0e3dc18435b6f6e;hb=c251f05c951a70a3dd4236d17a813c16e971d8ea;hp=8f1ecddcde697f1351a1ca38118066e9104ef459;hpb=9f093eedd47089f3f275d044978d97643a01e1bc;p=build.git diff --git a/Makefile b/Makefile index 8f1ecddc..788205cd 100644 --- a/Makefile +++ b/Makefile @@ -167,16 +167,17 @@ config.$(1): config.$(1).svnpath svn export $$($(1).config.SVNPATH) config.$(1) endef +FOO=@ # fetching with git define remote_pldistro_fetch_git $(1).config.GITPATH := $(shell grep -v "^#" config.$(1).gitpath) -$(1).config.gitrepo := $(firstword $(subst @, ,$$($(1).config.GITPATH))) -$(1).config.gittag := $(word 2,$(subst @, ,$$($(1).config.GITPATH))) -$(1).config.gittag := $(if $$($(1).config.gittag),$$($(1).config.gittag),master) +$(1).config.gitrepo := $$(firstword $$(subst @, ,$$($(1).config.GITPATH))) +$(1).config.gittag := $$(word 2,$$(subst @, ,$$($(1).config.GITPATH))) +$(1).config.gittag := $$(if $$($(1).config.gittag),$$($(1).config.gittag),master) config.$(1): GITPATH=$(shell grep -v "^#" config.$(1).gitpath) config.$(1): config.$(1).gitpath @echo "Fetching (git) details for remote pldistro $(1)" - mkdir config.$(1) + mkdir -p config.$(1) git $(GITTAG) archive --remote=$$($(1).config.gitrepo) $$($(1).config.gittag) | tar -C config.$(1) -xf - endef @@ -198,10 +199,7 @@ DISTCLEANS += $(1).mk $(2).mk config.$(1) $(eval $(call remote_pldistro_fetch_$(3),$(1))) endef -# somehow this does not work, handle manually instead -#REMOTE-PLDISTROS="wextoolbox" -#$(foreach distro, $(REMOTE-PLDISTROS), $(eval $(call remote_pldistro,$(distro),$(distro)-tags))) -$(eval $(call remote_pldistro,wextoolbox,wextoolbox-tags,svn)) +$(eval $(call remote_pldistro,wextoolbox,wextoolbox-tags,git)) ########## stage1 and stage1iter # extract specs and compute .mk files by running @@ -295,11 +293,13 @@ ALL.modules:=$(sort $(ALL.modules)) define stage1_module_vars ifneq "$($(1)-SVNPATH)" "" $(1)-SVNPATH := $(strip $($(1)-SVNPATH)) +$(1)-SCMPATH := $(strip $($(1)-SVNPATH)) else -$(1)-GITPATH := $(strip $($(1)-GITPATH)) -$(1).gitrepo := $(firstword $(subst @, ,$($(1)-GITPATH))) -$(1).gittag := $(word 2,$(subst @, ,$($(1)-GITPATH))) -$(1).gittag := $(if $($(1).gittag),$($(1).gittag),master) +$(1)-GITPATH := $$(strip $$($(1)-GITPATH)) +$(1)-SCMPATH := $$(strip $$($(1)-GITPATH)) +$(1).gitrepo := $$(firstword $$(subst @, ,$$($(1)-GITPATH))) +$(1).gittag := $$(word 2,$$(subst @, ,$$($(1)-GITPATH))) +$(1).gittag := $$(if $$($(1).gittag),$$($(1).gittag),master) endif endef @@ -344,6 +344,7 @@ define target_spec $($(1).specpath): header.spec $($(1).codespec) mkdir -p SPECS cat header.spec > $($(1).specpath) + echo "%define SCMURL $($($(1).module)-SCMPATH)" >> $($(1).specpath) $(if $($(1).has-date),echo "%define date $(shell date +%Y.%m.%d)" >> $($(1).specpath),) $(if $($(1)-SPECVARS), \ $(foreach line,$($(1)-SPECVARS), \ @@ -407,7 +408,7 @@ endif ### this utility allows to extract various info from a spec file ### and to define them in makefiles spec2make: spec2make.c - $(CC) -g -Wall $< -o $@ -lrpm -lrpmbuild + $(CC) -g -Wall $< -o $@ -lrpm -lrpmbuild -lrpmio -lpopt ### run spec2make on the spec file and include the result # usage: spec2make package @@ -714,7 +715,6 @@ version-build: @echo "Build build-base: $(BASE)" @echo "Build planetlab-distro: $(PLDISTRO)" @echo "Build planetlab-tags: $(PLDISTROTAGS)" - @echo -n 'Build planetlab-tagsid: ' ; fgrep '$$''Id' $(PLDISTROTAGS) @echo "Build target-arch: $(HOSTARCH)" @echo "Build target-distro: $(DISTRO)" @echo "Build target-distroname: $(DISTRONAME)" @@ -772,10 +772,10 @@ info-branches: module-tools: @$(foreach module,$(ALL.modules), \ - $(if $($(module)-GITPATH), \ + $(if $($(module)-GITPATH), \ $(if $($(module)-BRANCH), \ - echo git:$(module):$($(module)-BRANCH); , \ - echo git:$(module); ), \ + echo $(module):$($(module)-BRANCH); , \ + echo $(module); ), \ $(if $($(module)-BRANCH), \ echo $(module):$($(module)-BRANCH); , \ echo $(module); ))) @@ -784,6 +784,9 @@ info: info-packages info-modules info-branches .PHONY: info info-packages info-modules info-branches module-tools +show-multi-modules: + @$(foreach package,$(ALL),$(if $(subst x1,,x$(words $($(package)-MODULES))), echo p=$(package) mods=$($(package)-MODULES) ;)) +.PHONY: show-multi-modules #################### help: @echo "********** Run make in two stages:"