-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (28 loc) · 658 Bytes
/
Makefile
File metadata and controls
38 lines (28 loc) · 658 Bytes
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
EXECBIN = httpserver
SOURCES = $(wildcard *.c)
HEADERS = $(wildcard *.h)
OBJECTS = $(SOURCES:%.c=%.o)
LIBRARY = asgn4_helper_funcs.a
FORMATS = $(SOURCES:%.c=.format/%.c.fmt) $(HEADERS:%.h=.format/%.h.fmt)
CC = clang
FORMAT = clang-format
CFLAGS = -Wall -Wpedantic -Werror -Wextra -DDEBUG
.PHONY: all clean format
all: $(EXECBIN)
$(EXECBIN): $(OBJECTS) $(LIBRARY)
$(CC) -o $@ $^
%.o : %.c %.h
$(CC) $(CFLAGS) -c $<
clean:
rm -f $(EXECBIN) $(OBJECTS)
nuke: clean
rm -rf .format
format: $(FORMATS)
.format/%.c.fmt: %.c
mkdir -p .format
$(FORMAT) -i $<
touch $@
.format/%.h.fmt: %.h
mkdir -p .format
$(FORMAT) -i $<
touch $@