Mineur_Tycoon/Makefile
2025-02-28 11:06:04 +01:00

49 lines
937 B
Makefile

OUTNAME = mtycoon
CFLAGS = -O0 -g -Wall -Wextra -I ./raylib/include -pipe
#linux
LDFLAGS = -L./raylib/lib -lraylib -lm
CC = gcc
OUTPUT = "${OUTNAME}.amd64"
BUILD_DIR = build
SRC_DIR = src
OBJS = $(patsubst $(SRC_DIR)/%.c,build-tmp/%.o,$(wildcard $(SRC_DIR)/*.c))
all: | builddir build
${CC} ${CFLAGS} -o ${OUTPUT} ${wildcard $(BUILD_DIR)/*.o} ${LDFLAGS}
windef:
$(eval OUTPUT = "$(OUTNAME).exe")
$(eval BUILD_DIR = build-win)
$(eval LDFLAGS = -static -lraylib -lgdi32 -lwinmm -lm)
build-tmp/%.o : $(SRC_DIR)/%.c
${CC} -c $< -o $@ ${CFLAGS}
build: $(OBJS)
mv $(OBJS) $(BUILD_DIR)/
rm -rf build-tmp
builddir:
- mkdir $(BUILD_DIR)
mkdir build-tmp
- mv $(wildcard $(BUILD_DIR)/*.o) build-tmp/
win: | windef all
testwin: win
./$(OUTPUT)
test: all
./${OUTPUT}
clean:
- rm -rf ${BUILD_DIR}
- rm -rf build-win
- rm -rf build-tmp
- rm "$(OUTNAME).amd64" "$(OUTNAME).exe"
.PHONY: all test clean win testwin prodwin