Created
March 11, 2011 15:58
-
-
Save leandrosilva/866072 to your computer and use it in GitHub Desktop.
Makefile to compile, run, and test Erlang applications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP_NAME := my_awesome_app | |
all: compile | |
compile: clear | |
@cp src/$(APP_NAME).app ebin/ | |
@erlc -pa ebin/ -o ebin/ src/*.erl | |
compile_test: compile | |
@erlc -pa ebin/ -o ebin/ test/*.erl | |
run: | |
@erl -pa ebin/ deps/**/ebin/ -sname $(APP_NAME) -s $(APP_NAME) \ | |
-config priv/config/production | |
run_dev: | |
@erl -pa ebin/ deps/**/ebin/ -sname $(APP_NAME) \ | |
-boot start_sasl -s $(APP_NAME) \ | |
-config priv/config/development | |
run_test: compile_test | |
@erl -noshell -pa ebin/ deps/**/ebin/ -s $(APP_NAME) \ | |
-run $(MODULE) test -run init stop \ | |
-config priv/config/test | |
run_all_tests: compile_test | |
@for fullfilename in `find ./test -name "*_test.erl"`; do \ | |
filename=$$(basename $$fullfilename); \ | |
module=$${filename%%.*}; \ | |
echo ; \ | |
echo running: $$module; \ | |
erl -noshell -pa ebin/ deps/**/ebin/ -s $(APP_NAME) \ | |
-run $$module test -run init stop \ | |
-config priv/config/test; \ | |
done | |
clear: | |
@rm -f ebin/*.beam | |
@rm -f erl_crash.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment