PageRenderTime 3ms CodeModel.GetById 0ms RepoModel.GetById 1ms 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
Possible License(s): MIT
  1. ## -*- makefile -*-
  2. ######################################################################
  3. ## Erlang
  4. ERL := erl
  5. ERLC := $(ERL)c
  6. INCLUDE_DIRS := ../include $(wildcard ../deps/*/include)
  7. EBIN_DIRS := $(wildcard ../deps/*/ebin)
  8. ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%) $(EBIN_DIRS:%=-pa %)
  9. ifndef no_debug_info
  10. ERLC_FLAGS += +debug_info
  11. endif
  12. ifdef debug
  13. ERLC_FLAGS += -Ddebug
  14. endif
  15. EBIN_DIR := ../ebin
  16. TEST_DIR := ../_test
  17. EMULATOR := beam
  18. ERL_SOURCES := $(wildcard *.erl)
  19. ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
  20. ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
  21. ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
  22. APP_FILES := $(wildcard *.app)
  23. EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
  24. #EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
  25. MODULES = $(ERL_SOURCES:%.erl=%)
  26. ../ebin/%.app: %.app
  27. cp $< $@
  28. $(EBIN_DIR)/%.$(EMULATOR): %.erl
  29. $(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
  30. ./%.$(EMULATOR): %.erl
  31. $(ERLC) $(ERLC_FLAGS) -o . $<