updated makefile
This commit is contained in:
parent
53edbed05b
commit
9ef789caf3
28
Makefile
28
Makefile
@ -1,10 +1,28 @@
|
|||||||
all: client server
|
CC = g++
|
||||||
|
CFLAGS = -std=c++20 -Wall -Werror -fsanitize=address
|
||||||
|
|
||||||
client: client.cpp
|
TARGET = client server
|
||||||
g++ -std=c++20 -Wall -Werror -fsanitize=address -o twmailer-client client.cpp
|
BUILD_DIR = build
|
||||||
|
|
||||||
server: server.cpp
|
SOURCES_CLIENT = client.cpp
|
||||||
g++ -std=c++20 -Wall -Werror -fsanitize=address -o twmailer-server server.cpp
|
OBJS_CLIENT = $(addprefix $(BUILD_DIR)/,$(SOURCES_CLIENT:.cpp=.o))
|
||||||
|
|
||||||
|
SOURCES_SERVER = server.cpp user.cpp user_handler.cpp
|
||||||
|
OBJS_SERVER = $(addprefix $(BUILD_DIR)/,$(SOURCES_SERVER:.cpp=.o))
|
||||||
|
|
||||||
|
all: $(BUILD_DIR) $(TARGET)
|
||||||
|
|
||||||
|
$(BUILD_DIR):
|
||||||
|
mkdir -p $(BUILD_DIR)
|
||||||
|
|
||||||
|
client: $(OBJS_CLIENT)
|
||||||
|
$(CC) $(CFLAGS) -o twmailer-client $^
|
||||||
|
|
||||||
|
server: $(OBJS_SERVER)
|
||||||
|
$(CC) $(CFLAGS) -o twmailer-server $^
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.o: %.cpp
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f twmailer-client twmailer-server
|
rm -f twmailer-client twmailer-server
|
||||||
Loading…
x
Reference in New Issue
Block a user