File: Makefile

package info (click to toggle)
dwz 0.13-5~bpo10+1
  • links: PTS
  • area: main
  • in suites: buster-backports
  • size: 1,564 kB
  • sloc: ansic: 13,097; asm: 1,745; exp: 1,210; sh: 919; makefile: 98; awk: 23
file content (109 lines) | stat: -rw-r--r-- 3,270 bytes parent folder | download
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
ifneq ($(srcdir),)
VPATH = $(srcdir)
else
srcdir=$(shell pwd)
endif
CFLAGS = -O2 -g
DWZ_VERSION := $(shell cat $(srcdir)/VERSION)
override CFLAGS += -Wall -W -D_FILE_OFFSET_BITS=64 \
	-DDWZ_VERSION='"$(DWZ_VERSION)"' $(shell cat $(srcdir)/COPYRIGHT_YEARS)
prefix = /usr
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datarootdir = $(prefix)/share
mandir = $(datarootdir)/man
OBJECTS = dwz.o hashtab.o sha1.o dwarfnames.o
dwz: $(OBJECTS)
	$(CC) $(LDFLAGS) -o $@ $^ -lelf
install: dwz
	install -D dwz $(DESTDIR)$(bindir)/dwz
	install -D -m 644 $(srcdir)/dwz.1 $(DESTDIR)$(mandir)/man1/dwz.1
clean:
	rm -f $(OBJECTS) *~ core* dwz $(TEST_EXECS) $(DWZ_TEST_SOURCES) \
	  dwz.log dwz.sum
	rm -Rf testsuite-bin tmp.*

PWD:=$(shell pwd -P)

TEST_SRC = $(srcdir)/testsuite/dwz.tests
TEST_EXECS_DWARF_ASM = no-multifile-prop
TEST_EXECS = hello dw2-restrict py-section-script dwz-for-test min two-typedef \
	dw2-skip-prologue start implptr-64bit-d2o4a8r8t0 hello-gold-gdb-index \
	start-gold hello-gnu-pubnames varval $(TEST_EXECS_DWARF_ASM)

hello:
	$(CC) $(TEST_SRC)/hello.c -o $@ -g

hello-gnu-pubnames:
	$(CC) $(TEST_SRC)/hello.c -o $@ -g -ggnu-pubnames || touch $@

dw2-restrict:
	$(CC) -no-pie $(TEST_SRC)/dw2-restrict.S -o $@ || touch $@

dw2-skip-prologue:
	$(CC) $(TEST_SRC)/dw2-skip-prologue.S $(TEST_SRC)/dw2-skip-prologue.c \
	  -DINLINED -DPTRBITS=64 -o $@ || touch $@

py-section-script:
	$(CC) $(TEST_SRC)/py-section-script.s -o $@ -g || touch $@

DWZ_TEST_SOURCES := $(patsubst %.o,%-for-test.c,$(OBJECTS))

%-for-test.c: %.c
	sed 's/__GNUC__/NOT_DEFINED/' $< > $@

dwz-for-test: $(DWZ_TEST_SOURCES)
	$(CC) $(DWZ_TEST_SOURCES) -O2 -g -lelf -o $@ -Wall -W -DDEVEL \
	  -D_FILE_OFFSET_BITS=64 -DDWZ_VERSION='"for-test"' -I$(srcdir) \
	  $(shell cat $(srcdir)/COPYRIGHT_YEARS)

min:
	$(CC) $(TEST_SRC)/min.c $(TEST_SRC)/min-2.c -o $@ -g

two-typedef:
	$(CC) $(TEST_SRC)/two-typedef.c $(TEST_SRC)/two-typedef-2.c \
	  -I $(TEST_SRC) -o $@ -g

start:
	$(CC) $(TEST_SRC)/start.c -o $@ -g -nostdlib

start-gold:
	$(CC) $(TEST_SRC)/start.c -fuse-ld=gold -o $@ -g -nostdlib || touch $@

implptr-64bit-d2o4a8r8t0:
	$(CC) $(TEST_SRC)/implptr-64bit-d2o4a8r8t0.S $(TEST_SRC)/main.c -o $@ \
	  -g || touch $@

hello-gold-gdb-index:
	$(CC) $(TEST_SRC)/hello.c -g -fuse-ld=gold -Wl,--gdb-index -o $@ \
	    || touch $@

varval:
	$(CC) $(TEST_SRC)/varval.c $(TEST_SRC)/varval.S -g -o $@ \
	    || touch $@

POINTER_SIZE:=$(shell $(CC) $(TEST_SRC)/pointer-size.c -o pointer-size; \
	./pointer-size; \
	rm -f ./pointer-size)

TEMP_ASM_FILES=$(addsuffix -dw.S, $(TEST_EXECS_DWARF_ASM))
.INTERMEDIATE: $(TEMP_ASM_FILES)

$(TEMP_ASM_FILES): %-dw.S: $(TEST_SRC)/../lib/%.exp
	export POINTER_SIZE=$(POINTER_SIZE); \
	  runtest --tool=dwz -srcdir $(srcdir)/testsuite/ lib/$*.exp

$(TEST_EXECS_DWARF_ASM): %: %-dw.S
	$(CC) $(TEST_SRC)/main.c $< -o $@

# On some systems we need to set and export DEJAGNU to suppress
# WARNING: Couldn't find the global config file.
DEJAGNU ?= /dev/null

check: dwz $(TEST_EXECS)
	mkdir -p testsuite-bin
	cd testsuite-bin; ln -sf $(PWD)/dwz .
	export DEJAGNU=$(DEJAGNU); \
	export PATH=$(PWD)/testsuite-bin:$$PATH; export LC_ALL=C; \
	runtest --tool=dwz -srcdir $(srcdir)/testsuite $(RUNTESTFLAGS)
	rm -Rf testsuite-bin $(TEST_EXECS) $(DWZ_TEST_SOURCES)