aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 19 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 0460512..4b60314 100644
--- a/Makefile
+++ b/Makefile
@@ -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):