Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
373 additions
and
208 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,76 @@ | ||
APP_NAME=wiggle | ||
APP_DIR=apps/$(APP_NAME) | ||
OBJ=$(shell ls $(APP_DIR)/src/*.erl | sed -e 's/\.erl$$/.beam/' | sed -e 's;^$(APP_DIR)/src;$(APP_DIR)/ebin;g') $(shell ls $(APP_DIR)/src/*.app.src | sed -e 's/\.src$$//g' | sed -e 's;^$(APP_DIR)/src;$(APP_DIR)/ebin;g') | ||
DEPS=$(shell cat rebar.config |sed -e 's/%.*//'| sed -e '/{\(\w\+\), [^,]\+, {\w\+, [^,]\+, {[^,]\+, [^}]\+}}},\?/!d' | sed -e 's;{\(\w\+\), [^,]\+, {\w\+, [^,]\+, {[^,]\+, [^}]\+}}},\?;deps/\1/rebar.config;') | ||
ERL=erl | ||
PA=$(shell pwd)/$(APP_DIR)/ebin | ||
ERL_LIBS=`pwd`/deps/ | ||
REBAR=./rebar | ||
REBAR = $(shell pwd)/rebar | ||
|
||
.PHONY: rel clean package deps | ||
.PHONY: deps rel stagedevrel | ||
|
||
all: $(DEPS) $(OBJ) | ||
all: deps compile | ||
|
||
compile: | ||
$(REBAR) compile | ||
|
||
deps: | ||
$(REBAR) get-deps | ||
$(REBAR) update-deps | ||
|
||
rel: all | ||
-rm -r rel/$(APP_NAME) | ||
cd rel; ../rebar generate | ||
echo: | ||
echo $(DEPS) | ||
|
||
tar: rel | ||
cd rel; tar jcvf $(APP_NAME).tar.bz2 $(APP_NAME) | ||
|
||
test: | ||
$(REBAR) skip_deps=true eunit | ||
|
||
clean: | ||
$(REBAR) clean | ||
make -C rel/pkg clean | ||
-rm *.beam erl_crash.dump | ||
-rm -r rel/$(APP_NAME) | ||
-rm rel/$(APP_NAME).tar.bz2 | ||
|
||
$(DEPS): | ||
$(REBAR) get-deps | ||
$(REBAR) compile | ||
distclean: clean devclean relclean | ||
$(REBAR) delete-deps | ||
|
||
$(APP_DIR)/ebin/%.app: $(APP_DIR)/src/%.app.src | ||
$(REBAR) compile | ||
test: all | ||
$(REBAR) skip_deps=true xref | ||
$(REBAR) skip_deps=true eunit | ||
|
||
$(APP_DIR)/ebin/%.beam: $(APP_DIR)/src/%.erl | ||
$(REBAR) compile | ||
rel: all | ||
$(REBAR) generate | ||
|
||
shell: all | ||
ERL_LIBS="$(ERL_LIBS)" $(ERL) -pa $(PA) -config standalone -sname $(APP_NAME) | ||
[ -f *.beam ] && rm *.beam || true | ||
[ -f erl_crash.dump ] && rm erl_crash.dump || true | ||
relclean: | ||
rm -rf rel/wiggle | ||
|
||
package: rel | ||
make -C rel/pkg package | ||
|
||
### | ||
### Docs | ||
### | ||
docs: | ||
$(REBAR) skip_deps=true doc | ||
|
||
## | ||
## Developer targets | ||
## | ||
|
||
stage : rel | ||
$(foreach dep,$(wildcard deps/* wildcard apps/*), rm -rf rel/wiggle/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) rel/wiggle/lib;) | ||
|
||
## | ||
## Dialyzer | ||
## | ||
APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \ | ||
xmerl webtool snmp public_key mnesia eunit syntax_tools compiler | ||
COMBO_PLT = $(HOME)/.wiggle_combo_dialyzer_plt | ||
|
||
check_plt: deps compile | ||
dialyzer --check_plt --plt $(COMBO_PLT) --apps $(APPS) \ | ||
deps/*/ebin apps/*/ebin | ||
|
||
build_plt: deps compile | ||
dialyzer --build_plt --output_plt $(COMBO_PLT) --apps $(APPS) \ | ||
deps/*/ebin apps/*/ebin | ||
|
||
dialyzer: deps compile | ||
@echo | ||
@echo Use "'make check_plt'" to check PLT prior to using this target. | ||
@echo Use "'make build_plt'" to build PLT prior to using this target. | ||
@echo | ||
@sleep 1 | ||
dialyzer -Wno_return --plt $(COMBO_PLT) deps/*/ebin apps/*/ebin | grep -v -f dialyzer.mittigate | ||
|
||
|
||
cleanplt: | ||
@echo | ||
@echo "Are you sure? It takes about 1/2 hour to re-build." | ||
@echo Deleting $(COMBO_PLT) in 5 seconds. | ||
@echo | ||
sleep 5 | ||
rm $(COMBO_PLT) |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.