-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
39 lines (30 loc) · 705 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
SHELL=bash
CC=gcc
CPPFLAGS=
CFLAGS= -Wall -g
LIBS= -lGL
MODULES= svg path sprite gradient matrix
BINDIR= bin
EXES= t1
##---------------------------------------------------------------
OBJS= $(addsuffix .o, $(MODULES))
EXES:= $(addprefix $(BINDIR)/, $(EXES))
.PHONY: default
default: $(EXES)
## Executables
$(BINDIR)/%: test/%.o $(OBJS)
mkdir -p $(dir $@)
$(CC) -o $@ $^ $(LIBS)
## Auto-generate dependencies
## http://www.gnu.org/software/make/manual/html_node/Automatic-Prerequisites.html
##
%.dep: %.c
$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< > $@'
-include $(OBJS:.o=.dep)
.PHONY: clean
clean:
rm -f *.o *.dep $(EXES)
# Statistics
.PHONY: stats
stats:
cloc . --exclude-dir=.git,test,bin