-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
42 lines (31 loc) · 921 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
ifeq ($(DEBUG),true)
DEBUG_FLAGS = -DDEBUG
else
DEBUG_FLAGS =
endif
XMLRPC_SOURCE_ROOT=.
XMLRPC_INCLUDE_DIR=$(XMLRPC_SOURCE_ROOT)/include
SOURCE_DIR=src
EBIN_DIR=ebin
INCLUDE_DIR=include
INCLUDES=$(wildcard $(INCLUDE_DIR)/*.hrl)
SOURCES=$(wildcard $(SOURCE_DIR)/*.erl)
TARGETS=$(patsubst $(SOURCE_DIR)/%.erl, $(EBIN_DIR)/%.beam,$(SOURCES))
#other args: +native +"{hipe,[o3,verbose]}" -Ddebug=true +debug_info +no_strict_record_tests
ERLC_OPTS=-I $(XMLRPC_INCLUDE_DIR) -I $(INCLUDE_DIR) -o $(EBIN_DIR) $(DEBUG_FLAGS) -DTEST -Wall +debug_info
ERL_CALL=erl -pa $(EBIN_DIR)
all: $(EBIN_DIR) $(TARGETS)
$(EBIN_DIR):
mkdir -p $@
$(EBIN_DIR)/%.beam: $(SOURCE_DIR)/%.erl $(INCLUDES)
erlc $(ERLC_OPTS) $<
run-tests: all
$(ERL_CALL) \
-eval 'eunit:test("ebin", [verbose])' \
-s init stop
dialyze: $(TARGETS)
dialyzer -c $?
clean:
rm -f ebin/*.beam $(TARGETS)
rm -f build-stamp install-stamp
distclean: clean