Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better Makefile

  • Loading branch information...
commit 62979746182615c9c8533df527f75c5c58556bcd 1 parent 9ad6cd8
@trung authored
Showing with 11 additions and 6 deletions.
  1. +7 −2 src/Makefile
  2. +2 −0  src/record_helper.erl
  3. +2 −4 support/include.mk
View
9 src/Makefile
@@ -1,11 +1,16 @@
include ../support/include.mk
+ERL_GENERATED_SOURCES := ../include/messages.hrl ../include/types.hrl
+
all: $(EBIN_FILES_NO_DOCS)
-generate: $(EBIN_GENERATE)
- erl -noshell -pa ../ebin -s record_helper make ../include/messages.hrl ../include/types.hrl -s init stop
+generate: record_utils.erl
+
debug:
$(MAKE) DEBUG=-DDEBUG
clean:
rm -rf $(EBIN_FILES_NO_DOCS)
+
+record_utils.erl: $(EBIN_DIR)/record_helper.$(EMULATOR) $(ERL_GENERATED_SOURCES)
+ $(ERL) -noshell -pa $(EBIN_DIR) -s record_helper make $(ERL_GENERATED_SOURCES) -s init stop
View
2  src/record_helper.erl
@@ -1,4 +1,6 @@
%% For each header file, it scans thru all records and create helper functions
+%% Helper functions are:
+%% setters, getters, fields, fields_atom, type
-module(record_helper).
-author("trung@mdkt.org").
View
6 support/include.mk
@@ -22,16 +22,14 @@ EBIN_DIR := ../ebin
DOC_DIR := ../doc
EMULATOR := beam
-ERL_HELPERS := $(wildcard *_helper.erl)
ERL_SOURCES := $(wildcard *.erl)
ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
ERL_DOCUMENTS := $(ERL_SOURCES:%.erl=$(DOC_DIR)/%.html)
ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
APP_FILES := $(wildcard *.app)
-EBIN_FILES = $(ERL_OBJECTS) $(ERL_DOCUMENTS) $(APP_FILES:%.app=../ebin/%.app)
-EBIN_FILES_NO_DOCS = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
-EBIN_GENERATE = $(ERL_HELPERS:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
+EBIN_FILES = $(ERL_OBJECTS) $(ERL_DOCUMENTS) $(APP_FILES:%.app=../ebin/%.app) $(ERL_HEADERS)
+EBIN_FILES_NO_DOCS = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app) $(ERL_HEADERS)
MODULES = $(ERL_SOURCES:%.erl=%)
../ebin/%.app: %.app
Please sign in to comment.
Something went wrong with that request. Please try again.