From 84972ed9bb21175961006023020b8993654990b7 Mon Sep 17 00:00:00 2001 From: thorium1256 Date: Sun, 22 Jun 2025 17:59:22 +0300 Subject: [PATCH] silly makefile stuff makefile realization makefile insanity makefile madness readme update to fit in with actual makefile --- Makefile.unix | 15 +++++++-------- Makefile.win | 15 +++++++-------- README.md | 2 -- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Makefile.unix b/Makefile.unix index d856527..bea757b 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -15,6 +15,8 @@ SRC_DIR := src BIN_DIR := bin DBG_DIR := $(BIN_DIR)/debug RLS_DIR := $(BIN_DIR)/release +DBG_EXEC := $(DBG_DIR)/debug +RLS_STRIPPED_EXEC := $(RLS_DIR)/tuimine # sources and objects SRCS := $(wildcard $(SRC_DIR)/*.cpp) @@ -29,22 +31,19 @@ $(shell mkdir -p $(BUILD_DIR)) # phony rules .PHONY := all debug release clean -all: debug +all: release -debug: $(DBG_DIR)/debug -release: $(RLS_DIR)/release $(RLS_DIR)/release_stripped +debug: $(DBG_EXEC) +release: $(RLS_STRIPPED_EXEC) both: debug release # linking -$(DBG_DIR)/debug: $(DBG_OBJS) +$(DBG_EXEC): $(DBG_OBJS) $(CXX) -o $@ $^ $(DBG_LDFLAGS) -$(RLS_DIR)/release_stripped: $(RLS_OBJS) +$(RLS_STRIPPED_EXEC): $(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 34289ab..6819b87 100644 --- a/Makefile.win +++ b/Makefile.win @@ -16,6 +16,8 @@ BIN_DIR := bin DBG_DIR := $(BIN_DIR)\debug RLS_DIR := $(BIN_DIR)\release LIB_DIR := lib +DBG_EXEC := $(DBG_DIR)\debug.exe +RLS_STRIPPED_EXEC := $(RLS_DIR)\tuimine.exe # sources and objects LIBS := $(wildcard $(LIB_DIR)/*.dll) @@ -33,25 +35,22 @@ $(shell if not exist $(BUILD_DIR) mkdir $(BUILD_DIR)) # phony rules .PHONY := all debug release clean libraries_debug libraries_release both -all: debug +all: release -debug: $(DBG_DIR)/debug.exe libraries_debug -release: $(RLS_DIR)/release_stripped.exe $(RLS_DIR)/release.exe libraries_release +debug: $(DBG_EXEC) libraries_debug +release: $(RLS_STRIPPED_EXEC) libraries_release both: debug release libraries_debug: $(LIBS_DBG) libraries_release: $(LIBS_RLS) # linking -$(DBG_DIR)/debug.exe: $(DBG_OBJS) +$(DBG_EXEC): $(DBG_OBJS) $(CXX) -o $@ $^ $(DBG_LDFLAGS) -$(RLS_DIR)/release_stripped.exe: $(RLS_OBJS) +$(RLS_STRIPPED_EXEC): $(RLS_OBJS) $(CXX) -o $@ $^ $(RLS_STRP_LDFLAGS) -$(RLS_DIR)/release.exe: $(RLS_OBJS) - $(CXX) -o $@ $^ $(LDFLAGS) - # compiling $(BUILD_DIR)/debug_%.o: $(SRC_DIR)/%.cpp $(CXX) -c -o $@ $< $(DBG_CXXFLAGS) diff --git a/README.md b/README.md index ea3e751..d772288 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,6 @@ You can't flag already revealed cells. ## Compilation -By default, the Makefile compiles in debug mode, so to compile both, use `make both`. - ### Windows For compiling on Windows, you need MSYS2 and MinGW-w64.