diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-29 16:16:20 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-29 16:16:20 +0200 |
| commit | b6f4db572d7d40c178ec286373422faa2172f135 (patch) | |
| tree | 03fd9601de99de8111994f487cfdacc7127ce6d0 /philo_two/Makefile | |
| parent | 6bfcd3c6f921e7717e61167b291bb27bd3f66386 (diff) | |
| download | philosophers-b6f4db572d7d40c178ec286373422faa2172f135.tar.gz philosophers-b6f4db572d7d40c178ec286373422faa2172f135.tar.bz2 philosophers-b6f4db572d7d40c178ec286373422faa2172f135.zip | |
philo_two file restructuration
Diffstat (limited to 'philo_two/Makefile')
| -rw-r--r-- | philo_two/Makefile | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/philo_two/Makefile b/philo_two/Makefile index 53c06f4..b1cd2ed 100644 --- a/philo_two/Makefile +++ b/philo_two/Makefile @@ -6,35 +6,38 @@ # By: cacharle <marvin@42.fr> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/11/24 05:50:15 by cacharle #+# #+# # -# Updated: 2020/02/14 23:37:39 by cacharle ### ########.fr # +# Updated: 2020/09/29 15:21:43 by cacharle ### ########.fr # # # # **************************************************************************** # RM = rm -f -COMMON_DIR = ../common +# COMMON_DIR = ../common CC = gcc -CCFLAGS = -I$(COMMON_DIR) -Wall -Wextra #-Werror -LDFLAGS = -lpthread -L$(COMMON_DIR) -lphilocommon +CCFLAGS = -Wall -Wextra #-I$(COMMON_DIR) -Werror +LDFLAGS = -lpthread #-L$(COMMON_DIR) -lphilocommon NAME = philo_two -SRC = main.c \ - io.c \ - routine.c +SRCDIR = src +OBJDIR = obj -OBJ = $(SRC:.c=.o) +SRC = $(shell find $(SRCDIR) -type f -name '*.c') +OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o) -all: $(NAME) +all: prebuild $(NAME) -$(NAME): common_all $(OBJ) +prebuild: + @mkdir -p $(OBJDIR) + +$(NAME): $(OBJ) $(CC) $(LDFLAGS) -o $@ $(OBJ) -%.o: %.c +$(OBJDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CCFLAGS) -c -o $@ $< -clean: common_fclean +clean: $(RM) $(OBJ) fclean: clean @@ -42,8 +45,8 @@ fclean: clean re: fclean all -common_all: - make -C $(COMMON_DIR) all - -common_fclean: - make -C $(COMMON_DIR) fclean +# common_all: +# make -C $(COMMON_DIR) all +# +# common_fclean: +# make -C $(COMMON_DIR) fclean |
