From 6345342a5de31761b11e1c880f6ec72a97d70c1b Mon Sep 17 00:00:00 2001 From: eschnett Date: Tue, 20 Sep 2011 01:28:16 +0000 Subject: Reverting previous commit git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@210 83718e91-0e4f-0410-abf4-91180603181f --- src/make.configuration.deps | 95 ++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 53 deletions(-) diff --git a/src/make.configuration.deps b/src/make.configuration.deps index 671dc7c..ba81ac3 100644 --- a/src/make.configuration.deps +++ b/src/make.configuration.deps @@ -37,8 +37,8 @@ FRM-LIB = $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)Formaline-cactus $(EXEDIR)$(DIRSEP)$(EXE): $(FRM-LIB) -FRM-OBJS = $(TARBALL_DIR)/cactus-meta.o $(TARBALL_DIR)/build-id.o $(TARBALL_DIR)/Cactus/flesh.o $(patsubst %,$(TARBALL_DIR)/%/thorn.o,$(notdir $(THORNS))) -FRM-OBJS-other = $(TARBALL_DIR)/Cactus/flesh-????.o $(patsubst %,$(TARBALL_DIR)/%/thorn-????.o,$(notdir $(THORNS))) +FRM-OBJS = $(TARBALL_DIR)/cactus-meta.o $(TARBALL_DIR)/build-id.o $(TARBALL_DIR)/flesh-Cactus.o $(patsubst %,$(TARBALL_DIR)/thorn-%.o,$(notdir $(THORNS))) +FRM-OBJS-other = $(TARBALL_DIR)/flesh-Cactus-????.o $(patsubst %,$(TARBALL_DIR)/thorn-%-????.o,$(notdir $(THORNS))) $(FRM-LIB): $(FRM-OBJS) # $(AR) $(ARFLAGS) $@ $^ @@ -57,7 +57,7 @@ $(FRM-LIB): $(FRM-OBJS) ## Build the thorns' tarballs already while the thorns are compiled ## (does not work) # -#$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)%$(LIBNAME_SUFFIX): $(TARBALL_DIR)/%/thorn.o +#$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)%$(LIBNAME_SUFFIX): $(TARBALL_DIR)/thorn-%.o @@ -103,7 +103,7 @@ $(TARBALL_DIR)/build-id.c: $(TOP)/BUILD-ID $(TARBALL_DIR)/cactus-meta.o: $(TARBALL_DIR)/cactus-meta.c cd $(TARBALL_DIR) && $(CC) $(CFLAGS) -c -o $@ $^ -$(TARBALL_DIR)/cactus-meta.c: $(TARBALL_DIR)/Cactus/flesh.c $(patsubst %,$(TARBALL_DIR)/%/thorn.c,$(notdir $(THORNS))) +$(TARBALL_DIR)/cactus-meta.c: $(TARBALL_DIR)/flesh-Cactus.c $(patsubst %,$(TARBALL_DIR)/thorn-%.c,$(notdir $(THORNS))) $(FORMALINE_BIN_DIR)/makemetablob.pl Cactus $(notdir $(THORNS)) > $@ .PRECIOUS: $(TARBALL_DIR)/cactus-meta.c $(TARBALL_DIR)/cactus-meta.o @@ -111,7 +111,7 @@ $(TARBALL_DIR)/cactus-meta.c: $(TARBALL_DIR)/Cactus/flesh.c $(patsubst %,$(TARBA #cleandeps: -# rm -rf $(TOP)/scratch/flesh.files $(TOP)/scratch/flesh.ccldeps $(TOP)/scratch/thorn-*.files $(TOP)/scratch/thorn-*.ccldeps +# rm -rf $(TOP)/scratch/flesh-Cactus.files $(TOP)/scratch/flesh-Cactus.ccldeps $(TOP)/scratch/thorn-*.files $(TOP)/scratch/thorn-*.ccldeps @@ -119,25 +119,24 @@ $(TARBALL_DIR)/cactus-meta.c: $(TARBALL_DIR)/Cactus/flesh.c $(patsubst %,$(TARBA # Flesh ############################################################################### -# TODO: Don't serialise this build -$(TARBALL_DIR)/Cactus/flesh.o: $(TARBALL_DIR)/Cactus/flesh.c +$(TARBALL_DIR)/flesh-Cactus.o: $(TARBALL_DIR)/flesh-Cactus.c @echo "Creating Formaline tarball for the flesh" - cd $(TARBALL_DIR)/Cactus && $(CC) $(CFLAGS) -c $^ $(^:%.c=%-????.c) + cd $(TARBALL_DIR) && $(CC) $(CFLAGS) -c $^ $(^:%.c=%-????.c) -$(TARBALL_DIR)/Cactus/flesh.c: $(TARBALL_DIR)/Cactus/flesh.tar.gz $(CCTK_HOME)/arrangements/CactusUtils/Formaline/src/util/VERSION +$(TARBALL_DIR)/flesh-Cactus.c: $(TARBALL_DIR)/flesh-Cactus.tar.gz $(CCTK_HOME)/arrangements/CactusUtils/Formaline/src/util/VERSION $(RM) -f $(@:%.c=%-????.c) $(FORMALINE_BIN_DIR)/makeblob.pl $(@:%.c=%) '' Cactus < $< -$(TARBALL_DIR)/Cactus/flesh.tar.gz: $(TARBALL_DIR)/Cactus/flesh.files +$(TARBALL_DIR)/flesh-Cactus.tar.gz: $(TARBALL_DIR)/flesh-Cactus.files cd $(CCTK_HOME) && \ $(TAR) czf $@ -T $< || [ $$(( $$? / ($(IS_GNUTAR)+1) )) -eq 0 ] # This dependency means that the tarball for a thorn is only updated -# if the thorn is actually recompiled. This does not catch changes to +# if the thorn is actually recompiled. This does not catch changes to # files that do not influence the executable. -$(TARBALL_DIR)/Cactus/flesh.files: $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)$(FLESHLIB)$(LIBNAME_SUFFIX) $(TARBALL_DIR)/Cactus/flesh.ccldeps +$(TARBALL_DIR)/flesh-Cactus.files: $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)$(FLESHLIB)$(LIBNAME_SUFFIX) $(TARBALL_DIR)/flesh-Cactus.ccldeps cd $(CCTK_HOME) && \ - find CONTRIBUTORS COPYRIGHT Makefile lib src \ + find CONTRIBUTORS COPYRIGHT Makefile lib/ src/ \ `ls configs/$(notdir $(TOP))/OptionList 2> /dev/null` \ `ls configs/$(notdir $(TOP))/properties.ini 2> /dev/null` \ `ls configs/$(notdir $(TOP))/RunScript 2> /dev/null` \ @@ -158,11 +157,11 @@ $(TARBALL_DIR)/Cactus/flesh.files: $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAM ! -type d \ -print > $@ --include $(TARBALL_DIR)/Cactus/flesh.ccldeps -# Make aborts if these dependencies vanish. Therefore mention only -# files here that cannot go away. -$(TARBALL_DIR)/Cactus/flesh.ccldeps: - mkdir -p $(TARBALL_DIR)/Cactus +-include $(TARBALL_DIR)/flesh-Cactus.ccldeps +# Make aborts if these dependencies vanish. Therefore mention only files +# here that cannot go away. +$(TARBALL_DIR)/flesh-Cactus.ccldeps: + mkdir -p $(TARBALL_DIR) { \ echo "$(@:%.ccldeps=%.files) \\"; \ echo "$@: \\"; \ @@ -171,7 +170,7 @@ $(TARBALL_DIR)/Cactus/flesh.ccldeps: echo " $(CCTK_HOME)/src/schedule.ccl"; \ } > $@ -.PRECIOUS: $(TARBALL_DIR)/Cactus/flesh.ccldeps $(TARBALL_DIR)/Cactus/flesh.files $(TARBALL_DIR)/Cactus/flesh.tar.gz $(TARBALL_DIR)/Cactus/flesh.c $(TARBALL_DIR)/Cactus/flesh.o +.PRECIOUS: $(TARBALL_DIR)/flesh-Cactus.ccldeps $(TARBALL_DIR)/flesh-Cactus.files $(TARBALL_DIR)/flesh-Cactus.tar.gz $(TARBALL_DIR)/flesh-Cactus.c $(TARBALL_DIR)/flesh-Cactus.o @@ -179,23 +178,22 @@ $(TARBALL_DIR)/Cactus/flesh.ccldeps: # Thorns ############################################################################### -# TODO: Don't serialise this build -$(TARBALL_DIR)/%/thorn.o: $(TARBALL_DIR)/%/thorn.c +$(TARBALL_DIR)/thorn-%.o: $(TARBALL_DIR)/thorn-%.c @echo "Creating Formaline tarball for thorn $*" - cd $(TARBALL_DIR)/$* && $(CC) $(CFLAGS) -c $(patsubst $(TARBALL_DIR)/$*/%, %, $^ $(^:%.c=%-????.c)) + cd $(TARBALL_DIR) && $(CC) $(CFLAGS) -c $(patsubst $(TARBALL_DIR)/%, %, $^ $(^:%.c=%-????.c)) -$(TARBALL_DIR)/%/thorn.c: $(TARBALL_DIR)/%/thorn.tar.gz $(CCTK_HOME)/arrangements/CactusUtils/Formaline/src/util/VERSION - cd $(TARBALL_DIR)/$* && $(RM) -f $(@:$(TARBALL_DIR)/$*/%.c=%-????.c) - $(FORMALINE_BIN_DIR)/makeblob.pl $(@:%.c=%) $(patsubst %/,%,$(dir $(filter %/$(@:$(TARBALL_DIR)/%/thorn.c=%),$(THORNS)))) $(@:$(TARBALL_DIR)/%/thorn.c=%) < $< +$(TARBALL_DIR)/thorn-%.c: $(TARBALL_DIR)/thorn-%.tar.gz $(CCTK_HOME)/arrangements/CactusUtils/Formaline/src/util/VERSION + cd $(TARBALL_DIR) && $(RM) -f $(@:$(TARBALL_DIR)/%.c=%-????.c) + $(FORMALINE_BIN_DIR)/makeblob.pl $(@:%.c=%) $(patsubst %/,%,$(dir $(filter %/$(@:$(TARBALL_DIR)/thorn-%.c=%),$(THORNS)))) $(@:$(TARBALL_DIR)/thorn-%.c=%) < $< -$(TARBALL_DIR)/%/thorn.tar.gz: $(TARBALL_DIR)/%/thorn.files +$(TARBALL_DIR)/thorn-%.tar.gz: $(TARBALL_DIR)/thorn-%.files cd $(CCTK_HOME) && \ $(TAR) czf $@ -T $< || [ $$(( $$? / ($(IS_GNUTAR)+1) )) -eq 0 ] # This dependency means that the tarball for a thorn is only updated # if the thorn is actually recompiled. This does not catch changes to # files that do not influence the executable. -$(TARBALL_DIR)/%/thorn.files: $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)%$(LIBNAME_SUFFIX) $(TARBALL_DIR)/%/thorn.ccldeps +$(TARBALL_DIR)/thorn-%.files: $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)%$(LIBNAME_SUFFIX) $(TARBALL_DIR)/thorn-%.ccldeps cd $(CCTK_HOME) && \ find arrangements/$(filter %/$*,$(THORNS))/. \ -name 'data' -prune -o \ @@ -210,11 +208,11 @@ $(TARBALL_DIR)/%/thorn.files: $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PRE ! -type d \ -print | sed -e 's+/[.]/+/+g' > $@ --include $(patsubst %,$(TARBALL_DIR)/%/thorn.ccldeps,$(notdir $(THORNS))) +-include $(patsubst %,$(TARBALL_DIR)/thorn-%.ccldeps,$(notdir $(THORNS))) # Make aborts if these dependencies vanish. Therefore mention only files # here that cannot go away. -$(TARBALL_DIR)/%/thorn.ccldeps: - mkdir -p $(TARBALL_DIR)/$* +$(TARBALL_DIR)/thorn-%.ccldeps: + mkdir -p $(TARBALL_DIR) { \ echo "$(@:%.ccldeps=%.files) \\"; \ echo "$@: \\"; \ @@ -223,7 +221,7 @@ $(TARBALL_DIR)/%/thorn.ccldeps: echo " $(CCTK_HOME)/arrangements/$(filter %/$*,$(THORNS))/schedule.ccl"; \ } > $@ -.PRECIOUS: $(TARBALL_DIR)/%/thorn.ccldeps $(TARBALL_DIR)/%/thorn.files $(TARBALL_DIR)/%/thorn.tar.gz $(TARBALL_DIR)/%/thorn.c $(TARBALL_DIR)/%/thorn.o +.PRECIOUS: $(TARBALL_DIR)/thorn-%.ccldeps $(TARBALL_DIR)/thorn-%.files $(TARBALL_DIR)/thorn-%.tar.gz $(TARBALL_DIR)/thorn-%.c $(TARBALL_DIR)/thorn-%.o @@ -328,7 +326,7 @@ git-push-everything: git-commit-everything $(BUILD-ID-FILE) } || echo "Formaline: WARNING: Error while pushing to master repository" .PHONY: git-commit-everything -git-commit-everything: $(GIT-TAG-DIR)/Cactus/flesh.git-tag $(GIT-TAG-DIR)/all-thorn-git-tags $(BUILD-ID-FILE) git-rm-unused-thorns +git-commit-everything: $(GIT-TAG-DIR)/flesh-Cactus.git-tag $(GIT-THORNS:%=$(GIT-TAG-DIR)/thorn-%.git-tag) $(BUILD-ID-FILE) git-rm-unused-thorns { \ '$(GIT-BIN)/git-commit-everything.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' "$$(cat $(BUILD-ID-FILE))" "$$(cat $(CONFIG-ID-FILE))"; \ } || echo "Formaline: WARNING: Error while committing to repository" @@ -341,36 +339,27 @@ git-rm-unused-thorns: $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)Form '$(GIT-BIN)/git-rm-unused-thorns.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' $(THORNS); \ } || echo "Formaline: WARNING: Error while removing unused thorns" -.PRECIOUS: $(GIT-TAG-DIR)/Cactus/flesh.git-tag -$(GIT-TAG-DIR)/Cactus/flesh.git-tag: $(TARBALL_DIR)/Cactus/flesh.files - mkdir -p $(GIT-TAG-DIR)/Cactus +.PRECIOUS: $(GIT-TAG-DIR)/flesh-Cactus.git-tag +$(GIT-TAG-DIR)/flesh-Cactus.git-tag: $(TARBALL_DIR)/flesh-Cactus.files + mkdir -p $(GIT-TAG-DIR) { \ '$(GIT-BIN)/git-init-repo.pl' '$(GIT)' '$(GIT-REPO)' && \ echo "Formaline: Adding flesh to git repository..." && \ '$(GIT-BIN)/git-rm-thorn.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' 'Cactus' CONTRIBUTORS COPYRIGHT Makefile lib src configs && \ - xargs '$(GIT-BIN)/git-add-thorn.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' 'Cactus' < $(TARBALL_DIR)/Cactus/flesh.files && \ + xargs '$(GIT-BIN)/git-add-thorn.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' 'Cactus' < $(TARBALL_DIR)/flesh-Cactus.files && \ : > $@; \ } || echo "Formaline: WARNING: Error while adding flesh to git repository" -# Issue all git commands in a single make target and sequentially, -# because accessing the git repository is serialised anyway. -# Serialising this explicitly means that make can continue issuing -# non-git commands in parallel, instead of having several git commands -# waiting for the git lock in parallel. -.PHONY: $(GIT-TAG-DIR)/all-thorn-git-tags -$(GIT-TAG-DIR)/all-thorn-git-tags: $(GIT-THORNS:%=$(TARBALL_DIR)/%/thorn.files) +.PRECIOUS: $(GIT-TAG-DIR)/thorn-%.git-tag +$(GIT-TAG-DIR)/thorn-%.git-tag: $(TARBALL_DIR)/thorn-%.files mkdir -p $(GIT-TAG-DIR) + { \ '$(GIT-BIN)/git-init-repo.pl' '$(GIT)' '$(GIT-REPO)' && \ - for thorn in $(GIT-THORNS); do \ - if ! test "$(GIT-TAG-DIR)/$${thorn}/thorn.git-tag" -nt "$(TARBALL_DIR)/$${thorn}/thorn.files"; then \ - { \ - echo "Formaline: Adding thorn $${thorn} to git repository..." && \ - '$(GIT-BIN)/git-rm-thorn.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' "$${thorn}" 'arrangements/*/'"$${thorn}" && \ - xargs '$(GIT-BIN)/git-add-thorn.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' "$${thorn}" < "$(TARBALL_DIR)/$${thorn}/thorn.files" && \ - : > "$(GIT-TAG-DIR)/$${thorn}/thorn.git-tag"; \ - } || echo "Formaline: WARNING: Error while adding thorn $${thorn} to git repository"; \ - fi; \ - done + echo "Formaline: Adding thorn $* to git repository..." && \ + '$(GIT-BIN)/git-rm-thorn.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' '$*' "'"'arrangements/*/$*'"'" && \ + xargs '$(GIT-BIN)/git-add-thorn.pl' '$(GIT)' '$(GIT-REPO)' '$(GIT-ROOT)' '$*' < $(TARBALL_DIR)/thorn-$*.files && \ + : > $@; \ + } || echo "Formaline: WARNING: Error while adding thorn $* to git repository" endif -- cgit v1.2.3