Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

build cleanup

  • Loading branch information...
commit cd5396ecca6303805f46acbf264bc8d25fb5dc06 1 parent f5a4aa9
@japerk japerk authored
View
1  .hgignore
@@ -3,3 +3,4 @@ syntax: glob
*.beam
.plt
.git
+*~
View
30 Makefile
@@ -1,28 +1,26 @@
+ERL=erl
# store output so is only executed once
ERL_LIBS=$(shell erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell)
# get application vsn from app file
VSN=$(shell erl -pa ebin/ -eval 'application:load(erldis), {ok, Vsn} = application:get_key(erldis, vsn), io:format("~s~n", [Vsn])' -s init stop -noshell)
-all:
- @erl -make
+all: src
-clean: clean_tests
- (cd src;$(MAKE) clean)
- rm -rf erl_crash.dump *.beam
+src: FORCE
+ @$(ERL) -make
-clean_tests:
- (cd test;$(MAKE) clean)
- rm -rf erl_crash.dump *.beam
+clean:
+ rm -f erl_crash.dump *.beam */*.beam
-test: FORCE
- mkdir -p ebin/
- (cd src;$(MAKE))
- (cd test;$(MAKE))
- (cd test;$(MAKE) test)
+TEST_SOURCES := $(wildcard test/*.erl)
+TEST_MODULES = $(TEST_SOURCES:test/%.erl=%)
-testrun: all
- mkdir -p ebin/
- (cd test;$(MAKE) test)
+test: src FORCE $(TEST_MODULES)
+
+./$(TEST_MODULES):
+ @echo "Running tests for $@"
+ erlc -pa ebin/ -o ebin/ -I include/ test/$@.erl
+ erl -pa ebin/ -run $@ test -run init stop -noshell
install: all
mkdir -p $(ERL_LIBS)/erldis-$(VSN)/ebin
View
9 src/Makefile
@@ -1,9 +0,0 @@
-include ../support/include.mk
-
-all: $(EBIN_FILES)
-
-debug:
- $(MAKE) DEBUG=-DDEBUG
-
-clean:
- rm -rf $(EBIN_FILES) erl_crash.dump
View
51 support/include.mk
@@ -1,51 +0,0 @@
-## -*- makefile -*-
-
-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
-
-ifdef test
- ERLC_FLAGS += -DTEST
-endif
-
-EBIN_DIR := ../ebin
-DOC_DIR := ../doc
-EMULATOR := beam
-
-ERL_TEMPLATE := $(wildcard *.et)
-ERL_SOURCES := $(wildcard *.erl)
-ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
-ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.beam)
-ERL_TEMPLATES := $(ERL_TEMPLATE:%.et=$(EBIN_DIR)/%.beam)
-ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
-APP_FILES := $(wildcard *.app)
-EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app) $(ERL_TEMPLATES)
-MODULES = $(ERL_SOURCES:%.erl=%)
-
-../ebin/%.app: %.app
- cp $< $@
-
-$(EBIN_DIR)/%.$(EMULATOR): %.erl
- $(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
-
-$(EBIN_DIR)/%.$(EMULATOR): %.et
- $(ERL) -noshell -pa ../../elib/erltl/ebin/ -eval "erltl:compile(atom_to_list('$<'), [{outdir, \"../ebin\"}, report_errors, report_warnings, nowarn_unused_vars])." -s init stop
-
-./%.$(EMULATOR): %.erl
- $(ERLC) $(ERLC_FLAGS) -o . $<
-
-$(DOC_DIR)/%.html: %.erl
- $(ERL) -noshell -run edoc file $< -run init stop
- mv *.html $(DOC_DIR)
-
View
12 test/Makefile
@@ -1,12 +0,0 @@
-include ../support/include.mk
-
-all: $(EBIN_FILES)
-
-clean:
- rm -rf $(EBIN_FILES) erl_crash.dump
-
-test: $(MODULES)
-
-./$(MODULES):
- @echo "Running tests for $@"
- erl -pa ../ebin -run $@ test -run init stop -noshell
Please sign in to comment.
Something went wrong with that request. Please try again.