From e2a407936ab88e276c2fdf00cc7b41074a3ec2a4 Mon Sep 17 00:00:00 2001 From: dchansen06 Date: Thu, 19 Dec 2024 00:15:12 -0800 Subject: [PATCH] Add second try --- Makefile | 9 +++++++-- src/server.cpp | 11 +++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 21d69f6..178e3b9 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,8 @@ CXXFLAGS = -Wall -Wextra LDLIBS = $(shell sdl2-config --libs) $(shell sdl2-config --libs)_mixer SRC_DIR = src -CLIENT_SRC := $(wildcard $(SRC_DIR)/client*.cpp) +CLIENT_SRC := $(wildcard $(SRC_DIR)/client.cpp) +CLIENT2_SRC := $(wildcard $(SRC_DIR)/client2.cpp) SERVER_SRC := $(wildcard $(SRC_DIR)/server*.cpp) # Heavily inspired by https://stackoverflow.com/a/30602701 @@ -16,9 +17,10 @@ BUILD_DIR = build BIN_DIR = $(BUILD_DIR)/bin OBJ_DIR = $(BUILD_DIR)/obj CLIENT_OBJ := $(CLIENT_SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o) +CLIENT2_OBJ := $(CLIENT2_SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o) SERVER_OBJ := $(SERVER_SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o) -PROGRAM = $(BIN_DIR)/client $(BIN_DIR)/server +PROGRAM = $(BIN_DIR)/client $(BIN_DIR)/server $(BIN_DIR)/client2 .DELETE_ON_ERROR: .PHONY: all clean @@ -34,6 +36,9 @@ $(BIN_DIR)/server: $(SERVER_OBJ) | $(BIN_DIR) $(BIN_DIR)/client: $(CLIENT_OBJ) | $(BIN_DIR) $(CXX) $(CXXFLAGS) $(^) -o $(@) +$(BIN_DIR)/client2: $(CLIENT2_OBJ) | $(BIN_DIR) + $(CXX) $(CXXFLAGS) $(^) -o $(@) + $(BIN_DIR) $(OBJ_DIR): mkdir -p $@ diff --git a/src/server.cpp b/src/server.cpp index c2b6c1b..bb2eb56 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -20,13 +20,12 @@ int main(int argc, char* argv[]) fspath path; - if (argc > 1) - { +// if (argc > 1) { path = argv[1]; - } else { - cout << "Enter directory "; - cin >> path; - } +// } else { +// cout << "Enter directory "; +// cin >> path; +// } music_list validmusic = findMusicFiles(path); shuffleMusic(validmusic);