-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile.win
47 lines (37 loc) · 1.17 KB
/
Makefile.win
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
!IF [where /q Makefile.auto.win]
# The file doesn't exist, so don't include it.
!ELSE
!INCLUDE Makefile.auto.win
!IF [del /f /q Makefile.auto.win] == 0
!ENDIF
!ENDIF
NMAKE = nmake -$(MAKEFLAGS)
SRC = c_src\duckdb\duckdb.cpp \
c_src\config.cpp \
c_src\nif.cpp \
c_src\term_to_value.cpp \
c_src\term.cpp \
c_src\value_to_term.cpp
CPPFLAGS = -O2 $(CPPFLAGS)
CPPFLAGS = -EHsc $(CPPFLAGS)
# -Wall will emit a lot of warnings on Windows
# CFLAGS = -Wall $(CFLAGS)
CPPFLAGS = -Ic_src -Ic_src\duckdb $(CPPFLAGS)
CPPFLAGS = -DNDEBUG=1 $(CPPFLAGS)
# Set Erlang-specific compile flags
!IFNDEF ERL_CFLAGS
ERL_CFLAGS = -I"$(ERL_EI_INCLUDE_DIR)"
!ENDIF
all: clean priv\duckdb_nif.dll
clean:
del /f /q priv
Makefile.auto.win:
erl -noshell -s init stop -eval "io:setopts(standard_io, [{encoding, unicode}]), io:format(\"ERTS_INCLUDE_PATH=~ts/erts-~ts/include/\", [code:root_dir(), erlang:system_info(version)])." > $@
!IFDEF ERTS_INCLUDE_PATH
priv\duckdb_nif.dll:
if NOT EXIST "priv" mkdir "priv"
$(CXX) $(ERL_CFLAGS) $(CPPFLAGS) -I"$(ERTS_INCLUDE_PATH)" -LD -MD -Fe$@ $(SRC)
!ELSE
priv\duckdb_nif.dll: Makefile.auto.win
$(NMAKE) -F Makefile.win priv\duckdb_nif.dll
!ENDIF