forked from josephwecker/epgsql_pool
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·45 lines (30 loc) · 1014 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
NAME := epgsql_pool
VERSION := 0.1
ERL := erl
ERLC := erlc
EPGSQL_EBIN := ~/src/epgsql/ebin
# ------------------------------------------------------------------------
ERLC_FLAGS := -Wall
SRC := $(wildcard src/*.erl)
TESTS := $(wildcard test_src/*.erl)
RELEASE := $(NAME)-$(VERSION).tar.gz
APPDIR := $(NAME)-$(VERSION)
BEAMS := $(SRC:src/%.erl=ebin/%.beam)
compile: $(BEAMS)
app: compile
@mkdir -p $(APPDIR)/ebin
@cp -r ebin/* $(APPDIR)/ebin/
release: app
@tar czvf $(RELEASE) $(APPDIR)
clean:
@rm -f ebin/*.beam
@rm -rf $(NAME)-$(VERSION) $(NAME)-*.tar.gz
test: $(TESTS:test_src/%.erl=test_ebin/%.beam) $(BEAMS)
$(ERL) -pa $(EPGSQL_EBIN) -pa ebin/ -pa test_ebin/ -noshell -s pgsql_pool_tests test -s init stop
# ------------------------------------------------------------------------
.SUFFIXES: .erl .beam
.PHONY: app compile clean test
ebin/%.beam : src/%.erl
$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
test_ebin/%.beam : test_src/%.erl
$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<