Files
42test/libft/Makefile

79 lines
2.1 KiB
Makefile
Raw Normal View History

2021-10-22 10:26:25 +02:00
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/10/22 09:10:00 by gbaconni #+# #+# #
2021-10-22 11:23:07 +02:00
# Updated: 2021/10/22 11:22:52 by gbaconni ### ########.fr #
2021-10-22 10:26:25 +02:00
# #
# **************************************************************************** #
#
# make munit.out
# make all
# make clean
# make fclean
# make re
# make
#
OUT = munit.out
LIBDIR = libft
LIB = ft
HDRDIR = munit
HDR = $(HDRDIR)/munit.h
SRCDIR = .
SRC = \
$(SRCDIR)/munit.c \
$(HDRDIR)/munit.c
CC = gcc
CFLAGS = -Wall -Wextra -Werror -O1
RM = rm
RMFLAGS = -f
all: compile test
a: compile
@./$(OUT) || true
b: compile
2021-10-22 11:07:32 +02:00
@grep -q 'update message' libftTester/Makefile || sed -i '' -r 's/update (message)/\1/g' libftTester/Makefile
2021-10-22 10:26:25 +02:00
@grep -q '/libft$$' libftTester/Makefile || sed -i '' -r 's/^(PARENT_DIR.*)/\1\/libft/' libftTester/Makefile
@make -C libftTester m || true
@make -C libftTester b || true
c: compile
2021-10-22 11:23:07 +02:00
@make -C Libftest clean || true
2021-10-22 10:26:25 +02:00
@make -C Libftest all || true
@grep -q '^PATH_LIBFT=\.\./libft' Libftest/my_config.sh || sed -i '' -r 's/^(PATH_LIBFT)=.*/\1=..\/libft/' Libftest/my_config.sh
@cd Libftest && ./grademe.sh || true
d: compile
@make -C libft-unit-test all || true
@cd libft-unit-test && ./run_test || true
test: a b c d
@echo "done."
compile:
@make -C $(LIBDIR) all
@$(CC) $(CFLAGS) $(SRC) -I${LIBDIR} -I$(HDRDIR) -L${LIBDIR} -l${LIB} -o $(OUT)
clean:
@make -C $(LIBDIR) clean
@$(RM) $(RMFLAGS) $(OUT)
fclean: clean
@make -C $(LIBDIR) fclean
@$(RM) $(RMFLAGS) $(OUT)
re: fclean all