about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2bc39b7..6ba62c8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
-CC=egcc
-CFLAGS=-std=c99 -g -Wall -I. -lpthread -lSDL2
+CC=clang
+INC_DIRS="."
+CFLAGS=-std=c99 -g -Wall -I$(INC_DIRS)
+LDFLAGS=-lpthread $(shell pkg-config --libs --cflags sdl2)
 
 all: chip8_emulator
 
@@ -7,7 +9,7 @@ all: chip8_emulator
 	$(CC) $(CFLAGS) -c $^
 
 chip8_emulator: emulator.o main.c
-	$(CC) $(CFLAGS) -o $@ $^
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
 
 clean:
 	rm *.o chip8_emulator