timestamper/Makefile
Jonathan Bernard e8bebb49fb UI and build process tweaks.
* Reworked the buid process to compile SCSS files and move WWW assets
  directories individually.
* Added pulsing animation for the current marker.
* Bugfix for View objects.
2013-10-24 20:42:53 +00:00

69 lines
1.6 KiB
Makefile

MODS = $(wildcard src/*.erl)
BEAMS = $(MODS:src/%.erl=build/ebin/%.beam)
SCSS = $(wildcard www/css/*.scss)
CSS_FILES = $(SCSS:www/css/%.scss=build/www/css/%.css)
TEST_MODS = $(wildcard test/*.erl)
TEST_BEAMS = $(TEST_MODS:test/%.erl=build/test/%.beam)
TS_ROOT=/usr/local/var/yaws/jdb-labs.com/timestamper
CWD = `pwd`
default: build
all : compile test
compile : init $(BEAMS) $(CSS_FILES)
compile-test : init $(TEST_BEAMS)
test : start-test-server run-test stop-test-server
test-shell : compile compile-test config-yaws-dev
@echo Starting an interactive YAWS shell with test paths loaded.
@yaws -i --pa build/ebin --pa build/test --id test_inst
run-test : compile compile-test config-yaws-dev
@erl -pa ./build/ebin -pa ./build/test -run timestamper_api_tests test -run init stop -noshell
start-test-server :
@yaws -D --id test_inst
stop-test-server :
@yaws --stop --id test_inst
clean:
rm -rf build
init:
-mkdir -p build/ebin
-mkdir -p build/www/css
-mkdir -p build/www/js
-mkdir -p build/www/img
build/ebin/%.beam : src/%.erl
erlc -W -o build/ebin $<
build/test/%.beam : test/%.erl
@echo Compiling sources...
erlc -W -o build/test $<
build/www/css/%.css : www/css/%.scss
scss $< $@
build: compile
-mkdir -p build/include
cp -r www/js build/www/
cp -r www/img build/www/
cp -r www/*.* build/www/
cp lib/* build/ebin
cp src/ts_db_records.hrl build/include
cp yaws.prod.conf build/yaws.conf
deploy: build
@service yaws stop
@echo Removing existing artifacts.
- @rm -r $(TS_ROOT)
@echo Copying current artifacts.
@cp -r build $(TS_ROOT)
@service yaws start
@echo Done.