-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (19 loc) · 700 Bytes
/
Makefile
File metadata and controls
24 lines (19 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
INCLUDE_DIR=include
SRC_DIR=src
EBIN_DIR=ebin
DOC_DIR=doc
INCLUDES=$(wildcard $(INCLUDE_DIR)/*.hrl)
APPFILE=$(patsubst $(SRC_DIR)/%.app, $(EBIN_DIR)/%.app, $(wildcard $(SRC_DIR)/*.app))
SOURCES=$(wildcard $(SRC_DIR)/*.erl)
TARGETS=$(patsubst $(SRC_DIR)/%.erl, $(EBIN_DIR)/%.beam, $(SOURCES)) $(patsubst $(SRC_DIR)/%.erl, $(DOC_DIR)/%.html, $(SOURCES)) $(APPFILE)
ERLC_OPTS=-W -I $(INCLUDE_DIR) -o $(EBIN_DIR) +debug_info
all: $(TARGETS)
$(EBIN_DIR)/%.app: $(SRC_DIR)/%.app
cp $< $@
$(EBIN_DIR)/%.beam: $(SRC_DIR)/%.erl $(INCLUDES)
erlc $(ERLC_OPTS) $<
$(DOC_DIR)/%.html: $(SRC_DIR)/%.erl
erl -noshell -run edoc file $< -run init stop
mv $(SRC_DIR)/*.html $(DOC_DIR)
clean:
rm -f $(TARGETS)