Improved Makefile for Windows
This commit is contained in:
30
GNUmakefile
Normal file
30
GNUmakefile
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
REBAR=./rebar
|
||||||
|
REBAR_COMPILE=$(REBAR) get-deps compile
|
||||||
|
PLT=dialyzer/sqlite3.plt
|
||||||
|
|
||||||
|
all: compile
|
||||||
|
|
||||||
|
compile:
|
||||||
|
$(REBAR_COMPILE)
|
||||||
|
|
||||||
|
test:
|
||||||
|
$(REBAR_COMPILE) eunit
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-rm -rf deps ebin priv doc/* .eunit c_src/*.o
|
||||||
|
|
||||||
|
docs:
|
||||||
|
$(REBAR_COMPILE) doc
|
||||||
|
|
||||||
|
static:
|
||||||
|
$(REBAR_COMPILE)
|
||||||
|
ifeq ($(wildcard $(PLT)),)
|
||||||
|
dialyzer --build_plt --apps kernel stdlib erts --output_plt $(PLT)
|
||||||
|
else
|
||||||
|
dialyzer --plt $(PLT) -r ebin
|
||||||
|
endif
|
||||||
|
|
||||||
|
cross_compile: clean
|
||||||
|
$(REBAR_COMPILE) -C rebar.cross_compile.config
|
||||||
|
|
||||||
|
.PHONY: all compile test clean docs static
|
||||||
27
Makefile
27
Makefile
@@ -1,30 +1,29 @@
|
|||||||
REBAR=./rebar
|
REBAR=rebar
|
||||||
REBAR_COMPILE=$(REBAR) get-deps compile
|
REBAR_COMPILE=$(REBAR) get-deps compile
|
||||||
PLT=dialyzer/sqlite3.plt
|
PLT=dialyzer\sqlite3.plt
|
||||||
|
ERL_INTERFACE=$(ERL_ROOT)\lib\erl_interface-3.7.2
|
||||||
|
ERTS=$(ERL_ROOT)\erts-5.8.2
|
||||||
|
SQLITE_SRC=F:\MyProgramming\sqlite-amalgamation
|
||||||
|
|
||||||
all: compile
|
all: compile
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
$(REBAR_COMPILE)
|
$(REBAR_COMPILE)
|
||||||
|
|
||||||
test:
|
tests:
|
||||||
$(REBAR_COMPILE) eunit
|
$(REBAR) eunit
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -rf deps ebin priv doc/* .eunit c_src/*.o
|
-rm -rf deps ebin priv doc\* .eunit c_src\*.o
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
$(REBAR_COMPILE) doc
|
$(REBAR_COMPILE) doc
|
||||||
|
|
||||||
static:
|
static: compile
|
||||||
$(REBAR_COMPILE)
|
@if not exist $(PLT) \
|
||||||
ifeq ($(wildcard $(PLT)),)
|
(mkdir dialyzer & 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
|
|
||||||
|
|
||||||
cross_compile: clean
|
cross_compile: clean
|
||||||
$(REBAR_COMPILE) -C rebar.cross_compile.config
|
$(REBAR_COMPILE) -C rebar.cross_compile.config
|
||||||
|
|
||||||
.PHONY: all compile test clean docs static
|
|
||||||
|
|||||||
37
msvc.mk
37
msvc.mk
@@ -1,37 +0,0 @@
|
|||||||
REBAR=rebar
|
|
||||||
REBAR_COMPILE=$(REBAR) get-deps compile
|
|
||||||
PLT=dialyzer\sqlite3.plt
|
|
||||||
ERL_INTERFACE=$(ERL_ROOT)\lib\erl_interface-3.7.2
|
|
||||||
ERTS=$(ERL_ROOT)\erts-5.8.2
|
|
||||||
SQLITE_SRC=F:\MyProgramming\sqlite-amalgamation
|
|
||||||
|
|
||||||
all: compile
|
|
||||||
|
|
||||||
compile: compile_c src\*
|
|
||||||
erlc -I include -o ebin src\*.erl
|
|
||||||
|
|
||||||
# while rebar doesn't support Windows ports
|
|
||||||
compile_c: c_src\*
|
|
||||||
cl /W4 /wd4100 /wd4204 /I$(ERL_INTERFACE)/include /I$(ERTS)/include /I$(SQLITE_SRC) /Ic_src c_src/*.c /link /dll /LIBPATH:$(ERL_INTERFACE)\lib ei.lib $(SQLITE_SRC)\sqlite3.lib /out:priv\sqlite3_drv.dll
|
|
||||||
|
|
||||||
test: compile_c test\*
|
|
||||||
erlc -DTEST=true -I include -o .eunit src\*.erl test\*.erl
|
|
||||||
$(REBAR) eunit
|
|
||||||
|
|
||||||
clean:
|
|
||||||
-rm -rf deps ebin priv doc\* .eunit c_src\*.o
|
|
||||||
|
|
||||||
docs: compile
|
|
||||||
$(REBAR) doc
|
|
||||||
|
|
||||||
# static: compile
|
|
||||||
# ifeq ($(wildcard $(PLT)),)
|
|
||||||
# dialyzer --build_plt --apps kernel stdlib erts --output_plt $(PLT)
|
|
||||||
# else
|
|
||||||
# dialyzer --plt $(PLT) -r ebin
|
|
||||||
# endif
|
|
||||||
|
|
||||||
cross_compile: clean
|
|
||||||
$(REBAR_COMPILE) -C rebar.cross_compile.config
|
|
||||||
|
|
||||||
.PHONY: all compile test clean docs static
|
|
||||||
@@ -2,8 +2,7 @@
|
|||||||
{erl_opts, [debug_info]}. %% required for dialyzer
|
{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"},
|
{"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,"."}]}}]}.
|
||||||
|
|||||||
Reference in New Issue
Block a user