-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (29 loc) · 812 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
41
# Makefile
CFLAGS = -O2 -march=core2 -Wall
CC = gcc-4.2
EXTRA_CFLAGS = -pthread -std=c99 -I. -Wno-int-to-pointer-cast \
-Wno-pointer-to-int-cast
EXTRA_LDFLAGS = -pthread
SOURCES = main.c ice.c pbm.c queue.c
OBJECTS = $(SOURCES:.c=.o)
CLEAN_FILES = $(OBJECTS) ice
ice: $(OBJECTS)
$(CC) $(EXTRA_LDFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
%.o: %.c Makefile
$(CC) $(EXTRA_CFLAGS) $(CFLAGS) -c $< -o $@
# Dependencies {{{
.deps/%.d: %.c $(global_deps)
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
$(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \
sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
DEPS := $(SOURCES:%.c=.deps/%.d)
-include $(DEPS)
# }}}
include tests.mk
.PHONY: all
all: ice
.PHONY: clean
clean:
rm -f $(CLEAN_FILES)
# vim: set fdm=marker