summaryrefslogtreecommitdiff
path: root/debian/rules
blob: e36a32e3a36714af002ac4a058c766b29cd9882d (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

shared = libdwarf.so.0

#!/usr/bin/make -f

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	dh_autoreconf autoreconf --  -i -f \
		libdwarf

override_dh_auto_build:
	# configure and build shared library
	cd libdwarf && ./configure --enable-shared --disable-nonshared CFLAGS="$(CFLAGS) -DELF_TARGET_ALL=1"
	cd libdwarf && make $(shared) && cp $(shared) ../ && make distclean
	# configure and build library
	cd libdwarf; ./configure --prefix=$(CURDIR)/debian/libdwarf-dev CFLAGS="$(CFLAGS) -DELF_TARGET_ALL=1"
	cd libdwarf; make
	# We will link to shared library:
	ln -sf ../$(shared) libdwarf/libdwarf.so
	# configure and build dwarfdump
	cd dwarfdump; ./configure --prefix=$(CURDIR)/debian/dwarfdump
	cd dwarfdump; LD_LIBRARY_PATH=../libdwarf  make
	# configure and build dwarfdump2
	cd dwarfdump2; ./configure --prefix=$(CURDIR)/debian/dwarfdump2
	cd dwarfdump2; LD_LIBRARY_PATH=../libdwarf  make
	dh_auto_build

override_dh_auto_clean:
	rm -f libdwarf.so.*
	rm -f libdwarf/libdwarf.so*
	# configure and build library
	cd libdwarf; ./configure --prefix=$(CURDIR)/debian/libdwarf-dev || true
	cd libdwarf; make distclean || true
	# configure and build dwarfdump
	cd dwarfdump; ./configure --prefix=$(CURDIR)/debian/dwarfdump
	cd dwarfdump; make distclean
	# configure and build dwarfdump2
	cd dwarfdump2; ./configure --prefix=$(CURDIR)/debian/dwarfdump2
	cd dwarfdump2; make distclean
	dh_auto_clean

override_dh_auto_install:
	mkdir -p $(CURDIR)/debian/libdwarf0/usr/lib/$(DEB_HOST_MULTIARCH)
	mkdir -p $(CURDIR)/debian/libdwarf-dev/usr/lib/$(DEB_HOST_MULTIARCH)
	cp $(shared) $(CURDIR)/debian/libdwarf0/usr/lib/$(DEB_HOST_MULTIARCH)/
	ln -sf $(shared) $(CURDIR)/debian/libdwarf-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libdwarf.so
	cp libdwarf/libdwarf.a $(CURDIR)/debian/libdwarf-dev/usr/lib/$(DEB_HOST_MULTIARCH)/
	cp libdwarf/dwarf.h libdwarf/libdwarf.h $(CURDIR)/debian/libdwarf-dev/usr/include/
	cp libdwarf/*.pdf $(CURDIR)/debian/libdwarf-dev/usr/share/doc/libdwarf-dev
	cp libdwarf/[NR]* $(CURDIR)/debian/libdwarf-dev/usr/share/doc/libdwarf-dev
	/bin/gzip -9 < libdwarf/ChangeLog > $(CURDIR)/debian/libdwarf-dev/usr/share/doc/libdwarf-dev/changelog.gz
	/bin/gzip -9 < libdwarf/ChangeLog2008 > $(CURDIR)/debian/libdwarf-dev/usr/share/doc/libdwarf-dev/changelog2008.gz
	/bin/gzip -9 < libdwarf/ChangeLog2007 > $(CURDIR)/debian/libdwarf-dev/usr/share/doc/libdwarf-dev/changelog2007.gz
	/bin/gzip -9 < libdwarf/ChangeLog2006 > $(CURDIR)/debian/libdwarf-dev/usr/share/doc/libdwarf-dev/changelog2006.gz
	cp dwarfexample/*  $(CURDIR)/debian/libdwarf-dev/usr/share/doc/libdwarf-dev/examples/
	cp dwarfdump2/dwarfdump $(CURDIR)/debian/dwarfdump/usr/bin/
	/bin/gzip -9 < dwarfdump2/dwarfdump.1 > $(CURDIR)/debian/dwarfdump/usr/share/man/man1/dwarfdump.1.gz
	/bin/gzip -9 < dwarfdump/README > $(CURDIR)/debian/dwarfdump/usr/share/doc/dwarfdump/README.gz
	/bin/gzip -9 < dwarfdump/ChangeLog > $(CURDIR)/debian/dwarfdump/usr/share/doc/dwarfdump/changelog.gz
	cp dwarfdump2/dwarfdump.conf $(CURDIR)/debian/dwarfdump/usr/share/doc/dwarfdump/examples/dwarfdump.conf
	dh_auto_install

override_dh_install:
	# everything is installed

override_dh_auto_test:
	# dwarfutils does not provide a testsuite