diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-18 19:16:13 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-18 19:16:13 +0000 |
commit | 7592a0c969bb0119172e896c3b07c8bfa050903f (patch) | |
tree | 6cb7e16e9a8786cab72c3304e323467515cc1ef6 /lib/make/make.subdir | |
parent | f2e54a409e5ac50f7ff1041773eaf6817fc3cc84 (diff) |
Now make will recurse into subdirectories of a thorn.
In your make.code.defn file put lines
SRCS = <sources in this directory>
SUBDIRS= <all subdirectories - e.g. what find . -type d would give you>
then in each subdirectory put a make.code.defn containing
SRCS = <sources in this directory>
(N.B. you cannot currently put a SUBDIRS line here)
along with make.code.deps files in all the directories.
Make will then go into the relevant subdirectory and make the object files there
before updating the library file.
The first time it does this you will get errors of the form
cannot find <subdir-name>/make.identity
you should ignore these errors, as the make system then creates the files. If I find a way to do this without the errors, I'll be happy 8-) The files are used to keep track of the subdirectory filenames.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@66 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/make.subdir')
-rw-r--r-- | lib/make/make.subdir | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/make/make.subdir b/lib/make/make.subdir new file mode 100644 index 00000000..82a72ac7 --- /dev/null +++ b/lib/make/make.subdir @@ -0,0 +1,36 @@ +# /*@@ +# @file make.subdir +# @date Mon Jan 18 19:12:31 1999 +# @author Tom Goodale +# @desc +# Makes the object files in a subdirectory +# @enddesc +# @version $Id$ +# @@*/ + +# Silence all but designated output +.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 + +# Include the subdirectories local include data +include $(SRCDIR)/make.code.defn + +# Turn source file names into object file names +OBJS = $(patsubst %,%.o,$(basename $(SRCS))) + +# Build all the object files +.PHONY:all + +all: $(OBJS) + +# Rules to make the object files +include $(CONFIG)/make.config.rules + +# Extra subdir-specific dependencies +include $(SRCDIR)/make.code.deps + |