]> git.saurik.com Git - redis.git/blame - client-libraries/erlang/support/include.mk
doc update
[redis.git] / client-libraries / erlang / support / include.mk
CommitLineData
ed9b544e 1## -*- makefile -*-
2
3ERL := erl
4ERLC := $(ERL)c
5
6INCLUDE_DIRS := ../include $(wildcard ../deps/*/include)
7EBIN_DIRS := $(wildcard ../deps/*/ebin)
8ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%) $(EBIN_DIRS:%=-pa %)
9
10ifndef no_debug_info
11 ERLC_FLAGS += +debug_info
12endif
13
14ifdef debug
15 ERLC_FLAGS += -Ddebug
16endif
17
18ifdef test
19 ERLC_FLAGS += -DTEST
20endif
21
22EBIN_DIR := ../ebin
23DOC_DIR := ../doc
24EMULATOR := beam
25
26ERL_TEMPLATE := $(wildcard *.et)
27ERL_SOURCES := $(wildcard *.erl)
28ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
29ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.beam)
30ERL_TEMPLATES := $(ERL_TEMPLATE:%.et=$(EBIN_DIR)/%.beam)
31ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
32APP_FILES := $(wildcard *.app)
33EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app) $(ERL_TEMPLATES)
34MODULES = $(ERL_SOURCES:%.erl=%)
35
36../ebin/%.app: %.app
37 cp $< $@
38
39$(EBIN_DIR)/%.$(EMULATOR): %.erl
40 $(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
41
42$(EBIN_DIR)/%.$(EMULATOR): %.et
43 $(ERL) -noshell -pa ../../elib/erltl/ebin/ -eval "erltl:compile(atom_to_list('$<'), [{outdir, \"../ebin\"}, report_errors, report_warnings, nowarn_unused_vars])." -s init stop
44
45./%.$(EMULATOR): %.erl
46 $(ERLC) $(ERLC_FLAGS) -o . $<
47
48$(DOC_DIR)/%.html: %.erl
49 $(ERL) -noshell -run edoc file $< -run init stop
50 mv *.html $(DOC_DIR)
51