From 099354b523d0661fd29dcfcbc1e7871e2b5dc7e3 Mon Sep 17 00:00:00 2001 From: TheRedBlueCube3 Date: Sat, 21 Jun 2025 22:17:56 +0300 Subject: [PATCH] forgot the makefiles --- Makefile.unix | 16 ++++++++++------ Makefile.win | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile.unix b/Makefile.unix index d897982..562a0d9 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -21,26 +21,30 @@ SRCS := $(wildcard $(SRC_DIR)/*.cpp) DBG_OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/debug_%.o,$(SRCS)) RLS_OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/release_%.o,$(SRCS)) +$(shell mkdir -p $(BIN_DIR)) +$(shell mkdir -p $(DBG_DIR)) +$(shell mkdir -p $(RLS_DIR)) $(shell mkdir -p $(BUILD_DIR)) -# $(shell if not exist $(BUILD_DIR)/debug mkdir $(BUILD_DIR)/debug) -# $(shell $(BUILD_DIR)/release) # phony rules .PHONY := all debug release clean all: debug -debug: $(BIN_DIR)/debug -release: $(BIN_DIR)/release +debug: $(DBG_DIR)/debug +release: $(RLS_DIR)/release $(RLS_DIR)/release_stripped both: debug release # linking -$(BIN_DIR)/debug: $(DBG_OBJS) +$(DBG_DIR)/debug: $(DBG_OBJS) $(CXX) -o $@ $^ $(DBG_LDFLAGS) -$(BIN_DIR)/release: $(RLS_OBJS) +$(RLS_DIR)/release_stripped: $(RLS_OBJS) $(CXX) -o $@ $^ $(RLS_LDFLAGS) +$(RLS_DIR)/release: $(RLS_OBJS) + $(CXX) -o $@ $^ $(LDFLAGS) + # compiling $(BUILD_DIR)/debug_%.o: $(SRC_DIR)/%.cpp $(CXX) -c -o $@ $< $(DBG_CXXFLAGS) diff --git a/Makefile.win b/Makefile.win index 1accd74..96854d1 100644 --- a/Makefile.win +++ b/Makefile.win @@ -25,6 +25,7 @@ SRCS := $(wildcard $(SRC_DIR)/*.cpp) DBG_OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/debug_%.o,$(SRCS)) RLS_OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/release_%.o,$(SRCS)) +$(shell if not exist $(BIN_DIR) mkdir $(BIN_DIR)) $(shell if not exist $(DBG_DIR) mkdir $(DBG_DIR)) $(shell if not exist $(RLS_DIR) mkdir $(RLS_DIR)) $(shell if not exist $(BUILD_DIR) mkdir $(BUILD_DIR))