summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-04-07 02:14:56 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-04-07 02:14:56 +0000
commit7d988188aec98cf1a78f7919189280521f871994 (patch)
tree2a2e2c67e90f7f1eab94686db78e4b7b38c1dcc0 /src
parent90b089d7fd6454771b23fdcebb78d3b1a469c3f5 (diff)
downloadlibhubbub-7d988188aec98cf1a78f7919189280521f871994.tar.gz
libhubbub-7d988188aec98cf1a78f7919189280521f871994.tar.bz2
Whoops. Missed the makefile for src/treebuilder
svn path=/trunk/hubbub/; revision=4078
Diffstat (limited to 'src')
-rw-r--r--src/treebuilder/Makefile79
1 files 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))