61 lines
1.1 KiB
Makefile
61 lines
1.1 KiB
Makefile
CLIENT_SRC = client_src/main.c
|
|
SERVER_SRC = server_src/main.c
|
|
|
|
CLIENT_OBJ = ${CLIENT_SRC:.c=.o}
|
|
SERVER_OBJ = ${SERVER_SRC:.c=.o}
|
|
|
|
CC = clang
|
|
CFLAGS = -Werror -Wall -Wextra -g
|
|
LIBS = libftx/libftx.a
|
|
|
|
CLIENT_NAME = client
|
|
SERVER_NAME = server
|
|
|
|
%.o: %.c
|
|
${CC} ${CFLAGS} -c $< -o $@
|
|
|
|
all: ${CLIENT_NAME} ${SERVER_NAME}
|
|
|
|
${CLIENT_NAME}: ${CLIENT_OBJ}
|
|
make -C libftx
|
|
${CC} ${CLIENT_OBJ} -o ${CLIENT_NAME} ${LIBS}
|
|
|
|
${SERVER_NAME}: ${SERVER_OBJ}
|
|
make -C libftx
|
|
${CC} ${SERVER_OBJ} -o ${SERVER_NAME} ${LIBS}
|
|
|
|
client_clean:
|
|
make -C libftx clean
|
|
rm -f ${CLIENT_OBJ}
|
|
|
|
server_clean:
|
|
make -C libftx clean
|
|
rm -f ${SERVER_OBJ}
|
|
|
|
clean:
|
|
make -C libftx clean
|
|
rm -f ${SERVER_OBJ}
|
|
rm -f ${CLIENT_OBJ}
|
|
|
|
client_fclean:
|
|
make -C libftx fclean
|
|
rm -f ${CLIENT_NAME}
|
|
|
|
server_fclean:
|
|
make -C libftx fclean
|
|
rm -f ${SERVER_NAME}
|
|
|
|
fclean:
|
|
make -C libftx fclean
|
|
rm -f ${SERVER_NAME}
|
|
rm -f ${CLIENT_NAME}
|
|
|
|
server_re: server_fclean
|
|
${SERVER_NAME}
|
|
|
|
client_re: client_fclean client
|
|
|
|
re: fclean all
|
|
|
|
.PHONY: all clean fclean re client_re client_clean client_fclean server_re server_clean server_fclean
|