* Modified make target `deploy` to require the `build` target first. * When creating a new timestamp entry we no longer refresh the collection from the server. Now we use the `success` callback to set the server-supplied values on the model.
59 lines
1.3 KiB
Makefile
59 lines
1.3 KiB
Makefile
MODS = $(wildcard src/*.erl)
|
|
BEAMS = $(MODS:src/%.erl=build/ebin/%.beam)
|
|
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)
|
|
|
|
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
|
|
|
|
build/ebin/%.beam : src/%.erl
|
|
erlc -W -o build/ebin $<
|
|
|
|
build/test/%.beam : test/%.erl
|
|
@echo Compiling sources...
|
|
erlc -W -o build/test $<
|
|
|
|
build: compile
|
|
-mkdir -p build/include
|
|
cp -r www build
|
|
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.
|