diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-16 17:55:00 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-16 17:55:00 +0000 |
commit | d99e1e6cd7d98f468473e2640999969d190e1122 (patch) | |
tree | b183dfff6a364afac5baf2042f28927a455cedd9 | |
parent | 558a9c363187881d367c90d7d60adaf2db05d60c (diff) |
Start of the new make system.
Rely on a directory structure like
arch/config-stuff
arch/lib
arch/build/<thorn1>
arch/build/<thorn2>
etc
and files called make.config.defn, make.config.deps, make.config.rules in the config-stuff directory.
make.config.defn should contain the normal make variables defining
compilers and compiler flags, etc, plus
TOOLKIT_DIR - the directory containing the toolkit sources
CCTK_LIBDIR - arch/lib in the above example
BUILD_DIR - arch/build in the above example
EXE - the name of the executable
THORNS - the names of the thorns, including toolkits - e.g CCTK/pugh CCTK/io, etc.
(I'll probably move this one out to another file.)
make.config.rules should contain rules to make object files from source files, e.g.
%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c -o $@ $< $(addprefix -I, $(INC_DIRS))
etc.
Then you invoke make.configuration with
make -f make.configuration TOP=<directory containing the build tree - arch> MAKE_DIR=<directory containing make.thornlib>
and the thorns should get built.
Still need to add stuff for building flesh, and to take in flesh include files,
etc.
Need to do autoconf stuff to automagically create make.config.defn.
Need the perl configuration stuff.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@60 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | lib/make/make.configuration | 35 | ||||
-rw-r--r-- | lib/make/make.thornlib | 16 |
2 files changed, 51 insertions, 0 deletions
diff --git a/lib/make/make.configuration b/lib/make/make.configuration new file mode 100644 index 00000000..4203fe75 --- /dev/null +++ b/lib/make/make.configuration @@ -0,0 +1,35 @@ +CONFIG = $(TOP)/config-stuff + +# Include the definitions for this configuration + +include $(CONFIG)/make.config.defn + +# Silence all but designated output +#.SILENT: + +# Build the executable +$(EXE): datestamp.o $(patsubst %,$(CCTK_LIBDIR)/lib%.a,$(notdir $(THORNS))) + echo Creating $(EXE) from $(THORNS) + $(CC) -c datestamp.c + $(CC) -o $@ $(LDFLAGS) datestamp.o $(LIBDIRS:%=-L%) $(LIBS:%=-l%) -L$(CCTK_LIBDIR) $(addprefix -l,$(notdir $(THORNS))) + +# Build a thorn library +# Libraries go into the appropriate library directory +# Each thorn's object files go into $(BUILD_DIR)/<thorn> +$(CCTK_LIBDIR)/lib%.a: update + echo Checking status of $(notdir $@) + cd $(@:$(CCTK_LIBDIR)/lib%.a=$(BUILD_DIR)/%); \ + $(MAKE) TOP=$(TOP) SRCDIR=$(@:$(CCTK_LIBDIR)/lib%.a=$(TOOLKIT_DIR)/$(filter %$(@:$(CCTK_LIBDIR)/lib%.a=%),$(THORNS))) CONFIG=$(CONFIG) -f $(MAKE_DIR)/make.thornlib + +# Include any extra dependencies + +include $(CONFIG)/make.config.deps + + +# Phony targets. + +.PHONY:update clean +update: + +clean: + find $(TOP) -name '*.o' -o -name '*.a' -exec rm {} \; diff --git a/lib/make/make.thornlib b/lib/make/make.thornlib new file mode 100644 index 00000000..998b5de0 --- /dev/null +++ b/lib/make/make.thornlib @@ -0,0 +1,16 @@ +include $(CONFIG)/make.config.defn + +INC_DIRS += $(SRCDIR) $(SRCDIR)/include + +include $(SRCDIR)/make.code.defn + +THORN_SRCS = $(SRCS:%=$(SRCDIR)/%) + +OBJS = $(patsubst $(SRCDIR)/%.c,%.o,$(THORN_SRCS)) + +$(CCTK_LIBDIR)/libtest.a: $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +include $(CONFIG)/make.config.rules + +include $(SRCDIR)/make.code.deps |