Makefile 814 B

12345678910111213141516171819202122232425262728293031323334
  1. NAME := epgsql
  2. VERSION := $(shell git describe --always --tags)
  3. ERL := erl
  4. ERLC := erlc
  5. # ------------------------------------------------------------------------
  6. ERLC_FLAGS := -Wall -I include +debug_info
  7. TESTS := $(wildcard test_src/*.erl)
  8. all: compile ebin/$(NAME).app
  9. compile:
  10. rebar compile
  11. ebin/%.qpp: src/%.app.src
  12. sed -e s/git/\"$(VERSION)\"/g $< > $@
  13. clean:
  14. rebar clean
  15. test: $(TESTS:test_src/%.erl=test_ebin/%.beam) compile
  16. @dialyzer -n --src -c src
  17. $(ERL) -config etc/epgsql_test.config -pa ebin/ -pa test_ebin/ -noshell -s pgsql_tests run_tests -s init stop
  18. # ------------------------------------------------------------------------
  19. .SUFFIXES: .erl .beam
  20. .PHONY: all compile clean test
  21. test_ebin/%.beam : test_src/%.erl
  22. $(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<