80 lines
1.4 KiB
Makefile
80 lines
1.4 KiB
Makefile
BUILD_DIR := build
|
|
RM := rm -rf $(BUILD_DIR)
|
|
|
|
OBJ_SRCS :=
|
|
ASM_SRCS :=
|
|
C_SRCS :=
|
|
O_SRCS :=
|
|
S_UPPER_SRCS :=
|
|
EXECUTABLES :=
|
|
OBJS :=
|
|
C_DEPS :=
|
|
|
|
# Every subdirectory with source files must be described here
|
|
SUBDIRS := \
|
|
. \
|
|
|
|
C_SRCS += \
|
|
src/IAEngine.c \
|
|
src/arenaEngine.c \
|
|
src/arenaGUI.c \
|
|
src/fileHandler.c \
|
|
src/logHelper.c \
|
|
src/main.c \
|
|
src/menuGUI.c
|
|
|
|
OBJS += \
|
|
build/IAEngine.o \
|
|
build/arenaEngine.o \
|
|
build/arenaGUI.o \
|
|
build/fileHandler.o \
|
|
build/logHelper.o \
|
|
build/main.o \
|
|
build/menuGUI.o
|
|
|
|
C_DEPS += \
|
|
build/IAEngine.d \
|
|
build/arenaEngine.d \
|
|
build/arenaGUI.d \
|
|
build/fileHandler.d \
|
|
build/logHelper.d \
|
|
build/main.d \
|
|
build/menuGUI.d
|
|
|
|
|
|
build/%.o: src/%.c
|
|
@echo 'Building file: $<'
|
|
@echo 'Invoking: GCC C Compiler'
|
|
gcc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
|
@echo 'Finished building: $<'
|
|
@echo ' '
|
|
|
|
LIBS := -lSDL2 -lSDL2main -lSDL2_image
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
ifneq ($(strip $(C_DEPS)),)
|
|
-include $(C_DEPS)
|
|
endif
|
|
endif
|
|
|
|
.PHONY: all buildDir clean dependents
|
|
|
|
# All Target
|
|
all: buildDir ArenaSurvivalTournament
|
|
|
|
buildDir:
|
|
[ -d $(BUILD_DIR) ] || mkdir -p $(BUILD_DIR)
|
|
|
|
# Tool invocations
|
|
ArenaSurvivalTournament: $(OBJS)
|
|
@echo 'Building target: $@'
|
|
@echo 'Invoking: GCC C Linker'
|
|
gcc -o "ArenaSurvivalTournament" $(OBJS) $(LIBS)
|
|
@echo 'Finished building target: $@'
|
|
@echo ' '
|
|
|
|
# Other Targets
|
|
clean:
|
|
-$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) ArenaSurvivalTournament
|
|
-@echo ' '
|