Create an initial makefile that can assmble the frontend and backend
[armadillo.git] / Makefile
1 # Armadillo File Manager
2 # Copyright (c) 2012, Robert Sesek <http://www.bluestatic.org>
3 #
4 # This program is free software: you can redistribute it and/or modify it under
5 # the terms of the GNU General Public License as published by the Free Software
6 # Foundation, either version 3 of the License, or any later version.
7
8 FRONTEND_SOURCES=frontend/jquery-1.7.1.js \
9 frontend/utils.js \
10 frontend/version.js \
11 frontend/tv_renamer.js \
12 frontend/path_control.js \
13 frontend/actor.js \
14 frontend/file.js \
15 frontend/main.js
16 FRONTEND_BIN=frontend/armadillo.js
17
18 VERSION_MAJOR=0
19 VERSION_MINOR=8
20 VERSION_FILE=frontend/version.js.proto2
21
22 backend:
23 go build -v .
24
25 frontend: $(FRONTEND_BIN)
26
27 $(FRONTEND_BIN): $(FRONTEND_SOURCES)
28 echo $(foreach f,$^,"document.write('<script src="fe/$(notdir $f)"></script>');\n") > $(FRONTEND_BIN)
29
30 dev: version frontend
31
32 compiled: SOURCES_FLAGS=$(foreach f,$(FRONTEND_SOURCES),--js=$f)
33 compiled: version
34 java -jar closure-compiler.jar \
35 $(SOURCES_FLAGS) \
36 --js_output_file=$(FRONTEND_BIN) \
37 --compilation_level=SIMPLE_OPTIMIZATIONS
38
39 stamp:
40 gitcrement next
41
42 version: STAMP=$(shell date +%s)
43 version: BUILD=$(shell gitcrement current)
44 version:
45 @echo "// This file is automatically generated." > $(VERSION_FILE)
46 @echo >> $(VERSION_FILE)
47 @echo "$.namespace('armadillo.Version');" >> $(VERSION_FILE)
48 @echo >> $(VERSION_FILE)
49 echo "armadillo.Version.MAJOR = $(VERSION_MAJOR);" >> $(VERSION_FILE)
50 echo "armadillo.Version.MINOR = $(VERSION_MINOR);" >> $(VERSION_FILE)
51 echo "armadillo.Version.BUILD = $(BUILD);" >> $(VERSION_FILE)
52 echo "armadillo.Version.STAMP = $(STAMP);" >> $(VERSION_FILE)