Create an initial makefile that can assmble the frontend and backend
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 12 Aug 2012 15:23:33 +0000 (11:23 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 12 Aug 2012 15:23:33 +0000 (11:23 -0400)
Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..10bb605
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,52 @@
+# Armadillo File Manager
+# Copyright (c) 2012, Robert Sesek <http://www.bluestatic.org>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or any later version.
+
+FRONTEND_SOURCES=frontend/jquery-1.7.1.js \
+       frontend/utils.js \
+       frontend/version.js \
+       frontend/tv_renamer.js \
+       frontend/path_control.js \
+       frontend/actor.js \
+       frontend/file.js \
+       frontend/main.js
+FRONTEND_BIN=frontend/armadillo.js
+
+VERSION_MAJOR=0
+VERSION_MINOR=8
+VERSION_FILE=frontend/version.js.proto2
+
+backend:
+       go build -v .
+
+frontend: $(FRONTEND_BIN)
+
+$(FRONTEND_BIN): $(FRONTEND_SOURCES)
+       echo $(foreach f,$^,"document.write('<script src="fe/$(notdir $f)"></script>');\n") > $(FRONTEND_BIN)
+
+dev: version frontend
+
+compiled: SOURCES_FLAGS=$(foreach f,$(FRONTEND_SOURCES),--js=$f)
+compiled: version
+       java -jar closure-compiler.jar \
+               $(SOURCES_FLAGS) \
+               --js_output_file=$(FRONTEND_BIN) \
+               --compilation_level=SIMPLE_OPTIMIZATIONS
+
+stamp:
+       gitcrement next
+
+version: STAMP=$(shell date +%s)
+version: BUILD=$(shell gitcrement current)
+version:
+       @echo "// This file is automatically generated." > $(VERSION_FILE)
+       @echo >> $(VERSION_FILE)
+       @echo "$.namespace('armadillo.Version');" >> $(VERSION_FILE)
+       @echo >> $(VERSION_FILE)
+       echo "armadillo.Version.MAJOR = $(VERSION_MAJOR);" >> $(VERSION_FILE)
+       echo "armadillo.Version.MINOR = $(VERSION_MINOR);" >> $(VERSION_FILE)
+       echo "armadillo.Version.BUILD = $(BUILD);" >> $(VERSION_FILE)
+       echo "armadillo.Version.STAMP = $(STAMP);" >> $(VERSION_FILE)