-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (25 loc) · 678 Bytes
/
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
CC = gcc
FLAGS = --std=c99 -O3 -pedantic -Wall -Wextra -Werror -Wshadow \
-Wstrict-prototypes -Wmissing-prototypes -Wcast-align -Winline \
-Wfloat-equal -Wconversion -Wundef -Wno-newline-eof
LIBS =
TARGET = cfbf
SRC = src/
OUTPUT = bin/
.PHONY: default all clean
default: $(TARGET)
all: default
OBJECTS = $(patsubst %.c, %.o, $(wildcard $(SRC)*.c))
HEADERS = $(wildcard $(SRC)*.h)
%.o: %.c $(HEADERS)
$(CC) $(FLAGS) -c $< -o $@
.PRECIOUS: $(TARGET) $(OBJECTS)
$(TARGET): $(OBJECTS) | $(OUTPUT)
$(CC) $(OBJECTS) $(FLAGS) $(LIBS) -o $(OUTPUT)$@
$(OUTPUT):
@echo "Creating $(OUTPUT)"
@mkdir -p $@
clean:
@echo "Cleaning"
-rm -f $(SRC)*.o
-rm -f $(OUTPUT)$(TARGET)