1 # Armadillo File Manager
2 # Copyright (c) 2012, Robert Sesek <http://www.bluestatic.org>
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.
10 VERSION_NAMESPACE
=armadillo.Version
11 VERSION_FILE
=frontend
/version.js.proto
12 VERSION_SOURCE
=$(basename $(VERSION_FILE
))
14 FRONTEND_SOURCES
=frontend
/jquery-1.7
.1.js \
17 frontend
/tv_renamer.js \
18 frontend
/path_control.js \
22 FRONTEND_BIN
=frontend
/armadillo.js
24 # Default target, used to produce the backend and uncompiled frontend.
27 # Creates the compiled frontend code and stamps the version information into
29 release
: backend stamp_version compiled
31 # Compiles the backend server.
35 # Compiles the frontend code for development.
36 frontend
: stamp
$(FRONTEND_BIN
)
38 $(FRONTEND_BIN
): $(FRONTEND_SOURCES
)
39 echo
$(foreach f
,$^
,"document.write('<script src="fe
/$(notdir $f)"></script>');\n") > $(FRONTEND_BIN
)
41 # Compiles the frontend code for release.
42 compiled
: SOURCES_FLAGS
=$(foreach f
,$(FRONTEND_SOURCES
),--js
=$f)
44 java
-jar closure-compiler.jar \
46 --js_output_file
=$(FRONTEND_BIN
) \
47 --compilation_level
=SIMPLE_OPTIMIZATIONS
49 # Advances the frontend version.
51 if
[[ -f
$(VERSION_FILE
) ]]; then gitcrement next
; fi
;
53 # Builds the version file template.
54 version
: STAMP
=$(shell date
+%s
)
55 version
: BUILD
=$(shell gitcrement current
)
56 version
: stamp
$(VERSION_FILE
)
57 @echo
"// This file is automatically generated." > $(VERSION_FILE
)
58 @echo
>> $(VERSION_FILE
)
59 @echo
"$$.namespace('$(VERSION_NAMESPACE)');" >> $(VERSION_FILE
)
60 @echo
>> $(VERSION_FILE
)
61 echo
"$(VERSION_NAMESPACE).MAJOR = $(VERSION_MAJOR);" >> $(VERSION_FILE
)
62 echo
"$(VERSION_NAMESPACE).MINOR = $(VERSION_MINOR);" >> $(VERSION_FILE
)
63 echo
"$(VERSION_NAMESPACE).BUILD = $(BUILD);" >> $(VERSION_FILE
)
64 echo
"$(VERSION_NAMESPACE).STAMP = $(STAMP);" >> $(VERSION_FILE
)
66 # Copies the version template to the source and commits it.
67 stamp_version
: version
68 cp
$(VERSION_FILE
) $(VERSION_SOURCE
)
69 git commit
$(VERSION_SOURCE
) \
70 --author
='Armadillo Build Script <armadillo@bluestatic.org>' \
71 -m
'Stamp version.js @ $(shell gitcrement current)'