From 86affbbac11679d6e8c0ae9c82af98d351ec853f Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 5 Sep 2012 00:29:14 -0400 Subject: [PATCH] Makefile: Targets are now more discrete units of work, rather than aggregates. --- Makefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ba1d59f..09aeace 100644 --- a/Makefile +++ b/Makefile @@ -22,20 +22,20 @@ FRONTEND_SOURCES=frontend/jquery-1.7.1.js \ FRONTEND_BIN=frontend/armadillo.js # Default target, used to produce the backend and uncompiled frontend. -all: backend frontend +all: backend version frontend # Creates the compiled frontend code. -release: backend compiled +release: backend version compiled # Performs a release build and stamps the actual version file. -dist: stamp release +dist: backend version $(VERSION_SOURCE) compiled stamp # Compiles the backend server. backend: go build -v . # Compiles the frontend code for development. -frontend: version $(FRONTEND_BIN) +frontend: $(FRONTEND_BIN) $(FRONTEND_BIN): $(FRONTEND_SOURCES) echo $(foreach f,$^,"document.write('');\n") > $(FRONTEND_BIN) @@ -64,9 +64,13 @@ $(VERSION_FILE): echo "$(VERSION_NAMESPACE).BUILD = $(shell gitcrement next);" >> $(VERSION_FILE) echo "$(VERSION_NAMESPACE).STAMP = $(shell date +%s);" >> $(VERSION_FILE) -# Copies the version template to the source and commits it. -stamp: $(VERSION_FILE) - cp $(VERSION_FILE) $(VERSION_SOURCE) +# Copies the version template to the source. +$(VERSION_SOURCE): $(VERSION_FILE) + cp $< $@ + +# Commits the version source and the frontend bin. +stamp: git commit $(VERSION_SOURCE) $(FRONTEND_BIN) \ --author='Armadillo Build Script ' \ -m 'Stamp version.js @ $(shell gitcrement current)' + git update-index --asume-unchanged $(FRONTEND_BIN) -- 2.22.5