CXX = g++
CXXFLAGS = -std=c++17 -Wall -Wextra -O3 `sdl2-config --cflags`
LDFLAGS = `sdl2-config --libs`

TARGET = cybermatris
OBJS = main.o Game.o Synth.o Renderer.o

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)

main.o: main.cpp Game.hpp Synth.hpp Renderer.hpp Font.hpp
	$(CXX) $(CXXFLAGS) -c main.cpp

Game.o: Game.cpp Game.hpp
	$(CXX) $(CXXFLAGS) -c Game.cpp

Synth.o: Synth.cpp Synth.hpp
	$(CXX) $(CXXFLAGS) -c Synth.cpp

Renderer.o: Renderer.cpp Renderer.hpp Game.hpp Synth.hpp Font.hpp
	$(CXX) $(CXXFLAGS) -c Renderer.cpp

clean:
	rm -f $(OBJS) $(TARGET)

.PHONY: all clean
