Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 50 lines (34 sloc) 1.16 KB
NAME := epgsql
VERSION := $(shell git describe --always --tags)
ERL := erl
ERLC := erlc
# ------------------------------------------------------------------------
ERLC_FLAGS := -Wall -I include +debug_info
SRC := $(wildcard src/*.erl)
TESTS := $(wildcard test_src/*.erl)
RELEASE := $(NAME)-$(VERSION).tar.gz
BEAMS := $(SRC:src/%.erl=ebin/%.beam)
compile: $(BEAMS) ebin/$(NAME).app
app: compile
@mkdir -p $(APPDIR)/ebin
@cp -r ebin/* $(APPDIR)/ebin/
@cp -r include $(APPDIR)
release: app
@tar czvf $(RELEASE) $(APPDIR)
@rm -f ebin/*.beam
@rm -f ebin/$(NAME).app
@rm -rf $(NAME)-$(VERSION) $(NAME)-*.tar.gz
test: $(TESTS:test_src/%.erl=test_ebin/%.beam) compile
@dialyzer -n --src -c src
$(ERL) -pa ebin/ -pa test_ebin/ -noshell -s pgsql_tests run_tests -s init stop
# ------------------------------------------------------------------------
.SUFFIXES: .erl .beam
.PHONY: app compile clean test
ebin/%.beam : src/%.erl
$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
ebin/ : src/ Makefile
sed -e 's|git|\"$(VERSION)\"|g' $< > $@
test_ebin/%.beam : test_src/%.erl
$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
Jump to Line
Something went wrong with that request. Please try again.