summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0939aee
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+CC = gcc
+LD = gcc
+CFLAGS = -Wall -Wextra -Werror
+LDFLAGS = -Llibft -lft
+NAME = server
+
+all: client server
+
+bonus: client_bonus server_bonus
+
+$(NAME): libft/libft.a server.o
+ $(LD) -o $@ server.o $(LDFLAGS)
+
+client: libft/libft.a client.o
+ $(LD) -o $@ client.o $(LDFLAGS)
+
+server_bonus: libft/libft.a server_bonus.o
+ $(LD) -o $@ server_bonus.o $(LDFLAGS)
+
+client_bonus: libft/libft.a client_bonus.o
+ $(LD) -o $@ client_bonus.o $(LDFLAGS)
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+libft/libft.a:
+ make -C libft
+
+clean:
+ rm -f server.o client.o server_bonus.o client_bonus.o
+ make -C libft clean
+
+fclean: clean
+ rm -f server client server_bonus client_bonus
+ make -C libft fclean
+
+re:
+ make fclean
+ make all
+ make -C libft re
+
+.PHONY: all bonus clean fclean re