-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNMAKEFILE
81 lines (65 loc) · 2.2 KB
/
NMAKEFILE
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
USER_SOURCES = neural-growth.cpp brain.cpp tree.cpp node.cpp config.c utility.cpp interface_win.cpp
EXECUTABLE = neural-growth.exe
###################################
SOURCE_DIR = src
OBJECT_DIR = build
BINARY_DIR = bin
EXTERN_DIR = ext
###################################
LINK = link
CC = cl
CFLAGS = /EHsc /W3 /Ox /c /Fo.\$(OBJECT_DIR)\ \
$(_INCLUDE_DIRS)
# CC = icl
# CFLAGS = /EHsc /Wall /Wextra /Wpedantic /Qdiag-disable:remark /O3 /arch=SSSE3 /c /Fo.\$(OBJECT_DIR)\ \
# /D__builtin_huge_val()=HUGE_VAL \
# /D__builtin_huge_valf()=HUGE_VALF \
# /D__builtin_nan=nan \
# /D__builtin_nanf=nanf \
# /D__builtin_nans=nan \
# /D__builtin_nansf=nanf \
INCLUDE_DIRS = \
$(EXTERN_DIR)\libconfig\lib \
$(EXTERN_DIR)\engine-opengl\include \
$(EXTERN_DIR)\engine-opengl\src \
$(EXTERN_DIR)\engine-opengl\ext\glfw\include \
$(EXTERN_DIR)\engine-opengl\ext\glew\include \
$(EXTERN_DIR)\engine-opengl\ext\stb \
$(EXTERN_DIR)\engine-opengl\ext\glm
!IF "$(INCLUDE_DIRS)" != ""
_INCLUDE_DIRS = /I $(INCLUDE_DIRS: = /I )
!ENDIF
LIBS = $(EXTERN_DIR)\libconfig\x64\Release\libconfig.lib \
"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64\User32.lib"\
$(EXTERN_DIR)\engine-opengl\lib\glsr.lib \
$(EXTERN_DIR)\engine-opengl\ext\glfw\build\src\Release\glfw3dll.lib \
DLLS_SRC = $(EXTERN_DIR)\libconfig\x64\Release\libconfig.dll \
$(EXTERN_DIR)\engine-opengl\lib\glsr.dll \
$(EXTERN_DIR)\engine-opengl\lib\glfw3.dll \
$(EXTERN_DIR)\engine-opengl\lib\glew32.dll \
$(EXTERN_DIR)\engine-opengl\lib\opengl32.dll
SOURCES = $(SOURCE_DIR)\$(USER_SOURCES: = src\)
__OBJECTS = $(OBJECT_DIR)\$(USER_SOURCES: = build\)
_OBJECTS = $(__OBJECTS:.cpp=.obj)
OBJECTS = $(_OBJECTS:.c=.obj)
BINARY = $(BINARY_DIR)\$(EXECUTABLE)
all: $(BINARY) $(BINARY_DIR) $(OBJECTS)
echo_inc:
echo $(_INCLUDE_DIRS)
echo_dlls:
echo $(DLLS_SRC)
echo_objects:
echo $(OBJECTS)
echo_sources:
echo $(SOURCES)
# Stack size is set to 16 Mb
$(BINARY): $(OBJECTS)
$(LINK) $(OBJECTS) $(LIBS) /STACK:16777216 /OUT:$(BINARY)
$(BINARY_DIR): $(DLLS_SRC)
for %n in ($**) do copy /y /v /b %n $@
{$(SOURCE_DIR)\}.cpp{$(OBJECT_DIR)\}.obj::
$(CC) $(CFLAGS) $<
{$(SOURCE_DIR)\}.c{$(OBJECT_DIR)\}.obj::
$(CC) $(CFLAGS) $<
clean:
del $(OBJECT_DIR)\*.obj $(BINARY_DIR)\*.dll $(BINARY_DIR)\*.exe