-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (26 loc) · 1.38 KB
/
Makefile
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lpaulo-m <lpaulo-m@student.42sp.org.br> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/12/25 22:59:46 by lpaulo-m #+# #+# #
# Updated: 2020/12/26 14:12:19 by lpaulo-m ### ########.fr #
# #
# **************************************************************************** #
CC = cc
CCFLAGS = -Wall -Wextra -Werror -pedantic -std=c99
TARGET = kilo
MAIN = $(addsuffix .o, $(TARGET) )
SOURCES = kilo.c src/errors.c src/tty_config.c src/tty_utilities.c src/editor.c src/editor_utilities.c
OBJECTS = $(subst .c,.o,$(SOURCES))
DEPENDENCIES = includes/kilo.h
.PHONY: all clean
all: $(TARGET)
clean:
rm -f $(TARGET) $(OBJECTS)
$(OBJECTS): %.o : %.c $(DEPENDENCIES)
$(CC) -c -o $@ $< $(CCFLAGS)
$(TARGET): % : $(filter-out $(MAIN), $(OBJECTS)) %.o
$(CC) -o $@ $(LIBS) $^ $(CCFLAGS) $(LDFLAGS)