summaryrefslogtreecommitdiff
path: root/lib/make
diff options
context:
space:
mode:
Diffstat (limited to 'lib/make')
-rw-r--r--lib/make/make.subdir4
-rw-r--r--lib/make/make.thornlib41
2 files changed, 26 insertions, 19 deletions
diff --git a/lib/make/make.subdir b/lib/make/make.subdir
index c70ea2df..2003ac16 100644
--- a/lib/make/make.subdir
+++ b/lib/make/make.subdir
@@ -20,14 +20,14 @@ INC_DIRS += $(SRCDIR) $(SRCDIR)/include
EXTRA_DEFINES += THORN_IS_$(THORN)
# Include the subdirectory's local include data
-include $(SRCDIR)/make.code.defn
+-include $(SRCDIR)/make.code.defn
# Turn source file names into object file names
OBJS = $(SRCS:%=%.o)
# Build all the object files
-make.checked: $(OBJS)
+$(TARGET): $(OBJS)
touch make.checked
# Rules to make the object files
diff --git a/lib/make/make.thornlib b/lib/make/make.thornlib
index 87195beb..005557b9 100644
--- a/lib/make/make.thornlib
+++ b/lib/make/make.thornlib
@@ -24,6 +24,8 @@ INC_DIRS = $(SYS_INC_DIRS) $(SRCDIR) $(SRCDIR)/include $(CONFIG) $(TOP)/bindings
# Allow subdirectories to inherit these include directories
export INC_DIRS
+BINDINGS_DIR=$(TOP)/bindings
+
EXTRA_DEFINES += THORN_IS_$(THORN)
# Define some make variables
@@ -40,8 +42,6 @@ include $(SRCDIR)/make.code.defn
LOCAL_SUBDIRS := . $(SUBDIRS)
-SRCS =
-
# Include all the make.code.defn files for the subdirectories
# These have to be wrapped to allow us to concatanate all the
# SRCS definitions, complete with subdirectory names.
@@ -51,6 +51,13 @@ ifneq ($(strip $(LOCAL_SUBDIRS)),)
-include $(foreach DIR,$(LOCAL_SUBDIRS), $(DIR)/make.identity $(MAKE_DIR)/$(PRE_WRAPPER) $(SRCDIR)/$(DIR)/make.code.defn $(MAKE_DIR)/$(POST_WRAPPER))
endif
+# The CactusBindings pseudo-thorn doesn't need to define its own bindings 8-)
+
+ifneq ($(THORN), CactusBindings)
+THORNBINDINGS=cctk_Bindings
+-include cctk_Bindings/make.identity $(MAKE_DIR)/$(PRE_WRAPPER) $(BINDINGS_DIR)/build/$(THORN)/make.code.defn $(MAKE_DIR)/$(POST_WRAPPER)
+endif
+
# Restore the value of SRCS and SUBDIRS of this directory
SRCS = $(CCTK_SRCS)
@@ -59,21 +66,13 @@ SUBDIRS = $(LOCAL_SUBDIRS)
# Turn source file names into object file names
OBJS = $(SRCS:%=%.o)
-$(NAME): $(addsuffix /make.checked, $(SUBDIRS))
+$(NAME): $(addsuffix /make.checked, $(SUBDIRS) $(THORNBINDINGS))
@echo $(DIVIDER)
if [ -r $(NAME) ] ; then echo Updating $(NAME) ; else echo Creating $(NAME) ; fi
if [ -r $@ ] ; then rm $@ ; fi
$(AR) $(ARFLAGS) $@ $(OBJS)
if test "x$(USE_RANLIB)" = "xyes" ; then $(RANLIB) $(RANLIBFLAGS) $@ ; fi
-# Rules to make the object files
-include $(CONFIG)/make.config.rules
-
-# Extra thorn-specific dependencies
-# This file isn't strictly necessary, so use -include to prevent
-# warnings if it is missing.
--include $(SRCDIR)/make.code.deps
-
# Extra stuff for allowing make to recurse into directories
# This one makes the object files in the subdirectory
@@ -81,15 +80,23 @@ include $(CONFIG)/make.config.rules
$(addsuffix /make.checked, $(SUBDIRS)) : FORCE
if [ ! -d $(dir $@) ] ; then $(MKDIR) $(MKDIRFLAGS) $(dir $@) ; fi
- cd $(dir $@) ; $(MAKE) TOP=$(TOP) CONFIG=$(CONFIG) SRCDIR=$(subst /./,,$(SRCDIR)/$(dir $@)) THORN=$(THORN) -f $(MAKE_DIR)/make.subdir
+ cd $(dir $@) ; $(MAKE) TARGET=make.checked TOP=$(TOP) CONFIG=$(CONFIG) SRCDIR=$(subst /./,,$(SRCDIR)/$(dir $@)) THORN=$(THORN) -f $(MAKE_DIR)/make.subdir
+
+cctk_Bindings/make.checked: FORCE
+ cd cctk_Bindings; $(MAKE) TARGET=make.checked TOP=$(TOP) CONFIG=$(CONFIG) SRCDIR=$(BINDINGS_DIR)/build/$(THORN) THORN=$(THORN) -f $(MAKE_DIR)/make.subdir
# This one puts a file containing identity info into the build subdirectory
-$(addsuffix /make.identity, $(SUBDIRS)):
+$(addsuffix /make.identity, $(SUBDIRS) $(THORNBINDINGS)):
if [ ! -d $(dir $@) ] ; then $(MKDIR) $(MKDIRFLAGS) $(dir $@) ; fi
echo CCTK_THIS_SUBDIR := $(dir $@) > $@
-# Dependency stuff
-ifneq ($(strip $(LOCAL_SRCS)),)
--include $(LOCAL_SRCS:%=%.d)
-endif
+# Catch people who have not done a -rebuild. Remove in beta 12
+$(BINDINGS_DIR)/build/$(THORN)/make.code.defn:
+ @echo $(DIVIDER)
+ @echo "************************************************************************"
+ @echo " Major changes to CST and bindings system."
+ @echo " Please $(MAKE) $(notdir $(TOP))-rebuild "
+ @echo "************************************************************************"
+ @echo $(DIVIDER)
+ @exit 1 \ No newline at end of file