From 7d988188aec98cf1a78f7919189280521f871994 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 7 Apr 2008 02:14:56 +0000 Subject: Whoops. Missed the makefile for src/treebuilder svn path=/trunk/hubbub/; revision=4078 --- src/treebuilder/Makefile | 79 ++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/src/treebuilder/Makefile b/src/treebuilder/Makefile index 3353a26..3c6355c 100644 --- a/src/treebuilder/Makefile +++ b/src/treebuilder/Makefile @@ -1,53 +1,46 @@ -# Makefile for libhubbub +# Child makefile fragment for libhubbub # -# Toolchain is exported by top-level makefile +# Toolchain is provided by top-level makefile # -# Top-level makefile also exports the following variables: +# Variables provided by top-level makefile # -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root +# COMPONENT The name of the component +# EXPORT The location of the export directory +# TOP The location of the source tree root +# RELEASEDIR The place to put release objects +# DEBUGDIR The place to put debug objects # -# The top-level makefile requires the following targets to exist: +# do_include Canned command sequence to include a child makefile # -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases - -# Manipulate include paths -CFLAGS += -I$(CURDIR) - -# Objects -OBJS = in_body treebuilder - -.PHONY: clean debug distclean export release setup test - -# Targets -release: $(addprefix ../Release/, $(addsuffix .o, $(OBJS))) - -debug: $(addprefix ../Debug/, $(addsuffix .o, $(OBJS))) - -clean: - -@${RM} ${RMFLAGS} $(addprefix ../Release/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(addprefix ../Debug/, $(addsuffix .o, ${OBJS})) - -distclean: +# Variables provided by parent makefile: +# +# DIR The name of the directory we're in, relative to $(TOP) +# +# Variables we can manipulate: +# +# ITEMS_CLEAN The list of items to remove for "make clean" +# ITEMS_DISTCLEAN The list of items to remove for "make distclean" +# TARGET_TESTS The list of target names to run for "make test" +# +# SOURCES The list of sources to build for $(COMPONENT) +# +# Plus anything from the toolchain -setup: +# Push parent directory onto the directory stack +sp := $(sp).x +dirstack_$(sp) := $(d) +d := $(DIR) -export: +# Sources +SRCS_$(d) := in_body.c treebuilder.c -test: +# Append to sources for component +SOURCES += $(addprefix $(d), $(SRCS_$(d))) -# Pattern rules -../Release/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $< +# Now include any children we may have +MAKE_INCLUDES := $(wildcard $(d)*/Makefile) +$(eval $(foreach INC, $(MAKE_INCLUDES), $(call do_include,$(INC)))) -../Debug/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@ $< +# Finally, pop off the directory stack +d := $(dirstack_$(sp)) +sp := $(basename $(sp)) -- cgit v1.2.3