battleloom-engine/makefile

21 lines
486 B
Makefile
Raw Permalink Normal View History

2024-02-15 14:18:37 +00:00
TARGET ?= build/rts_game
SRC_DIRS ?= ./src
2024-02-15 13:53:51 +00:00
2024-02-15 14:18:37 +00:00
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s)
OBJS := $(addsuffix .o,$(basename $(SRCS)))
2024-02-15 13:53:51 +00:00
DEPS := $(OBJS:.o=.d)
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
2024-02-15 14:18:37 +00:00
CPPFLAGS ?= $(INC_FLAGS) -MMD -MP
2024-02-15 13:53:51 +00:00
2024-02-15 14:18:37 +00:00
$(TARGET): $(OBJS)
2024-03-14 10:56:44 +00:00
$(CC) $(LDFLAGS) $(OBJS) -o $@ $(LOADLIBES) $(LDLIBS) -lSDL2 -lSDL2_image -lSDL2_ttf
2024-02-15 13:53:51 +00:00
.PHONY: clean
clean:
2024-02-15 14:18:37 +00:00
$(RM) $(TARGET) $(OBJS) $(DEPS)
2024-02-15 13:53:51 +00:00
2024-02-15 14:18:37 +00:00
-include $(DEPS)