42_minitalk/Makefile

65 lines
1.1 KiB
Makefile
Raw Normal View History

2023-01-23 07:22:30 -05:00
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}
2023-01-24 10:10:17 -05:00
client_fclean: client_clean
2023-01-23 07:22:30 -05:00
make -C libftx fclean
rm -f ${CLIENT_NAME}
2023-01-24 10:10:17 -05:00
server_fclean: server_clean
2023-01-23 07:22:30 -05:00
make -C libftx fclean
rm -f ${SERVER_NAME}
2023-01-24 10:10:17 -05:00
fclean: clean
2023-01-24 10:11:42 -05:00
make -C libftx fclean
rm -f ${SERVER_OBJ}
rm -f ${CLIENT_OBJ}
2023-01-23 07:22:30 -05:00
rm -f ${SERVER_NAME}
rm -f ${CLIENT_NAME}
2023-01-24 10:10:17 -05:00
2023-01-23 07:22:30 -05:00
server_re: server_fclean
${SERVER_NAME}
2023-01-24 10:10:17 -05:00
client_re: client_fclean
${CLIENT_NAME}
2023-01-23 07:22:30 -05:00
2023-01-23 08:13:48 -05:00
re: fclean all
2023-01-23 07:22:30 -05:00
.PHONY: all clean fclean re client_re client_clean client_fclean server_re server_clean server_fclean