-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (55 loc) · 2.19 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
pkgconfig :=pkg-config
prefix :=/usr/local
bindir :=$(prefix)/bin
sbindir :=$(prefix)/sbin
crashdir :=/var/crash
udevrulesdir :=/etc/udev/rules.d/
unpackdir :=/tmp
etnaviv_dir :=/shared/etna_viv
etnaviv_inc :=$(etnaviv_dir)/src/etnaviv
libdrm_cflags :=$(shell $(pkgconfig) --cflags libdrm)
libdrm_ldflags :=$(shell $(pkgconfig) --libs libdrm)
CPPFLAGS :=-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -Iinclude
CFLAGS_COMMON :=-O2 -Wall -std=c99
CFLAGS =$(CFLAGS_COMMON) $(CFLAGS_$(notdir $@))
LDLIBS =$(LDLIBS_$(notdir $@))
SED :=sed
SEDARGS :=s|@sbindir@|$(sbindir)|g;s|@crashdir@|$(crashdir)|g;s|@unpackdir@|$(unpackdir)|g
BINPROGS :=bin2img detile/viv-demultitile diff/viv-cmd-diff info/viv_info
SBINPROGS :=dump/viv-unpack udev/devcoredump
UDEVRULES :=udev/99-local-devcoredump.rules
PROGS :=$(BINPROGS) $(SBINPROGS) $(UDEVRULES)
all: $(PROGS)
install: all
install -m 755 -o root -g root $(SBINPROGS) $(sbindir)
install -m 644 -o root -g root $(UDEVRULES) $(udevrulesdir)
install -m 755 -o root -g root $(BINPROGS) $(bindir)
uninstall:
$(RM) $(patsubst %,$(sbindir)/%,$(notdir $(SBINPROGS)))
$(RM) $(patsubst %,$(udevrulesdir)/%,$(notdir $(UDEVRULES)))
$(RM) $(patsubst %,$(bindir)/%,$(notdir $(BINPROGS)))
clean:
$(RM) $(PROGS) *.[oas] */*.[oas]
%: %.in
$(SED) "$(SEDARGS)" $< > $@
info/features.h: include/hw/common.xml.h
{ \
for n in chipFeatures chipMinorFeatures0 chipMinorFeatures1 chipMinorFeatures2 chipMinorFeatures3 chipMinorFeatures4 chipMinorFeatures5; do \
echo "static struct feature vivante_$${n}[] __maybe_unused = {"; \
echo "#define FEATURE(x) { $${n}_##x, #x }"; \
sed -n "s/#define $${n}_\([^[:space:]]*\).*/\tFEATURE(\1),/p" $<; \
echo "#undef FEATURE"; \
echo "};"; \
done; \
} > $@
detile/viv-demultitile.o: detile/viv-demultitile.c
detile/viv-demultitile: detile/viv-demultitile.o
diff/viv-cmd-diff.o: diff/viv-cmd-diff.c include/hw/state.xml.h
diff/viv-cmd-diff: diff/viv-cmd-diff.o
dump/viv-unpack.o: dump/viv-unpack.c \
include/hw/state.xml.h include/etnaviv_dump.h
dump/viv-unpack: dump/viv-unpack.o
LDLIBS_viv_info :=$(libdrm_ldflags)
info/viv_info: info/viv_info.o
CFLAGS_viv_info.o :=$(libdrm_cflags)
info/viv_info.o: info/viv_info.c info/features.h include/etnaviv_drm.h