Add server stages to makefile
This commit is contained in:
parent
8d6faadc2d
commit
c4341b2861
7
Makefile
7
Makefile
|
@ -4,6 +4,7 @@ LDFLAGS = -lm
|
||||||
BUILD_DIR = build
|
BUILD_DIR = build
|
||||||
COMMON_OBJ_FILES = $(patsubst %.c,$(BUILD_DIR)/%.o,$(wildcard common/*.c))
|
COMMON_OBJ_FILES = $(patsubst %.c,$(BUILD_DIR)/%.o,$(wildcard common/*.c))
|
||||||
CLIENT_OBJ_FILES = $(patsubst %.c,$(BUILD_DIR)/%.o,$(wildcard client/*.c))
|
CLIENT_OBJ_FILES = $(patsubst %.c,$(BUILD_DIR)/%.o,$(wildcard client/*.c))
|
||||||
|
SERVER_OBJ_FILES = $(patsubst %.c,$(BUILD_DIR)/%.o,$(wildcard server/*.c))
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
|
@ -14,9 +15,15 @@ clean:
|
||||||
http_client: $(BUILD_DIR) $(COMMON_OBJ_FILES) $(CLIENT_OBJ_FILES)
|
http_client: $(BUILD_DIR) $(COMMON_OBJ_FILES) $(CLIENT_OBJ_FILES)
|
||||||
$(CC) -o $@ $(LDFLAGS) $(filter-out $(BUILD_DIR),$^)
|
$(CC) -o $@ $(LDFLAGS) $(filter-out $(BUILD_DIR),$^)
|
||||||
|
|
||||||
|
http_server: $(BUILD_DIR) $(COMMON_OBJ_FILES) $(SERVER_OBJ_FILES)
|
||||||
|
$(CC) -o $@ $(LDFLAGS) $(filter-out $(BUILD_DIR),$^)
|
||||||
|
|
||||||
$(BUILD_DIR)/%.o: %.c
|
$(BUILD_DIR)/%.o: %.c
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
$(BUILD_DIR)/server:
|
||||||
|
mkdir -p $(BUILD_DIR)/server
|
||||||
|
|
||||||
$(BUILD_DIR)/client:
|
$(BUILD_DIR)/client:
|
||||||
mkdir -p $(BUILD_DIR)/client
|
mkdir -p $(BUILD_DIR)/client
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue