PageRenderTime 102ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 57ms app.codeStats 0ms

/support/include.mk

http://github.com/basho/mochiweb
Makefile | 41 lines | 27 code | 10 blank | 4 comment | 0 complexity | 81e3c930442228baeb55d986ff72b2e7 MD5 | raw file
 1## -*- makefile -*-
 2
 3######################################################################
 4## Erlang
 5
 6ERL := erl
 7ERLC := $(ERL)c
 8
 9INCLUDE_DIRS := ../include $(wildcard ../deps/*/include)
10EBIN_DIRS := $(wildcard ../deps/*/ebin)
11ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%) $(EBIN_DIRS:%=-pa %)
12
13ifndef no_debug_info
14  ERLC_FLAGS += +debug_info
15endif
16
17ifdef debug
18  ERLC_FLAGS += -Ddebug
19endif
20
21EBIN_DIR := ../ebin
22TEST_DIR := ../_test
23EMULATOR := beam
24
25ERL_SOURCES := $(wildcard *.erl)
26ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
27ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
28ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
29APP_FILES := $(wildcard *.app)
30EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
31#EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
32MODULES = $(ERL_SOURCES:%.erl=%)
33
34../ebin/%.app: %.app
35	cp $< $@
36
37$(EBIN_DIR)/%.$(EMULATOR): %.erl
38	$(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
39
40./%.$(EMULATOR): %.erl
41	$(ERLC) $(ERLC_FLAGS) -o . $<