2024-06-25 04:34:28 +01:00
|
|
|
program = vmrcli
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
SRC_DIR := src
|
|
|
|
OBJ_DIR := obj
|
|
|
|
BIN_DIR := bin
|
|
|
|
|
|
|
|
EXE := $(BIN_DIR)/$(program).exe
|
|
|
|
SRC := $(wildcard $(SRC_DIR)/*.c)
|
|
|
|
OBJ := $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
|
|
|
|
|
2024-06-27 22:57:35 +01:00
|
|
|
LOG_USE_COLOR ?= yes
|
|
|
|
ifeq ($(LOG_USE_COLOR), yes)
|
|
|
|
CPPFLAGS := -Iinclude -MMD -MP -DLOG_USE_COLOR
|
|
|
|
else
|
|
|
|
CPPFLAGS := -Iinclude -MMD -MP
|
|
|
|
endif
|
2024-06-25 04:34:28 +01:00
|
|
|
CFLAGS = -O -Wall -W -pedantic -ansi -std=c99
|
|
|
|
LDFLAGS := -Llib
|
|
|
|
LDLIBS := -lm
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
all: $(EXE)
|
|
|
|
|
|
|
|
$(EXE): $(OBJ) | $(BIN_DIR)
|
|
|
|
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(BIN_DIR) $(OBJ_DIR):
|
2024-06-25 16:45:46 +01:00
|
|
|
pwsh -Command New-Item -Path $@ -ItemType Directory
|
2024-06-25 04:34:28 +01:00
|
|
|
|
|
|
|
clean:
|
2024-06-27 10:28:09 +01:00
|
|
|
pwsh -Command Remove-Item -Recurse $(EXE), $(OBJ_DIR)
|
2024-06-25 04:34:28 +01:00
|
|
|
|
|
|
|
-include $(OBJ:.o=.d)
|