diff options
-rw-r--r-- | lib/make/make.config.rules.in | 23 | ||||
-rw-r--r-- | lib/make/make.configuration | 9 | ||||
-rw-r--r-- | lib/make/make.thornlib | 5 |
3 files changed, 34 insertions, 3 deletions
diff --git a/lib/make/make.config.rules.in b/lib/make/make.config.rules.in index b8437a74..07c37d9e 100644 --- a/lib/make/make.config.rules.in +++ b/lib/make/make.config.rules.in @@ -12,8 +12,29 @@ # @enddesc # @@*/ +# Dividers to make the screen output slightly nicer +DIVEL = __________________ +DIVIDER = $(DIVEL)$(DIVEL)$(DIVEL)$(DIVEL) + +define PREPROCESS_C +cat $< | $(PERL) $(CCTK_HOME)/lib/sbin/c_file_processor.pl $(CONFIG) > $(notdir $<) +endef + +define COMPILE_C +current_wd=`pwd` ; cd $(SCRATCH_BUILD) ; $(CC) $(CFLAGS) -c -o $$current_wd/$@ $$current_wd/$(notdir $<) $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DCCODE +endef + +define POSTPROCESS_C +endef + %.o: $(SRCDIR)/%.c - $(CC) $(CFLAGS) -c -o $@ $< $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DCCODE + @echo $(DIVIDER) + @echo Preprocessing $< + $(PREPROCESS_C) + @echo Compiling $< + $(COMPILE_C) + @echo Postprocessing $< + $(POSTPROCESS_C) %.d: $(SRCDIR)/%.c $(CPP) -M $(CFLAGS) $< $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DCCODE > $@ diff --git a/lib/make/make.configuration b/lib/make/make.configuration index 113f4c7e..2bdfde45 100644 --- a/lib/make/make.configuration +++ b/lib/make/make.configuration @@ -9,12 +9,15 @@ # @@*/ # Silence all but designated output -.SILENT: +#.SILENT: # Some configuration variables CONFIG = $(TOP)/config-data BINDINGS_DIR = $(TOP)/bindings +# Scratch build area - need this to make sure F90 module files end up all +# in one directory. +export SCRATCH_BUILD=$(TOP)/scratch DATESTAMP = $(CCTK_HOME)/src/datestamp.c export MAKE_DIR = $(CCTK_HOME)/lib/make @@ -55,6 +58,7 @@ $(EXE): $(CONFIG)/make.thornlist $(patsubst %,$(CCTK_LIBDIR)/lib%.a,$(notdir $(T $(CCTK_LIBDIR)/lib%.a: update @echo $(DIVIDER) @echo Checking status of $(notdir $@) + if [ ! -d $(SCRATCH_BUILD) ]; then $(MKDIR) $(SCRATCH_BUILD) ; fi if [ ! -d $(BUILD_DIR) ]; then $(MKDIR) $(BUILD_DIR) ; fi thorn_name=$(@:$(CCTK_LIBDIR)/lib%.a=%); \ if [ "$$thorn_name" = "Cactus" ] ; then src_dir=$(CCTK_HOME)/src ; \ @@ -106,4 +110,5 @@ $(TOP)/ActiveThorns: update: clean: - find $(TOP) -name '*.o' -o -name '*.a' -exec rm {} \; + @echo Deleting all object files in $(TOP) + find $(TOP) \( -name '*.o' -o -name '*.a' \) -exec rm {} \; diff --git a/lib/make/make.thornlib b/lib/make/make.thornlib index d0ae1667..79d427ca 100644 --- a/lib/make/make.thornlib +++ b/lib/make/make.thornlib @@ -11,6 +11,10 @@ # Silence all but designated output #.SILENT: +# Dividers to make the screen output slightly nicer +DIVEL = __________________ +DIVIDER = $(DIVEL)$(DIVEL)$(DIVEL)$(DIVEL) + # Include the main make definitions for this configuration include $(CONFIG)/make.config.defn @@ -48,6 +52,7 @@ SRCS = $(CCTK_SRCS) OBJS = $(patsubst %,%.o,$(basename $(SRCS))) $(NAME): $(addsuffix .check, $(SUBDIRS)) $(OBJS) $(SRCDIR)/make.code.defn $(foreach DIR,$(SUBDIRS), $(SRCDIR)/$(DIR)/make.code.defn) + @echo $(DIVIDER) if [ -r $(NAME) ] ; then echo Updating $(NAME) ; else echo Creating $(NAME) ; fi $(AR) $(ARFLAGS) $@ $(OBJS) # $(RANLIB) $@ |