48 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
# **************************************************************************** #
 | 
						|
#                                                                              #
 | 
						|
#                                                         :::      ::::::::    #
 | 
						|
#    Makefile                                           :+:      :+:    :+:    #
 | 
						|
#                                                     +:+ +:+         +:+      #
 | 
						|
#    By: achubuko <marvin@42.fr>                    +#+  +:+       +#+         #
 | 
						|
#                                                 +#+#+#+#+#+   +#+            #
 | 
						|
#    Created: 2023/12/02 22:04:03 by achubuko          #+#    #+#              #
 | 
						|
#    Updated: 2023/12/02 23:31:12 by achubuko         ###   ########.fr        #
 | 
						|
#                                                                              #
 | 
						|
# **************************************************************************** #
 | 
						|
NAME := test_ft_utils
 | 
						|
_CFLAGS = -Wall -Wextra -Werror
 | 
						|
CFLAGS = -g
 | 
						|
CFLAGS := $(_CFLAGS) $(CFLAGS) -I../ex00 -I../contrib/Unity/src/
 | 
						|
 | 
						|
# all: default rule
 | 
						|
# prerequisite is not mandatory
 | 
						|
all: $(NAME) run
 | 
						|
 | 
						|
# clean: Delete *.o for project and libraries
 | 
						|
clean:
 | 
						|
	rm -rdf $(wildcard ./*.o)
 | 
						|
 | 
						|
# fclean: Delete *.o files and delete named executable
 | 
						|
fclean: clean
 | 
						|
	rm -f $(NAME)
 | 
						|
 | 
						|
# re: full clean and recompilation
 | 
						|
re: fclean all
 | 
						|
 | 
						|
# these targets are not backed by files, therefore, always run when called
 | 
						|
.PHONY: all clean fclean re purge norme run
 | 
						|
#####################################
 | 
						|
########## PROJECT RULES ############
 | 
						|
#####################################
 | 
						|
run: $(NAME)
 | 
						|
	$(foreach t,$^,./$t;)
 | 
						|
 | 
						|
%.o: %.c %.h
 | 
						|
	$(CC) $(CFLAGS) -c -o $@ $<
 | 
						|
%.o: %.c
 | 
						|
	$(CC) $(CFLAGS) -c -o $@ $<
 | 
						|
 | 
						|
# build test unit executable
 | 
						|
test_%: test_%.o ../ex00/%.o ../contrib/Unity/src/unity.o
 | 
						|
	$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
 |