Separate rebar.config for dialyzer/gdb/valgrind
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
sqlite3.plt
|
sqlite3.plt
|
||||||
.svn
|
.svn
|
||||||
*/.svn
|
*/.svn
|
||||||
@@ -17,3 +16,4 @@ TEST*.xml
|
|||||||
*.obj
|
*.obj
|
||||||
*.dll
|
*.dll
|
||||||
rebar.cross_compile.config
|
rebar.cross_compile.config
|
||||||
|
config.tmp
|
||||||
42
GNUmakefile
42
GNUmakefile
@@ -1,8 +1,10 @@
|
|||||||
REBAR=./rebar
|
REBAR=./rebar
|
||||||
|
REBAR_DEBUG=$(REBAR) -C rebar.debug.config
|
||||||
REBAR_COMPILE=$(REBAR) get-deps compile
|
REBAR_COMPILE=$(REBAR) get-deps compile
|
||||||
|
LAST_CONFIG:=$(shell cat config.tmp)
|
||||||
PLT=dialyzer/sqlite3.plt
|
PLT=dialyzer/sqlite3.plt
|
||||||
|
|
||||||
all: compile
|
all: config_normal compile
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
$(REBAR_COMPILE)
|
$(REBAR_COMPILE)
|
||||||
@@ -11,20 +13,48 @@ test:
|
|||||||
$(REBAR_COMPILE) eunit
|
$(REBAR_COMPILE) eunit
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -rf deps ebin priv doc/* .eunit c_src/*.o
|
-rm -rf deps ebin priv doc/* .eunit c_src/*.o config.tmp
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
$(REBAR_COMPILE) doc
|
$(REBAR_COMPILE) doc
|
||||||
|
|
||||||
static:
|
static: config_debug
|
||||||
$(REBAR_COMPILE)
|
$(REBAR_DEBUG) get-deps compile
|
||||||
ifeq ($(wildcard $(PLT)),)
|
ifeq ($(wildcard $(PLT)),)
|
||||||
dialyzer --build_plt --apps kernel stdlib erts --output_plt $(PLT)
|
dialyzer --build_plt --apps kernel stdlib erts --output_plt $(PLT)
|
||||||
else
|
else
|
||||||
dialyzer --plt $(PLT) -r ebin
|
dialyzer --plt $(PLT) -r ebin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cross_compile: clean
|
cross_compile: config_cross
|
||||||
$(REBAR_COMPILE) -C rebar.cross_compile.config
|
$(REBAR_COMPILE) -C rebar.cross_compile.config
|
||||||
|
|
||||||
.PHONY: all compile test clean docs static
|
valgrind: clean
|
||||||
|
$(REBAR_DEBUG) get-deps compile
|
||||||
|
valgrind --tool=memcheck --leak-check=yes --num-callers=20 ./test.sh
|
||||||
|
|
||||||
|
ifeq ($(LAST_CONFIG),normal)
|
||||||
|
config_normal: ;
|
||||||
|
else
|
||||||
|
config_normal: clean
|
||||||
|
rm -f config.tmp
|
||||||
|
echo "normal" > config.tmp
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(LAST_CONFIG),debug)
|
||||||
|
config_debug: ;
|
||||||
|
else
|
||||||
|
config_debug: clean
|
||||||
|
rm -f config.tmp
|
||||||
|
echo "debug" > config.tmp
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(LAST_CONFIG),cross)
|
||||||
|
config_cross: ;
|
||||||
|
else
|
||||||
|
config_cross: clean
|
||||||
|
rm -f config.tmp
|
||||||
|
echo "cross" > config.tmp
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: all compile test clean docs static valgrind config_normal config_debug config_cross
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
% -*- mode: erlang -*-
|
% -*- mode: erlang -*-
|
||||||
{erl_opts, [debug_info]}. %% required for dialyzer
|
|
||||||
{port_envs, [{"^(?!.*win32)", "DRV_CFLAGS", "$DRV_CFLAGS -Wall -Wextra -Wno-unused-parameter"},
|
{port_envs, [{"^(?!.*win32)", "DRV_CFLAGS", "$DRV_CFLAGS -Wall -Wextra -Wno-unused-parameter"},
|
||||||
{"^(?!.*win32)", "DRV_LDFLAGS", "$DRV_LDFLAGS -lsqlite3"},
|
{"^(?!.*win32)", "DRV_LDFLAGS", "$DRV_LDFLAGS -lsqlite3"},
|
||||||
{"win32", "CFLAGS", "/IF:/MyProgramming/sqlite-amalgamation /Ic_src /W4 /wd4100 /wd4204"},
|
{"win32", "CFLAGS", "/IF:/MyProgramming/sqlite-amalgamation /Ic_src /W4 /wd4100 /wd4204"},
|
||||||
{"win32", "LDFLAGS", "sqlite3.lib"}]}.
|
{"win32", "LDFLAGS", "sqlite3.lib"}]}.
|
||||||
{cover_enabled, true}.
|
{cover_enabled, true}.
|
||||||
{eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}.
|
{eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}.
|
||||||
{dialyzer_opts, [{plt, "dialyzer/sqlite3.plt"}]}.
|
|
||||||
|
|||||||
9
rebar.debug.config
Normal file
9
rebar.debug.config
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
% -*- mode: erlang -*-
|
||||||
|
{erl_opts, [debug_info]}. %% required for dialyzer
|
||||||
|
{port_envs, [{"^(?!.*win32)", "DRV_CFLAGS", "$DRV_CFLAGS -g -Wall -Wextra -Wno-unused-parameter"},
|
||||||
|
{"^(?!.*win32)", "DRV_LDFLAGS", "$DRV_LDFLAGS -lsqlite3"},
|
||||||
|
{"win32", "CFLAGS", "/IF:/MyProgramming/sqlite-amalgamation /Ic_src /W4 /wd4100 /wd4204"},
|
||||||
|
{"win32", "LDFLAGS", "sqlite3.lib"}]}.
|
||||||
|
{cover_enabled, true}.
|
||||||
|
{eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}.
|
||||||
|
{dialyzer_opts, [{plt, "dialyzer/sqlite3.plt"}]}.
|
||||||
Reference in New Issue
Block a user