aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: cf55cc2ac896ff28118716b2993a0b22e5a56f52 (plain)
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
SRC = $(wildcard src/*.c)
OBJ = $(SRC:.c=.o)
BIN = comet.bin

PCDEP = xcb \
		xcb-aux \
		xcb-icccm \
		xcb-ewmh \
		xcb-xrm \
		xcb-shape \
		xcb-errors \
		"xcb-randr >= 1.5" \
		pangocairo

CFLAGS  := $(shell pkg-config --cflags $(PCDEP)) -Wall -Werror $(CFLAGS)
LDFLAGS := $(shell pkg-config --libs $(PCDEP)) -lm $(LDFLAGS)

ifdef RELEASE
CFLAGS  += -O2 -DRELEASE=1
else
CFLAGS  += -ggdb
endif

all: $(BIN)

$(BIN): $(OBJ)
	$(CC) -o $@ $(LDFLAGS) $^

%.o: %.c
	$(CC) -o $@ -c $(CFLAGS) $^

clean:
	rm -rf $(BIN) $(OBJ)

valgrind: $(BIN)
	valgrind --leak-check=full --track-origins=yes --suppressions=valgrind.supp ./$(BIN)

# vim: ts=4 sw=4