aboutsummaryrefslogtreecommitdiff
path: root/vendor/_unity/Makefile
blob: d9700ea532466378844e993b6884ddbfae4e8031 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# **************************************************************************** #
#                                                                              #
#                                                         :::      ::::::::    #
#    Makefile                                           :+:      :+:    :+:    #
#                                                     +:+ +:+         +:+      #
#    By: cacharle <marvin@42.fr>                    +#+  +:+       +#+         #
#                                                 +#+#+#+#+#+   +#+            #
#    Created: 2020/01/31 07:27:12 by cacharle          #+#    #+#              #
#    Updated: 2020/01/31 08:39:24 by cacharle         ###   ########.fr        #
#                                                                              #
# **************************************************************************** #

CC = gcc
CCFLAGS = -Iinclude -Wall -Wextra -Werror

NAME = libunity.a

INCLUDE = $(shell find include -type f -name "*.h")
SRC = $(shell find src -type f -name "*.c")
OBJ = $(SRC:.c=.o)

.PHONY: all
all: $(NAME)

$(NAME): $(OBJ)
	@echo "Unity: Linking: $@"
	@ar rcs $@ $^

%.o: %.c $(INCLUDE)
	@echo "Unity: Compiling: $@"
	@$(CC) $(CCFLAGS) -c -o $@ $<

clean:
	@echo "Unity: Removing objects"
	@rm -f $(OBJ)

fclean: clean
	@echo "Unity: Removing: $(NAME)"
	@rm -f $(NAME)

re: fclean all