#The compiler
CC:=gcc
#The flags passed to the compiler
CFLAGS:=-O3 -g -Wall -Wextra -Wpedantic -std=gnu11
#Buggy on some systems: -fsanitize=address -fsanitize=leak
#The flags passed to the linker
LDFLAGS:=-lm
#Executable
EXEC=pendulum
#Dependencies
VPATH:=../gfx/

$(EXEC): pendulum.o gfx.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lSDL2

run: $(EXEC)
	@./$(EXEC)

$(EXEC).o: gfx.h

clean:
	rm -rf *.o $(EXEC)

.PHONY: clean
