summaryrefslogtreecommitdiff
path: root/lib/make/make.configuration
diff options
context:
space:
mode:
authoreschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2012-10-28 21:48:32 +0000
committereschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2012-10-28 21:48:32 +0000
commit9aa55d7e9dae5d6ff37b4fc81230d75664217e2b (patch)
treeb74292b9e895e8fde0726707e73a034267854760 /lib/make/make.configuration
parente91cde0953119fa01d92174413643e889adbb98e (diff)
Add configuration options allowing moving all object files into the executable
Add configuration options allowing people to ensure that all thorn source files make it into the executable. Among other things, this ensures that each routine has a unique name. This is disabled by default. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4899 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/make.configuration')
-rw-r--r--lib/make/make.configuration16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/make/make.configuration b/lib/make/make.configuration
index 81873574..abfcc05e 100644
--- a/lib/make/make.configuration
+++ b/lib/make/make.configuration
@@ -126,18 +126,30 @@ UTIL_DIR=$(EXEDIR)$(DIRSEP)$(CONFIG_NAME)
# Build the list of all libraries
+ifeq ($(strip $(BEGIN_WHOLE_ARCHIVE_FLAGS)),)
+# Repeat Cactus only if --whole-archive is not used
ALLCACTUSLIBS_BASE = $(notdir $(CACTUSLIBS) $(THORN_LINKLIST) $(CACTUSLIBS))
+else
+ALLCACTUSLIBS_BASE = $(notdir $(THORNS) $(CACTUSLIBS))
+endif
ALLCACTUSLIBS = $(ALLCACTUSLIBS_BASE:%=$(CCTK_LIBNAME_PREFIX)%)
+$(CCTK_LIBDIR)/LINKLIST: $(patsubst %,$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)%$(LIBNAME_SUFFIX),$(notdir $(THORNS) $(CACTUSLIBS)))
+ cd $(CCTK_LIBDIR); \
+ for thorn in $(notdir $(THORNS) $(CACTUSLIBS)); do \
+ xargs -n 1 -I :OBJFILE: echo $$thorn/:OBJFILE: <$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)$$thorn$(LIBNAME_SUFFIX).objectlist; \
+ done >$@.tmp
+ mv $@.tmp $@
+
# Build the executable
-$(EXEDIR)$(DIRSEP)$(EXE): $(CONFIG)/make.thornlist $(CONFIG)/cctki_version.h $(patsubst %,$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)%$(LIBNAME_SUFFIX),$(notdir $(THORNS) $(CACTUSLIBS)))
+$(EXEDIR)$(DIRSEP)$(EXE): $(CONFIG)/make.thornlist $(CONFIG)/cctki_version.h $(patsubst %,$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)%$(LIBNAME_SUFFIX),$(notdir $(THORNS) $(CACTUSLIBS))) $(CCTK_LIBDIR)/LINKLIST
@echo Creating $(EXE) in $(EXEDIR) from $(THORNS)
datetime=`/bin/date +'%Y-%m-%dT%H:%M:%S%z' 2>&1` ; \
if [ $$? != 0 ]; then datetime=`/bin/date` ; fi ; \
$(CC) $(CFLAGS) -DCCTK_COMPILE_DATETIME="$$datetime" $(CCOMPILEONLY)$(OPTIONSEP)"$(call TRANSFORM_DIRS,$(TOP)/datestamp.o)" -I"$(call TRANSFORM_DIRS,$(CCTK_HOME)/src/include)" -I"$(call TRANSFORM_DIRS,$(CONFIG))" "$(call TRANSFORM_DIRS,$(DATESTAMP))"
if [ ! -d $(EXEDIR) ]; then $(MKDIR) $(MKDIRFLAGS) $(EXEDIR) ; fi
- $(LD) $(CREATEEXE)$(OPTIONSEP)"$(call TRANSFORM_DIRS,$@)" $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(EXTRAFLAGS) "$(call TRANSFORM_DIRS,$(TOP)/datestamp.o)" $(CACTUSLIBLINKLINE) $(GENERAL_LIBRARIES)
+ $(LD) $(CREATEEXE)$(OPTIONSEP)"$(call TRANSFORM_DIRS,$@)" $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(EXTRAFLAGS) "$(call TRANSFORM_DIRS,$(TOP)/datestamp.o)" $(BEGIN_WHOLE_ARCHIVE_FLAGS) $(CACTUSLIBLINKLINE) $(END_WHOLE_ARCHIVE_FLAGS) $(GENERAL_LIBRARIES)
$(NOTIFY_DIVIDER)
# Version file