-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
40 lines (25 loc) · 964 Bytes
/
makefile
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
CC = gcc
DIR = -L ./glfw-3.4/build/src/ -I./glfw-3.4/include/
LINKFLAGS = -lglfw3 -lm -lvulkan
NOTNEEDED = -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi
CFLAGS = -std=gnu17 -flto
DFLAGS = -Wall -Wextra -Wpedantic -Wconversion -Warith-conversion -g -DNDEBUG
SRC = real.c
TARGET = vtest
$(TARGET): real.o debugV2.o makefile
$(CC) $(CFLAGS) $(DFLAGS) debugV2.o real.o -o $(TARGET) $(DIR) $(LINKFLAGS)
real.o: real.c debugV2.h shorttypes.h makefile
$(CC) $(CFLAGS) $(DFLAGS) $(SRC) -c $(DIR)
debugV2.o: debugV2.c debugV2.h makefile
$(CC) $(CFLAGS) $(DFLAGS) debugV2.c -c
final: real.c makefile shorttypes.h
$(CC) $(CFLAGS) -O2 -o final $(SRC) $(DIR) $(LINKFLAGS)
memoryTest: memoryTest.c makefile
$(CC) $(CFLAGS) $(DFLAGS) memoryTest.c -o memoryTest $(DIR) $(LINKFLAGS)
.PHONY: clean test testmemory
test: $(TARGET)
./$(TARGET)
clean:
rm $(TARGET) *.o final memoryTest
testmemory:
valgrind --leak-check=full --show-leak-kinds=all -s ./memoryTest