Files
42test/libft/Makefile
2021-10-22 21:28:52 +00:00

93 lines
2.7 KiB
Makefile

# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/10/22 09:10:00 by gbaconni #+# #+# #
# Updated: 2021/10/22 21:24:29 by gbaconni ### ########.fr #
# #
# **************************************************************************** #
#
# 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
help:
@echo "a: nemequ/µnit"
@echo "b: Tripouille/libftTester"
@echo "c: jtoty/Libftest"
@echo "d: alelievr/libft-unit-test"
@echo "test: a b c d"
@echo "update: git pull"
a: update compile
@./$(OUT) || true
b: compile
@grep -q 'update message' libftTester/Makefile && sed -i'.orig' -e 's/update \(message\)/\1/g' libftTester/Makefile || true
@grep -q '/libft$$' libftTester/Makefile || sed -i'.orig' -e 's/^\(PARENT_DIR.*\)/\1\/libft/' libftTester/Makefile || true
@make -C libftTester m || true
@make -C libftTester b || true
c: compile
@test -f Libftest/my_config.sh || (cd Libftest && ./grademe.sh >/dev/null 2>&1) || true
@grep -q '^PATH_LIBFT=\.\./libft' Libftest/my_config.sh || sed -i'.orig' -e 's/^\(PATH_LIBFT\)=.*/\1=..\/libft/' Libftest/my_config.sh || true
@grep -q "'ft_memccpy'" Libftest/srcs/variables/functions/part_1.sh && sed -i'.orig' -e "/'ft_memccpy'/d" Libftest/srcs/variables/functions/part_1.sh || true
@rm -fr Libftest/tests/Part1_functions/ft_memccpy || true
@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."
update:
@git pull
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 libftTester clean || true
@make -C libft-unit-test clean || true
@make -C $(LIBDIR) fclean
@$(RM) $(RMFLAGS) $(OUT)
re: fclean all