SRC = $(shell find src/ -name '*.c') OBJ = $(SRC:.c=.o) BIN = comet 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