diff options
author | Preston Pan <ret2pop@gmail.com> | 2024-12-27 20:05:06 -0800 |
---|---|---|
committer | Preston Pan <ret2pop@gmail.com> | 2024-12-27 20:05:06 -0800 |
commit | 63f11aaec8d21844a07fd27003a992c102a3a297 (patch) | |
tree | 6240a2c8561642d0c1d0b95148d6c868c7855a4a /Makefile | |
parent | fd14f6fbf8206589d2a0ad8f0793845cb8faf1d7 (diff) |
make directory structure for client
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -1,10 +1,17 @@ -SRC_DIR := src -OBJ_DIR := obj +SERVER_DIR := server +CLIENT_DIR := client +OBJ_DIR := server_obj +CLIENT_OBJ_DIR := client_obj BIN_DIR := bin EXE := $(BIN_DIR)/umami -SRC := $(wildcard $(SRC_DIR)/*.c) -OBJ := $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) +CLIENT_EXE = $(BIN_DIR)/client + +SRC := $(wildcard $(SERVER_DIR)/*.c) +OBJ := $(SRC:$(SERVER_DIR)/%.c=$(OBJ_DIR)/%.o) + +CLIENT_SRC := $(wildcard $(CLIENT_DIR/*.c)) +CLIENT_OBJ := $(CLIENT_SRC:$(CLIENT_DIR)/%.c=$(OBJ_DIR)/%.o) CFLAGS := -Wall -Iinclude -lcrypto -lssl LDFLAGS := -Llib @@ -13,12 +20,18 @@ LDLIBS := -lm CFLAGS += $(NIX_CFLAGS_COMPILE) .PHONY: all clean -all: $(EXE) +all: $(EXE) $(CLIENT_EXE) $(EXE): $(OBJ) | $(BIN_DIR) $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ -$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR) +$(CLIENT_EXE): $(CLIENT_OBJ) | $(BIN_DIR) + $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ + +$(OBJ_DIR)/%.o: $(SERVER_DIR)/%.c | $(OBJ_DIR) + $(CC) $(CFLAGS) -c $< -o $@ + +$(CLIENT_OBJ_DIR)/%.o: $(CLIENT_DIR)/%.c | $(CLIENT_OBJ_DIR) $(CC) $(CFLAGS) -c $< -o $@ $(BIN_DIR) $(OBJ_DIR): |