Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 61 lines (43 sloc) 1.769 kB
7ae577b @manopapad adding files
authored
1 MODULES=proper proper_types proper_gen proper_shrink proper_arith proper_tests proper_extra
2 HEADERS=proper proper_internal
3
4 SRC_DIR=src
5 HDR_DIR=include
6 BIN_DIR=ebin
7 DOC_DIR=doc
8 TMP_PATTERN=*~ \\\#*\\\# *.dump core
9
10 SRC_FILES=$(addprefix $(SRC_DIR)/, $(addsuffix .erl, $(MODULES)))
11 HDR_FILES=$(addprefix $(HDR_DIR)/, $(addsuffix .hrl, $(HEADERS)))
12 BIN_FILES=$(addprefix $(BIN_DIR)/, $(addsuffix .beam, $(MODULES)))
13 DOC_FILES=$(DOC_DIR)/*
14 TXT_FILES=COPYING Makefile README
15 RELEASE_FILE=proper.tar.gz
16 TMP_FILES=$(TMP_PATTERN) $(addprefix $(SRC_DIR)/, $(TMP_PATTERN)) $(addprefix $(HDR_DIR)/, $(TMP_PATTERN))
17
18 ERL=erl -noinput -eval
19 ERLC=erlc
20 ERLC_FLAGS=-W2 -Ddebug -DTEST +debug_info +warn_missing_spec +warn_untyped_record
21 EDOC_OPTIONS=[{overview, "$(SRC_DIR)/overview.edoc"}, {dialyzer_specs, all}, {report_missing_type, true}, {report_type_mismatch, true}, {pretty_print,erl_pp}, {preprocess, true}]
22 DIALYZER_OPTIONS=-Wunmatched_returns
23 RM=rm -f
24 TAR=tar -czf
25
26
27 # TODO: separate debug and optimization options
28 # TODO: rules for help/text files
29 # TODO: extra targets: test, tags, commit/update
30
31 .PHONY: default all compile doc check clean distclean rebuild release
32
33 default: compile
34
35 all: compile doc
36
37 compile: $(BIN_FILES)
38
39 # TODO: this should be more fine-grained
40 $(BIN_FILES): $(HDR_FILES)
41
42 $(BIN_DIR)/%.beam: $(SRC_DIR)/%.erl
43 $(ERLC) $(ERLC_FLAGS) -I $(HDR_DIR) -o $(BIN_DIR) $<
44
45 doc: $(SRC_FILES) $(HDR_FILES)
46 $(ERL) 'edoc:application(proper, ".", $(EDOC_OPTIONS)), halt().'
47
48 check: compile
49 dialyzer $(DIALYZER_OPTIONS) $(BIN_DIR)
50
51 clean:
52 $(RM) $(TMP_FILES)
53
54 distclean: clean
55 $(RM) $(BIN_FILES) $(DOC_FILES) $(RELEASE_FILE)
56
57 rebuild: distclean compile
58
59 release: all clean
60 $(TAR) $(RELEASE_FILE) $(SRC_FILES) $(HDR_FILES) $(BIN_FILES) $(DOC_FILES) $(TXT_FILES)
Something went wrong with that request. Please try again.