Permalink
Browse files

leaner build system

  • Loading branch information...
1 parent d416e51 commit d600883c172613272dfee598de33079fca166d41 @thejohnfreeman committed Mar 29, 2012
Showing with 64 additions and 105 deletions.
  1. +19 −14 Makefile
  2. +2 −8 make/Makefile.js
  3. +6 −18 make/Makefile.js.base
  4. +1 −10 make/Makefile.js.tmpl
  5. +36 −46 make/Makefile.lib
  6. +0 −9 make/Makefile.test
View
@@ -1,30 +1,33 @@
# Umbrella Makefile.
MAKEDIR := make
-export MAKEDIR
include $(MAKEDIR)/Makefile.common
-MODULE := lib
+PRIMARY := lib
+BUILDDIR := build
+
+##################################################
+# self configuration (do not touch)
+
+export MAKEDIR
+export BUILDDIR
##################################################
# targets
-.PHONY : all debug release syntax doc test
+.PHONY : all debug release doc test
all :
- @$(call defer,$(MAKEDIR)/Makefile.$(MODULE))
+ @$(call defer,$(MAKEDIR)/Makefile.$(PRIMARY))
debug :
- @$(call defer,$(MAKEDIR)/Makefile.$(MODULE))
+ @$(call defer,$(MAKEDIR)/Makefile.$(PRIMARY))
release :
- @$(call defer,$(MAKEDIR)/Makefile.$(MODULE))
-
-syntax :
- @$(call defer,$(MAKEDIR)/Makefile.$(MODULE))
+ @$(call defer,$(MAKEDIR)/Makefile.$(PRIMARY))
doc :
- @$(call defer,$(MAKEDIR)/Makefile.$(MODULE))
+ @$(call defer,$(MAKEDIR)/Makefile.$(PRIMARY))
test :
@$(MAKE) -f $(MAKEDIR)/Makefile.test
@@ -34,16 +37,18 @@ test :
.PHONY : clean clean-obj clean-exe clean-doc clean-test
-clean : clean-obj clean-exe clean-test
+clean : clean-exe
+ @$(MAKE) -f $(MAKEDIR)/Makefile.test clean-exe
+ -rm -rf $(BUILDDIR)
clean-obj :
- @$(call defer,$(MAKEDIR)/Makefile.$(MODULE))
+ @$(call defer,$(MAKEDIR)/Makefile.$(PRIMARY))
clean-exe :
- @$(call defer,$(MAKEDIR)/Makefile.$(MODULE))
+ @$(call defer,$(MAKEDIR)/Makefile.$(PRIMARY))
clean-doc :
- @$(call defer,$(MAKEDIR)/Makefile.$(MODULE))
+ @$(call defer,$(MAKEDIR)/Makefile.$(PRIMARY))
clean-test :
@$(MAKE) -f $(MAKEDIR)/Makefile.test clean
View
@@ -10,14 +10,10 @@
##################################################
# automatic configuration
-export MAIN
-export MAINPLUS
+export TITLE
export SRCDIR
-export HEADERS
export SOURCES
-export THIRD_PARTY_SOURCES
-export OBJDIR
-export DOCDIR
+export HEADERS
##################################################
# targets
@@ -26,8 +22,6 @@ DEFERRED_TARGETS := \
all \
debug \
release \
- plus \
- syntax \
doc \
clean \
clean-obj \
View
@@ -21,17 +21,15 @@ GZIP := gzip
##################################################
# self configuration (do not touch)
-$(SOURCES) :
- @echo $@
+MAIN := $(TITLE).js
+
+DOCDIR := $(BUILDDIR)/doc-$(TITLE)
+OBJDIR := $(BUILDDIR)/objects-$(TITLE)
# Headers hold m4 macros, so they are dependencies for all objects
OBJECTS := $(addprefix $(OBJDIR)/,$(SOURCES))
SOURCES := $(addprefix $(SRCDIR)/,$(SOURCES))
-#get_obj_path = $(shell echo "$(1)" | sed -e 's|[^/]*.js||')
-get_obj_path = $(1)
-my_dir = "blah"
-
# To comply with POSIX, apparently, GNU make expands function calls when the
# rule is read, not when it is matched, so this had to be moved to secondary
# expansion.
@@ -43,7 +41,7 @@ $(sort $(dir $(OBJECTS))) :
##################################################
# targets
-.PHONY : all debug release plus syntax doc
+.PHONY : all debug release doc
all : debug
# @$(call watch,SOURCES)
@@ -67,18 +65,8 @@ $(MAIN).gz : clean-obj $(OBJECTS)
$(GZIP) -c /tmp/$@.yuic > $@
-rm -rf $(OBJDIR)
-plus : $(MAINPLUS)
-
-$(MAINPLUS) : $(MAIN)
- cat $(THIRD_PARTY_SOURCES) $^ > /tmp/$@
- $(COMPILER) /tmp/$@ | $(COMPRESSOR) > $@
-
-syntax : $(OBJECTS)
- cat $^ > /tmp/$@
- $(YUIC) /tmp/$@ > /dev/null
-
doc : clean-doc
- nodejsdoc -d=$(DOCDIR) $(SOURCES)
+ jfdoc -d=$(DOCDIR) $(SOURCES)
##################################################
# cleaning
View
@@ -6,22 +6,13 @@ include $(MAKEDIR)/Makefile.js
##################################################
# mandatory configuration
-TITLE := hotdrink
+TITLE := library
##################################################
# optional configuration
-MAIN := $(TITLE).js
-MAINPLUS := $(TITLE)-plus.js
-
SRCDIR := lib
SOURCES := \
HEADERS := \
-OBJDIR := build
-
-THIRD_PARTY_SOURCES := \
-
-DOCDIR := doc
-
View
@@ -1,4 +1,4 @@
-# Makefile for the main HotDrink library.
+# Makefile for the HotDrink library.
include $(MAKEDIR)/Makefile.common
include $(MAKEDIR)/Makefile.js
@@ -11,60 +11,50 @@ TITLE := hotdrink
##################################################
# optional configuration
-MAIN := $(TITLE).js
-MAINPLUS := $(TITLE)-plus.js
-
SRCDIR := lib
SOURCES := \
- utility/debug.js \
- utility/stdlib.js \
- utility/namespace.js \
- utility/publisher.js \
- concept/model/behavior.js \
- concept/model/value.js \
- concept/bindings/ast.js \
- concept/bindings/behavior.js \
- concept/bindings/builder.js \
- concept/bindings/controller.js \
- model/model.js \
- model/solver/solver.js \
- model/solver/helpers.js \
- model/solver/model.js \
- model/solver/quickplan.js \
- model/runtime/evaluator.js \
- model/runtime/runtime.js \
+ utility/debug.js \
+ utility/stdlib.js \
+ utility/namespace.js \
+ utility/publisher.js \
+ concept/model/behavior.js \
+ concept/model/value.js \
+ concept/bindings/ast.js \
+ concept/bindings/behavior.js \
+ concept/bindings/builder.js \
+ concept/bindings/controller.js \
+ model/model.js \
+ model/solver/solver.js \
+ model/solver/helpers.js \
+ model/solver/model.js \
+ model/solver/quickplan.js \
+ model/runtime/evaluator.js \
+ model/runtime/runtime.js \
model/factory/solver.js \
model/factory/factory.js \
model/factory/internal.js \
model/factory/variable.js \
model/factory/constraint.js \
model/factory/model.js \
- model/behavior/precondition.js \
- model/behavior/enablement.js \
- bindings/common.js \
- bindings/behavior/value.js \
- bindings/behavior/enablement.js \
- bindings/html/common.js \
- bindings/html/checkbox.js \
- bindings/html/checkboxGroup.js \
- bindings/html/radioGroup.js \
- bindings/html/selectOne.js \
- bindings/html/selectMany.js \
- bindings/html/text.js \
- bindings/html/number.js \
- bindings/html/command.js \
- bindings/html/attr.js \
- bindings/html/html.js \
- bindings/controller.js \
- driver.js
+ model/behavior/precondition.js \
+ model/behavior/enablement.js \
+ bindings/common.js \
+ bindings/behavior/value.js \
+ bindings/behavior/enablement.js \
+ bindings/html/common.js \
+ bindings/html/checkbox.js \
+ bindings/html/checkboxGroup.js \
+ bindings/html/radioGroup.js \
+ bindings/html/selectOne.js \
+ bindings/html/selectMany.js \
+ bindings/html/text.js \
+ bindings/html/number.js \
+ bindings/html/command.js \
+ bindings/html/attr.js \
+ bindings/html/html.js \
+ bindings/controller.js \
+ driver.js
HEADERS := \
lib/utility/debug.m4.js
-OBJDIR := build
-
-THIRD_PARTY_SOURCES := \
- test/prototype.js
-
-DOCDIR := doc
-
View
@@ -11,9 +11,6 @@ TITLE := hotdrink-test
##################################################
# optional configuration
-MAIN := $(TITLE).js
-MAINPLUS := $(TITLE)-plus.js
-
SRCDIR := test/qunit
SOURCES := \
common/hello_world.js \
@@ -28,9 +25,3 @@ SOURCES := \
HEADERS := \
-OBJDIR := build
-
-THIRD_PARTY_SOURCES := \
-
-DOCDIR := doc
-

0 comments on commit d600883

Please sign in to comment.