2012-09-03 11:33:40 -05:00
|
|
|
# Copyright 2012 Erlware, LLC. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# BSD License see COPYING
|
|
|
|
|
|
|
|
ERL = $(shell which erl)
|
2013-01-24 11:58:04 -08:00
|
|
|
ERL_VER = $(shell erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell)
|
2012-09-03 11:33:40 -05:00
|
|
|
|
|
|
|
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin
|
|
|
|
|
|
|
|
REBAR=$(shell which rebar)
|
|
|
|
|
|
|
|
ifeq ($(REBAR),)
|
|
|
|
$(error "Rebar not available on this system")
|
|
|
|
endif
|
|
|
|
|
|
|
|
ERLWARE_COMMONS_PLT=$(CURDIR)/.erlware_commons_plt
|
|
|
|
|
2013-01-24 11:58:04 -08:00
|
|
|
.PHONY: all compile doc clean test shell distclean pdf get-deps rebuild #dialyzer typer #fail on Travis.
|
2012-09-03 11:33:40 -05:00
|
|
|
|
2013-01-24 11:58:04 -08:00
|
|
|
all: compile doc test #dialyzer #fail on travis
|
2012-09-03 11:33:40 -05:00
|
|
|
|
2013-04-22 14:48:08 -07:00
|
|
|
deps: .DEV_MODE
|
2013-04-22 12:57:09 -07:00
|
|
|
$(REBAR) get-deps compile
|
|
|
|
|
2013-04-22 14:48:08 -07:00
|
|
|
.DEV_MODE:
|
|
|
|
touch $@
|
|
|
|
cp priv/ec_semver_parser.peg src
|
|
|
|
|
2012-09-03 11:33:40 -05:00
|
|
|
get-deps:
|
2013-04-22 12:57:09 -07:00
|
|
|
$(REBAR) get-deps compile
|
2012-09-03 11:33:40 -05:00
|
|
|
|
2013-04-22 12:57:09 -07:00
|
|
|
compile: deps
|
2012-09-03 11:33:40 -05:00
|
|
|
$(REBAR) skip_deps=true compile
|
|
|
|
|
2013-04-22 14:48:08 -07:00
|
|
|
|
2012-09-03 11:33:40 -05:00
|
|
|
doc: compile
|
2013-01-24 11:58:04 -08:00
|
|
|
- $(REBAR) skip_deps=true doc
|
2012-09-03 11:33:40 -05:00
|
|
|
|
2012-09-08 09:02:12 -05:00
|
|
|
test: compile
|
2012-09-03 11:33:40 -05:00
|
|
|
$(REBAR) skip_deps=true eunit
|
|
|
|
|
2013-01-24 11:58:04 -08:00
|
|
|
$(ERLWARE_COMMONS_PLT).$(ERL_VER).erts:
|
|
|
|
@echo Building local plt at $(ERLWARE_COMMONS_PLT).$(ERL_VER).base
|
2012-09-03 11:33:40 -05:00
|
|
|
@echo
|
|
|
|
|
2013-01-24 11:58:04 -08:00
|
|
|
- dialyzer --fullpath --verbose --output_plt $(ERLWARE_COMMONS_PLT).$(ERL_VER).base --build_plt \
|
|
|
|
--apps erts
|
2012-09-03 11:33:40 -05:00
|
|
|
|
2013-01-24 11:58:04 -08:00
|
|
|
$(ERLWARE_COMMONS_PLT).$(ERL_VER).kernel:$(ERLWARE_COMMONS_PLT).$(ERL_VER).erts
|
|
|
|
@echo Building local plt at $(ERLWARE_COMMONS_PLT).$(ERL_VER).base
|
|
|
|
@echo
|
|
|
|
- dialyzer --fullpath --verbose --output_plt $(ERLWARE_COMMONS_PLT).$(ERL_VER).base --build_plt \
|
|
|
|
--apps kernel
|
|
|
|
|
|
|
|
$(ERLWARE_COMMONS_PLT).$(ERL_VER).base:$(ERLWARE_COMMONS_PLT).$(ERL_VER).kernel
|
|
|
|
@echo Building local plt at $(ERLWARE_COMMONS_PLT).$(ERL_VER).base
|
|
|
|
@echo
|
|
|
|
- dialyzer --fullpath --verbose --output_plt $(ERLWARE_COMMONS_PLT).$(ERL_VER).base --build_plt \
|
|
|
|
--apps stdlib
|
|
|
|
|
|
|
|
$(ERLWARE_COMMONS_PLT).$(ERL_VER): $(ERLWARE_COMMONS_PLT).$(ERL_VER).base
|
|
|
|
@echo Building local plt at $(ERLWARE_COMMONS_PLT).$(ERL_VER)
|
|
|
|
@echo
|
|
|
|
- dialyzer --fullpath --verbose --output_plt $(ERLWARE_COMMONS_PLT).$(ERL_VER) --add_to_plt --plt $(ERLWARE_COMMONS_PLT).$(ERL_VER).base \
|
|
|
|
--apps eunit -r deps
|
|
|
|
|
|
|
|
dialyzer: $(ERLWARE_COMMONS_PLT).$(ERL_VER)
|
|
|
|
dialyzer --fullpath --plt $(ERLWARE_COMMONS_PLT).$(ERL_VER) -Wrace_conditions -r ./ebin
|
|
|
|
|
2013-04-22 12:44:59 -07:00
|
|
|
typer: $(ERLWARE_COMMONS_PLT).$(ERL_VER)
|
2013-01-24 11:58:04 -08:00
|
|
|
typer --plt $(ERLWARE_COMMONS_PLT).$(ERL_VER) -r ./src
|
2012-09-03 11:33:40 -05:00
|
|
|
|
|
|
|
shell: compile
|
|
|
|
# You often want *rebuilt* rebar tests to be available to the
|
|
|
|
# shell you have to call eunit (to get the tests
|
|
|
|
# rebuilt). However, eunit runs the tests, which probably
|
|
|
|
# fails (thats probably why You want them in the shell). This
|
|
|
|
# runs eunit but tells make to ignore the result.
|
2012-09-04 20:27:19 -05:00
|
|
|
- @$(REBAR) skip_deps=true eunit
|
2012-09-03 11:33:40 -05:00
|
|
|
@$(ERL) $(ERLFLAGS)
|
|
|
|
|
|
|
|
clean:
|
2012-09-08 09:02:12 -05:00
|
|
|
$(REBAR) skip_deps=true clean
|
|
|
|
- rm $(CURDIR)/doc/*.html
|
|
|
|
- rm $(CURDIR)/doc/*.css
|
|
|
|
- rm $(CURDIR)/doc/*.png
|
|
|
|
- rm $(CURDIR)/doc/edoc-info
|
2012-09-03 11:33:40 -05:00
|
|
|
|
|
|
|
distclean: clean
|
2013-01-24 11:58:04 -08:00
|
|
|
rm -rf $(ERLWARE_COMMONS_PLT).$(ERL_VER)
|
2013-04-22 12:57:09 -07:00
|
|
|
rm -rvf $(CURDIR)/deps
|
2013-04-22 14:48:08 -07:00
|
|
|
rm -rvf .DEV_MODE
|
2012-10-25 08:55:41 -05:00
|
|
|
|
2012-12-03 11:15:52 -05:00
|
|
|
rebuild: distclean get-deps all
|