-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
36 lines (26 loc) · 889 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
# GTK+-3 introduced the native GtkGLArea in 3.16.
# Check that we have at least that version:
ifneq ($(shell pkg-config --atleast-version=3.16 gtk+-3.0 && echo 1 || echo 0),1)
$(error $(shell pkg-config --print-errors --atleast-version=3.16 gtk+-3.0))
endif
BIN = gtk3-opengl
CFLAGS += -std=c99 -DGL_GLEXT_PROTOTYPES
CFLAGS += $(shell pkg-config --cflags gtk+-3.0 gl)
LIBS += $(shell pkg-config --libs gtk+-3.0 gl)
LIBS += -lm
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.glsl,%.o,$(wildcard shaders/*/*.glsl))
OBJS += $(patsubst %.svg,%.o,$(wildcard textures/*.svg))
.PHONY: clean
$(BIN): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
textures/%.png: textures/%.svg
rsvg-convert --format png --output $@ $^
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $^
%.o: %.glsl
$(LD) -r -b binary -o $@ $^
%.o: %.png
$(LD) -r -b binary -o $@ $^
clean:
$(RM) $(BIN) $(OBJS)