blob: 7768692ad3677b8cea82c50563e6eb93407f13da (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
MESON := $(shell which meson 2>/dev/null)
NINJA := $(shell which ninja-build 2>/dev/null || which ninja 2>/dev/null)
ifneq ($(MESON),)
HOST := $(shell hostname -s)
BDIR := build-meson-$(HOST)
build: $(BDIR)/build.ninja
$(NINJA) -C $(BDIR)
install: build
$(NINJA) -C $(BDIR) install
clean:
rm -rf $(BDIR)
$(BDIR)/build.ninja:
$(MESON) $(BDIR)
else
CC ?= gcc
CFLAGS ?= -Os -g -std=c99
CFLAGS += -Wall
TARGETS := drminfo drmtest gtktest
drminfo : CFLAGS += $(shell pkg-config --cflags libdrm cairo pixman-1)
drminfo : LDLIBS += $(shell pkg-config --libs libdrm cairo pixman-1)
drmtest : CFLAGS += $(shell pkg-config --cflags libdrm gbm epoxy cairo pixman-1)
drmtest : LDLIBS += $(shell pkg-config --libs libdrm gbm epoxy cairo pixman-1)
drmtest : LDLIBS += -ljpeg
virtiotest : CFLAGS += $(shell pkg-config --cflags libdrm gbm epoxy cairo pixman-1)
virtiotest : LDLIBS += $(shell pkg-config --libs libdrm gbm epoxy cairo pixman-1)
virtiotest : LDLIBS += -ljpeg
gtktest : CFLAGS += $(shell pkg-config --cflags gtk+-3.0 cairo pixman-1)
gtktest : LDLIBS += $(shell pkg-config --libs gtk+-3.0 cairo pixman-1)
gtktest : LDLIBS += -ljpeg
all: $(TARGETS)
clean:
rm -f $(TARGETS)
rm -f *~ *.o
drminfo: drminfo.o drmtools.o
drmtest: drmtest.o drmtools.o ttytools.o render.o image.o
virtiotest: virtiotest.o drmtools.o ttytools.o render.o
gtktest: gtktest.o render.o image.o
endif
|