0
0
This commit is contained in:
Guy Baconniere
2021-08-21 19:03:19 +02:00
parent 681c2242b9
commit ea62cdfc05
16 changed files with 522 additions and 0 deletions

View File

@@ -0,0 +1,89 @@
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/08/21 11:01:00 by gbaconni #+# #+# #
# Updated: 2021/08/21 18:07:23 by gbaconni ### ########.fr #
# #
# **************************************************************************** #
#
# make rush-02
# make fclean
# make
#
NAME = "rush-02"
DICT = "numbers.dict"
SRC = rush-02.c
HDR = ft/ft.h
CC = cc
CFLAGS = -Wall -Wextra -Werror
AR = ar
ARFLAGS = -cvq
FTDIR = ft
FTLIB = ft
all: $(NAME)
@echo "That's all Forks!"
$(NAME): compile
clean:
@echo "Cleanning all objects"
@/bin/rm -f *.o **/*.o
@/bin/rm -f *.a **/*.a
fclean: clean
@echo "Cleanning $(NAME)"
@/bin/rm -f "$(NAME)"
re: fclean all
norminette:
@norminette -R CheckDefine **/*.h
@norminette -R CheckForbiddenSourceHeader **/*.c
macro:
@cpp $(SRC)
compile-ft:
@echo "Compiling $(FTLIB)"
@cd ft && $(CC) $(CFLAGS) -c *.c
@cd ft && $(AR) $(ARFLAGS) lib$(FTLIB).a *.o
@cd ft && $(AR) -t lib$(FTLIB).a
compile: compile-ft
@echo "Compiling $(NAME) w/ $(SRC)"
$(CC) $(CFLAGS) -o $(NAME) -L$(FTDIR) -l$(FTLIB) $(SRC)
@chmod +x $(NAME)
test:
@echo "Running Test Suite"
@echo "Expected: forty two"
./$(NAME) 42 | cat -e
@echo "Expected: zero"
./$(NAME) 0 | cat -e
@echo "Expected: error"
./$(NAME) 10.4 | cat -e
@echo "Expected: one hundred thousand"
./$(NAME) 100000 | cat -e
@echo "Expected: 20 : hey everybody !"
grep "20" $(DICT) | cat -e
@echo "Expected: hey everybody !"
./$(NAME) 20 | cat -e
git-clone:
@git clone git@vogsphere.42lausanne.ch:vogsphere/intra-uuid-43aa272e-0de1-4199-8bd8-51ca85234f84-3736481 .
@grep -o 'git@.*' .git/config
git: git-clone