summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-01-22 08:14:26 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-01-22 08:14:26 +0000
commitada392b80647115420cf6d340278d244d1a0286e (patch)
tree614a6d890ddc435279b06c8c1fd960b0970108c5
parent716bb0e8db52a0a6abd637c0786ae84eae644218 (diff)
Now passes through defines to the preprocessor to allow the parameters to work.
Now all you need to do is #include "config.h" and #include "cctk_parameters.h" at the top of your c source file, and then state DECLARE_PARSER at the top of any subroutine where you want to use the parameters. Note that the flesh should use the getparameter subroutine, rather than this method, otherwise it may need to be recompiled whenever someone adds a public parameter. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@104 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--lib/make/make.config.rules.in8
-rw-r--r--lib/make/make.configuration4
-rw-r--r--lib/make/make.subdir6
-rw-r--r--lib/make/make.thornlib8
4 files changed, 15 insertions, 11 deletions
diff --git a/lib/make/make.config.rules.in b/lib/make/make.config.rules.in
index c2c9cf75..31cc9a47 100644
--- a/lib/make/make.config.rules.in
+++ b/lib/make/make.config.rules.in
@@ -13,13 +13,13 @@
# @@*/
%.o: $(SRCDIR)/%.c
- $(CC) $(CFLAGS) -c -o $@ $< $(addprefix -I, $(INC_DIRS))
+ $(CC) $(CFLAGS) -c -o $@ $< $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DCCODE
%.o: $(SRCDIR)/%.cc
- $(CXX) $(CXXFLAGS) -c -o $@ $< $(addprefix -I, $(INC_DIRS))
+ $(CXX) $(CXXFLAGS) -c -o $@ $< $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DCCODE
%.o: $(SRCDIR)/%.F77
- $(F77) $(F77FLAGS) -c -o $@ $< $(addprefix -I, $(INC_DIRS))
+ $(F77) $(F77FLAGS) -c -o $@ $< $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DFCODE
%.o: $(SRCDIR)/%.F
- $(F90) $(F90FLAGS) -c -o $@ $< $(addprefix -I, $(INC_DIRS))
+ $(F90) $(F90FLAGS) -c -o $@ $< $(INC_DIRS:%=-I%) $(EXTRA_DEFINES:%=-D%) -DFCODE
diff --git a/lib/make/make.configuration b/lib/make/make.configuration
index 85bfd10c..9899c345 100644
--- a/lib/make/make.configuration
+++ b/lib/make/make.configuration
@@ -9,7 +9,7 @@
# @@*/
# Silence all but designated output
-.SILENT:
+.SILENT:
# Some configuration variables
CONFIG = $(TOP)/config-data
@@ -64,7 +64,7 @@ $(CCTK_LIBDIR)/lib%.a: update
cd $(BUILD_DIR)/$$thorn_name ; \
if [ -r "$$src_dir/Makefile" ] ; then make_file=$$src_dir/Makefile ; \
else make_file=$(MAKE_DIR)/make.thornlib ; fi ; \
- $(MAKE) TOP=$(TOP) SRCDIR=$$src_dir CONFIG=$(CONFIG) NAME=$@ -f $$make_file
+ $(MAKE) TOP=$(TOP) SRCDIR=$$src_dir CONFIG=$(CONFIG) NAME=$@ THORN=$$thorn_name -f $$make_file
@echo $(DIVIDER)
diff --git a/lib/make/make.subdir b/lib/make/make.subdir
index c196fca4..91b6e124 100644
--- a/lib/make/make.subdir
+++ b/lib/make/make.subdir
@@ -9,13 +9,15 @@
# @@*/
# Silence all but designated output
-.SILENT:
+#.SILENT:
# Include the main make definitions for this configuration
include $(CONFIG)/make.config.defn
# Add appropriate include lines
-INC_DIRS += $(SRCDIR) $(SRCDIR)/include $(CONFIG) $(CCTK_HOME)/src/include
+INC_DIRS += $(SRCDIR) $(SRCDIR)/include $(CONFIG) $(TOP)/bindings/include $(CCTK_HOME)/src/include
+
+EXTRA_DEFINES += THORN_IS_$(THORN)
# Include the subdirectories local include data
include $(SRCDIR)/make.code.defn
diff --git a/lib/make/make.thornlib b/lib/make/make.thornlib
index f01905f4..be540269 100644
--- a/lib/make/make.thornlib
+++ b/lib/make/make.thornlib
@@ -9,13 +9,15 @@
# @@*/
# Silence all but designated output
-.SILENT:
+#.SILENT:
# Include the main make definitions for this configuration
include $(CONFIG)/make.config.defn
# Add appropriate include lines
-INC_DIRS += $(SRCDIR) $(SRCDIR)/include $(CONFIG) $(CCTK_HOME)/src/include
+INC_DIRS += $(SRCDIR) $(SRCDIR)/include $(CONFIG) $(TOP)/bindings/include $(CCTK_HOME)/src/include
+
+EXTRA_DEFINES += THORN_IS_$(THORN)
# Define some make variables
PRE_WRAPPER = make.pre
@@ -63,7 +65,7 @@ include $(CONFIG)/make.config.rules
$(addsuffix .check, $(SUBDIRS)) :
if [ ! -d $(basename $@) ] ; then $(MKDIR) $(basename $@) ; fi
- cd $(basename $@) ; $(MAKE) TOP=$(TOP) CONFIG=$(CONFIG) SRCDIR=$(SRCDIR)/$(basename $@) -f $(MAKE_DIR)/make.subdir
+ cd $(basename $@) ; $(MAKE) TOP=$(TOP) CONFIG=$(CONFIG) SRCDIR=$(SRCDIR)/$(basename $@) THORN=$(THORN) -f $(MAKE_DIR)/make.subdir
# This one puts a file containing identity info into the build subdirectory
$(addsuffix /make.identity, $(SUBDIRS)):