Permalink
Browse files

make files

  • Loading branch information...
1 parent 8953733 commit 8b392178b07f374c9b110f316c44ceba11932a53 @trung committed Oct 2, 2009
Showing with 66 additions and 1 deletion.
  1. +10 −0 Makefile
  2. +9 −0 src/Makefile
  3. +1 −1 src/amf3.erl
  4. +46 −0 support/include.mk
View
@@ -0,0 +1,10 @@
+all:
+ (cd src;$(MAKE))
+
+docs:
+ erl -pa `pwd`/ebin \
+ -noshell \
+ -run edoc_run application "'BeepBeep'" '"."' '[no_packages]'
+
+clean:
+ (cd src;$(MAKE) clean)
View
@@ -0,0 +1,9 @@
+include ../support/include.mk
+
+all: $(EBIN_FILES_NO_DOCS)
+
+debug:
+ $(MAKE) DEBUG=-DDEBUG
+
+clean:
+ rm -rf $(EBIN_FILES_NO_DOCS)
View
@@ -260,7 +260,7 @@ read_date(Bin) ->
%% TODO use xmerl?
read_xml(Bin) ->
- {bad, "Not yet implemented", ?MODULE, ?LINE}.
+ {bad, "Not yet implemented", ?MODULE, ?LINE, Bin}.
%% Return {ok, value|Value, Rest} or {bad, Reason}
read_object(<<?undefined_marker:8, Rest/binary>>) -> {bad, {"Undefined marker ", Rest}};
View
@@ -0,0 +1,46 @@
+## -*- makefile -*-
+
+######################################################################
+## Erlang
+
+ERL := erl
+ERLC := $(ERL)c
+
+INCLUDE_DIRS := ../include $(wildcard ../deps/*/include)
+EBIN_DIRS := $(wildcard ../deps/*/ebin)
+ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%) $(EBIN_DIRS:%=-pa %)
+
+ifndef no_debug_info
+ ERLC_FLAGS += +debug_info
+endif
+
+ifdef debug
+ ERLC_FLAGS += -Ddebug
+endif
+
+EBIN_DIR := ../ebin
+DOC_DIR := ../doc
+EMULATOR := beam
+
+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)
+MODULES = $(ERL_SOURCES:%.erl=%)
+
+../ebin/%.app: %.app
+ cp $< $@
+
+$(EBIN_DIR)/%.$(EMULATOR): %.erl
+ $(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
+
+./%.$(EMULATOR): %.erl
+ $(ERLC) $(ERLC_FLAGS) -o . $<
+
+$(DOC_DIR)/%.html: %.erl
+ $(ERL) -noshell -run edoc file $< -run init stop
+ mv *.html $(DOC_DIR)

0 comments on commit 8b39217

Please sign in to comment.