MODS = $(wildcard src/*.erl) BEAMS = $(MODS:src/%.erl=ebin/%.beam) TEST_MODS = $(wildcard test/*.erl) TEST_BEAMS = $(TEST_MODS:test/%.erl=test/%.beam) YAWS_ROOT=/usr/lib/yaws/timestamper default: compile all : compile test compile : $(BEAMS) compile-test : $(TEST_BEAMS) test : start-test-server run-test stop-test-server test-shell : compile compile-test @echo Starting an interactive YAWS shell with test paths loaded. @yaws -i --pa test --id test_inst run-test : compile compile-test @erl -pa ./ebin -pa ./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 ebin/* erl_crash.dump test/*.beam init: -mkdir ebin ebin/%.beam : src/%.erl erlc -W -o ebin $< test/%.beam : test/%.erl @echo Compiling sources... erlc -W -o test $< deploy: compile @service yaws stop @echo Removing existing artifacts. @rm -r $(YAWS_ROOT)/* @echo Copying current artifacts. @cp -r www $(YAWS_ROOT) @cp -r ebin $(YAWS_ROOT) @mkdir $(YAWS_ROOT)/include @cp -r src/ts_db_records.hrl $(YAWS_ROOT)/include/. @cp yaws.prod.conf $(YAWS_ROOT)/yaws.conf @service yaws start @echo Done.