summaryrefslogtreecommitdiff
path: root/lib/make/make.thornlib
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-05-21 10:38:44 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-05-21 10:38:44 +0000
commit9e9ae09fdf13b595c4053e803e6a396d7f843c95 (patch)
tree1d9bf55cd6d4f4045aecb5087c3ebd7ac96eeb9f /lib/make/make.thornlib
parent9291fe92c464ba411050fa1758937af49906d805 (diff)
Several inter-twined changes: -
Make system now looks in bindings/build/$(THORN)/make.code.defn for additional objects to be built and linked into a library. The CST puts a file cctk_ThornBindings.c into this directory. This should solve the empty library problem - PR 638. The interface to the internal routine CCTKi_RegisterThorn has changed. The new file created by the CST uses the correct new syntax, ands passes information about ancestors and friends into the flesh. Hence the commit of two separate things in one commit, as the both changes require a -rebuild. Please do a make <config>-rebuild or your code will not compile. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2199 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/make.thornlib')
-rw-r--r--lib/make/make.thornlib41
1 files changed, 24 insertions, 17 deletions
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