-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
36 lines (27 loc) · 869 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
CC=gcc
PACKAGES=librsvg-2.0 pangocairo cairo xi x11 x11-xcb xcb xcb-icccm xcb-damage gl glu glew xrender xcomposite xtst xdamage xext xfixes xrandr
ifeq ($(GLASS_PROFILE),1)
PROFILE_CFLAGS:=-pg
else
PROFILE_CFLAGS:=
endif
CFLAGS=-rdynamic -g -ggdb $(shell pkg-config --cflags $(PACKAGES)) -O0 -Wall $(PROFILE_CFLAGS) $(EXTRA_CFLAGS)
LIBS:=-ldl $(shell pkg-config --libs $(PACKAGES))
ifeq ($(GLASS_DMALLOC),)
else
LIBS:=$(LIBS) -ldmalloc
endif
ifndef GLASS_USE_BACKTRACE
else
LIBS:=$(LIBS) -lbacktrace
CFLAGS:=$(CFLAGS) -DUSE_BACKTRACE
endif
BUILD=../build
BINDIR=../build/env/bin
all: $(BINDIR)/glass-renderer
$(BUILD)/%.o: %.c *.h
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BINDIR)/glass-renderer: $(patsubst %.c,$(BUILD)/%.o, $(wildcard *.c))
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -o $@ $(patsubst %.c,$(BUILD)/%.o, $(wildcard *.c)) $(LIBS)