# Armadillo File Manager # Copyright (c) 2012, Robert Sesek # # 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. VERSION_MAJOR=0 VERSION_MINOR=8 VERSION_NAMESPACE=armadillo.Version VERSION_FILE=frontend/version.js.proto2 VERSION_SOURCE=$(basename $(VERSION_FILE)) FRONTEND_SOURCES=frontend/jquery-1.7.1.js \ frontend/utils.js \ $(VERSION_SOURCE) \ frontend/tv_renamer.js \ frontend/path_control.js \ frontend/actor.js \ frontend/file.js \ frontend/main.js FRONTEND_BIN=frontend/armadillo.js all: backend dev backend: go build -v . frontend: $(FRONTEND_BIN) $(FRONTEND_BIN): $(FRONTEND_SOURCES) echo $(foreach f,$^,"document.write('');\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('$(VERSION_NAMESPACE)');" >> $(VERSION_FILE) @echo >> $(VERSION_FILE) echo "$(VERSION_NAMESPACE).MAJOR = $(VERSION_MAJOR);" >> $(VERSION_FILE) echo "$(VERSION_NAMESPACE).MINOR = $(VERSION_MINOR);" >> $(VERSION_FILE) echo "$(VERSION_NAMESPACE).BUILD = $(BUILD);" >> $(VERSION_FILE) echo "$(VERSION_NAMESPACE).STAMP = $(STAMP);" >> $(VERSION_FILE) stamp_version: stamp version cp $(VERSION_FILE) $(VERSION_SOURCE) git commit $(VERSION_SOURCE) \ --author='Armadillo Build Script ' \ -m 'Stamp version.js @ $(shell gitcrement current)'