Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactoring Makefile to use rebar

  • Loading branch information...
commit bbd37618fa7929ffc37d063e8e2b0094efdd5243 1 parent 30a1334
@dizzyd dizzyd authored
Showing with 8 additions and 78 deletions.
  1. +8 −78 Makefile
View
86 Makefile
@@ -14,86 +14,16 @@
## limitations under the License.
##==============================================================================
-APPLICATION := triq
-APP_FILE := ebin/$(APPLICATION).app
-SOURCES := $(wildcard src/*.erl)
-HEADERS := $(wildcard src/*.hrl) $(wildcard include/*.hrl)
-MODULES := $(patsubst src/%.erl,%,$(SOURCES))
-BEAMS := ebin/triq_autoexport.beam $(patsubst %,ebin/%.beam,$(MODULES))
+.PHONY: doc
-comma := ,
-e :=
-space := $(e) $(e)
-MODULELIST := $(subst $(space),$(comma),$(MODULES))
+all:
+ ./rebar compile eunit
-TEST_SOURCES := $(wildcard test/*.erl)
-TEST_BEAMS := $(patsubst %.erl,%.beam, $(TEST_SOURCES))
-
-include vsn.mk
-
-.PHONY: all clean dialyzer
-
-all: $(APPLICATION) doc
-
-$(APPLICATION): $(BEAMS) $(APP_FILE)
-
-test: $(APPLICATION) $(TEST_BEAMS) util/run_test.beam
- @echo Running tests
- @erl -pa util/ -pa ebin/ -pa test/ -noinput -s run_test run
-
-test_shell: $(APPLICATION) $(TEST_BEAMS)
- @echo Starting a shell with test paths included
- @erl -pa ebin/ -pa test/
-
-test/%.beam: test/%.erl
- @echo Compiling $<
- @erlc +debug_info -o test/ $<
-
-$(APP_FILE): src/$(APPLICATION).app.src vsn.mk
- @echo Generating $@
- @sed -e 's/@MODULES@/$(MODULELIST)/' -e 's/@VSN@/$(VSN)/' $< > $@
-
-ebin/%.beam: src/%.erl $(HEADERS) $(filter-out $(wildcard ebin), ebin)
- @echo Compiling $<
- @erlc +debug_info -o ebin/ -pz ebin/ -I include/ $<
-
-ebin:
- @echo Creating ebin/
- @mkdir ebin/
-
-doc: doc/edoc-info
-
-dialyzer:
- @echo Running dialyzer on sources
- @dialyzer -pa ebin/ --src -r src/
-
-doc/edoc-info: doc/overview.edoc $(SOURCES)
- @erlc -o util/ util/make_doc.erl
- @echo Generating documentation from edoc
- @erl -pa util/ -noinput -s make_doc edoc
-
-util/%.beam: util/%.erl
- @erlc -o util/ util/run_test.erl
+doc:
+ ./rebar doc
clean:
- @echo Cleaning
- @rm -f ebin/*.beam \
- ebin/*.app \
- test/*.beam \
- test/*.log \
- doc/*.html \
- doc/*.css \
- doc/*.png \
- doc/edoc-info \
- util/*.beam \
- erl_crash.dump
- @rm -rf cover_report \
- .eunit
+ ./rebar clean
-release: clean all test dialyzer
- @util/releaser $(APPLICATION) $(VSN)
-
-tar: clean all
- tar cvzf $(APPLICATION)-$(VSN).tgz \
- -s '#^#$(APPLICATION)-$(VSN)/~#' \
- $(SOURCES) $(HEADERS) $(APP_FILE) $(BEAMS) doc/*
+dialyzer:
+ ./rebar analyze
Please sign in to comment.
Something went wrong with that request. Please try again.