From 031ed96015d24342901ffeb10dbf5aa604442382 Mon Sep 17 00:00:00 2001 From: dchansen06 Date: Thu, 19 Dec 2024 01:35:16 -0800 Subject: [PATCH] Fix --- Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 21d69f6..0018872 100644 --- a/Makefile +++ b/Makefile @@ -8,17 +8,15 @@ CXXFLAGS = -Wall -Wextra LDLIBS = $(shell sdl2-config --libs) $(shell sdl2-config --libs)_mixer SRC_DIR = src -CLIENT_SRC := $(wildcard $(SRC_DIR)/client*.cpp) -SERVER_SRC := $(wildcard $(SRC_DIR)/server*.cpp) +CLIENT_SRC = $(wildcard $(SRC_DIR)/client*.cpp) +SERVER_SRC = $(wildcard $(SRC_DIR)/server*.cpp) -# Heavily inspired by https://stackoverflow.com/a/30602701 BUILD_DIR = build BIN_DIR = $(BUILD_DIR)/bin -OBJ_DIR = $(BUILD_DIR)/obj -CLIENT_OBJ := $(CLIENT_SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o) -SERVER_OBJ := $(SERVER_SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o) - PROGRAM = $(BIN_DIR)/client $(BIN_DIR)/server +OBJ_DIR = $(BUILD_DIR)/obj +CLIENT_OBJ = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(CLIENT_SRC)) +SERVER_OBJ = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SERVER_SRC)) .DELETE_ON_ERROR: .PHONY: all clean