-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWinMakefile
38 lines (27 loc) · 949 Bytes
/
WinMakefile
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
# Brian Chrzanowski
# Wed Sep 04, 2019 13:32
#
# Windows Makefile
CC=gcc
LINKER=-lm -lmingw32
CFLAGS=-Wall -g3 -march=native -D__USE_MINGW_ANSI_STDIO=1
SRC=src/lump.c src/main.c src/sys_win32.c src/molttest.c
OBJ=$(SRC:.c=.o)
DEP=$(OBJ:.o=.d) # one dependency file for each source
all: molt.exe molttest.exe moltcuda.dll experiments/test.exe
%.d: %.c
@$(CC) $(CFLAGS) $(PPARMS) $< -MM -MT $(@:.d=.o) >$@
%.o: %.c
$(CC) -c $(CFLAGS) $(PPARMS) $(PREPROCESSPARMS) -o $@ $<
-include $(DEP)
molt.exe: src/lump.o src/main.o src/sys_win32.o
$(CC) $(CFLAGS) -o $@ $^ $(LINKER)
molttest.exe: src/molttest.c
$(CC) $(CFLAGS) -o $@ $^ $(LINKER)
# this is where we have individual targets for modules
moltcuda.dll: src/custom/moltcuda.cu
nvcc -cudart static -g -G --shared -o $@ src/custom/moltcuda.cu
experiments/test.exe: experiments/test.c
$(CC) $(CFLAGS) -o $@ $^ $(LINKER)
clean:
del src\*.o src\*.d molt*.* *.pdb del experiments\test.exe