2011-01-28 06:49:47 -06:00
|
|
|
MODS = $(wildcard src/*.erl)
|
|
|
|
BEAMS = $(MODS:src/%.erl=ebin/%.beam)
|
|
|
|
TEST_MODS = $(wildcard test/*.erl)
|
|
|
|
TEST_BEAMS = $(TEST_MODS:test/%.erl=test/%.beam)
|
2011-03-17 04:17:10 +00:00
|
|
|
TS_ROOT=/usr/lib/yaws/jdb-labs/timestamper
|
2011-01-28 06:49:47 -06:00
|
|
|
|
|
|
|
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 $<
|
2011-03-11 12:32:06 +00:00
|
|
|
|
|
|
|
deploy: compile
|
|
|
|
@service yaws stop
|
|
|
|
@echo Removing existing artifacts.
|
2011-03-17 04:17:10 +00:00
|
|
|
- @rm -r $(TS_ROOT)
|
2011-03-11 12:32:06 +00:00
|
|
|
@echo Copying current artifacts.
|
2011-03-17 04:17:10 +00:00
|
|
|
@mkdir -p $(TS_ROOT)
|
|
|
|
@cp -r www $(TS_ROOT)
|
|
|
|
@cp -r ebin $(TS_ROOT)
|
|
|
|
@mkdir $(TS_ROOT)/include
|
|
|
|
@cp -r src/ts_db_records.hrl $(TS_ROOT)/include/.
|
|
|
|
@cp yaws.prod.conf $(TS_ROOT)/yaws.conf
|
2011-03-11 12:32:06 +00:00
|
|
|
@service yaws start
|
|
|
|
@echo Done.
|