aboutsummaryrefslogtreecommitdiff
path: root/philo_one/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'philo_one/Makefile')
-rw-r--r--philo_one/Makefile27
1 files changed, 10 insertions, 17 deletions
diff --git a/philo_one/Makefile b/philo_one/Makefile
index 0026516..44638f5 100644
--- a/philo_one/Makefile
+++ b/philo_one/Makefile
@@ -6,39 +6,38 @@
# By: cacharle <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/11/24 05:50:15 by cacharle #+# #+# #
-# Updated: 2021/01/01 15:18:11 by charles ### ########.fr #
+# Updated: 2021/01/03 14:38:19 by cacharle ### ########.fr #
# #
# **************************************************************************** #
RM = rm -f
MAKE = make --no-print-directory
-COMMONDIR = ../common
-
CC = gcc
-CCFLAGS = -I$(COMMONDIR) -O2 -std=c99 -Wall -Wextra -Werror
-LDFLAGS = -lpthread -L$(COMMONDIR) -lphilocommon
+CCFLAGS = -I. -O2 -std=c99 -Wall -Wextra -Werror
+LDFLAGS = -lpthread
NAME = philo_one
SRCDIR = src
OBJDIR = obj
-SRC = $(shell find $(SRCDIR) -type f -name '*.c')
-OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
+SRC = args.c helper.c io.c \
+ src/event.c src/forks.c src/main.c src/philo.c src/routine.c
+OBJ = $(SRC:%.c=%.o)
all: prebuild $(NAME)
prebuild:
@mkdir -pv $(OBJDIR)
-$(NAME): common_all $(OBJ)
+$(NAME): $(OBJ)
$(CC) -o $@ $(OBJ) $(LDFLAGS)
-$(OBJDIR)/%.o: $(SRCDIR)/%.c
+%.o: %.c
$(CC) $(CCFLAGS) -c -o $@ $<
-clean: common_clean
+clean:
$(RM) $(OBJ)
fclean: clean
@@ -46,10 +45,4 @@ fclean: clean
re: fclean all
-common_all:
- $(MAKE) -C $(COMMONDIR) all
-
-common_clean:
- $(MAKE) -C $(COMMONDIR) clean
-
-.PHONY: all prebuild clean fclean re common_all common_clean
+.PHONY: all prebuild clean fclean re