-
Notifications
You must be signed in to change notification settings - Fork 137
/
Makefile.win
63 lines (47 loc) · 1.55 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
!IF [where /Q Makefile.auto.win]
# The file doesn't exist, so don't include it.
!ELSE
!INCLUDE Makefile.auto.win
!IF [del /Q /F Makefile.auto.win] == 0
!ENDIF
!ENDIF
CC=cl
LINK=link
NMAKE = nmake /$(MAKEFLAGS)
STATIC = priv\static
SRC_DIR = c_src
# Scenic.Math.Line.parallel({{1,2},{3,4}}, 4)
calling_from_make:
mix compile
all: clean priv $(STATIC) Makefile.auto.win NIF
clean:
del /Q /F priv
priv:
mkdir priv
$(STATIC):
mkdir $(STATIC)
xcopy /S /E /Y static $(STATIC)
Makefile.auto.win:
erl -eval "io:format(\"~s~n\", [lists:concat([\"ERTS_INCLUDE_PATH=\", code:root_dir(), \"/erts-\", erlang:system_info(version), \"/include\"])])" -s init stop -noshell > $@
NIF: priv\line.dll priv\matrix.dll priv\texture.dll
!IFDEF ERTS_INCLUDE_PATH
priv\line.obj:
$(CC) -c $(ERL_CFLAGS) $(CFLAGS) /I"$(ERTS_INCLUDE_PATH)" /LD /MD /Fo: $@ $(SRC_DIR)\line.c
priv\line.dll: priv\line.obj
$(LINK) /DLL /OUT:priv\line.dll priv\line.obj
priv\texture.obj:
$(CC) -c $(ERL_CFLAGS) $(CFLAGS) /I"$(ERTS_INCLUDE_PATH)" /LD /MD /Fo: $@ $(SRC_DIR)\texture.c
priv\texture.dll: priv\texture.obj
$(LINK) /DLL /OUT:priv\texture.dll priv\texture.obj
priv\matrix.obj:
$(CC) -c $(ERL_CFLAGS) $(CFLAGS) /I"$(ERTS_INCLUDE_PATH)" /LD /MD /Fo: $@ $(SRC_DIR)\matrix.c
priv\matrix.dll: priv\matrix.obj
$(LINK) /DLL /OUT:priv\matrix.dll priv\matrix.obj
!ELSE
priv\line.dll: Makefile.auto.win
$(NMAKE) /F Makefile.win priv\line.dll
priv\matrix.dll: Makefile.auto.win
$(NMAKE) /F Makefile.win priv\matrix.dll
priv\texture.dll: Makefile.auto.win
$(NMAKE) /F Makefile.win priv\texture.dll
!ENDIF