-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (27 loc) · 807 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
34
35
36
37
38
39
40
## ---------------------------------------------------------------------
## Configurable section
# CPPFLAGS = -DDEBUG -DFILLERS
CPPFLAGS = -DFILLERS
CFLAGS = -g -Wall -Wextra
# CFLAGS = -O3 -Wall -Wextra
LDFLAGS = -rdynamic
LDLIBS = -ldl
PROG = under
SRC = iteratee.c decoder.c encoder.c codec.c under.c util.c repr.c buffer.c
## ---------------------------------------------------------------------
## The stuff below is not supposed to be touched frequently
SHELL = /bin/sh
all: $(PROG)
OBJ := $(SRC:.c=.o)
-include $(OBJ:.o=.d)
# Generate dependencies
%.d: %.c
cpp -MM $(CPPFLAGS) $< |\
sed -r 's%^(.+)\.o:%$(@D)/\1.d $(@D)/\1.o:%' >$@
$(PROG): $(OBJ)
$(CC) $(LDFLAGS) $(LDLIBS) $^ -o $@
mostlyclean:
rm -f $(OBJ) $(OBJ:.o=.d)
clean: mostlyclean
rm -f $(PROG)
.PHONY: mostlyclean clean