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.
25 all: backend version frontend ignore_fe_bin
27 # Creates the compiled frontend code.
28 release
: backend version compiled ignore_fe_bin
30 # Performs a release build and stamps the actual version file.
31 dist: backend version copy_version_src compiled stamp ignore_fe_bin
33 # Compiles the backend server.
37 # Compiles the frontend code for development.
38 frontend
: $(FRONTEND_BIN
)
40 $(FRONTEND_BIN
): $(FRONTEND_SOURCES
)
41 echo
$(foreach f
,$^
,"document.write('<script src="fe
/$(notdir $f)"></script>');\n") > $(FRONTEND_BIN
)
43 # Compiles the frontend code for release.
44 compiled
: SOURCES_FLAGS
=$(foreach f
,$(FRONTEND_SOURCES
),--js
=$f)
46 java
-jar closure-compiler.jar \
48 --js_output_file
=$(FRONTEND_BIN
) \
49 --compilation_level
=SIMPLE_OPTIMIZATIONS
51 .PHONY
: $(VERSION_FILE
)
53 # Builds the version file template.
55 if
[[ -f
$(VERSION_FILE
) ]]; then
$(MAKE
) $(VERSION_FILE
); fi
58 @echo
"// This file is automatically generated." > $(VERSION_FILE
)
59 @echo
>> $(VERSION_FILE
)
60 @echo
"$$.namespace('$(VERSION_NAMESPACE)');" >> $(VERSION_FILE
)
61 @echo
>> $(VERSION_FILE
)
62 echo
"$(VERSION_NAMESPACE).MAJOR = $(VERSION_MAJOR);" >> $(VERSION_FILE
)
63 echo
"$(VERSION_NAMESPACE).MINOR = $(VERSION_MINOR);" >> $(VERSION_FILE
)
64 echo
"$(VERSION_NAMESPACE).BUILD = $(shell gitcrement next);" >> $(VERSION_FILE
)
65 echo
"$(VERSION_NAMESPACE).STAMP = $(shell date +%s);" >> $(VERSION_FILE
)
67 # Copies the version template to the source.
69 cp
$(VERSION_FILE
) $(VERSION_SOURCE
)
71 # Commits the version source and the frontend bin.
73 git commit
$(VERSION_SOURCE
) $(FRONTEND_BIN
) \
74 --author
='Armadillo Build Script <armadillo@bluestatic.org>' \
75 -m
'Stamp version.js @ $(shell gitcrement current)'
77 # Marks the frontend binary as unmodified.
78 ignore_fe_bin
: $(FRONTEND_BIN
)
79 git update-index
--assume-unchanged
$(FRONTEND_BIN
)