blob: 4646e177d5ef180c9898cee39d4a4238ea5ce932 [file] [log] [blame]
Wichert Akkermand321ff92002-03-31 18:45:45 +00001#! /usr/bin/make -f
2
3# Debian package information
4package = strace
5
Roland McGrathc9b624f2004-08-31 08:40:50 +00006DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
Wichert Akkermand321ff92002-03-31 18:45:45 +00007
Roland McGrathc9b624f2004-08-31 08:40:50 +00008ifeq ($(DEB_HOST_GNU_TYPE),sparc-linux)
9 build64 = yes
10 HOST64 = sparc64-linux
11 CC64 = gcc -m64
12endif
13
14ifeq ($(build64),yes)
15 extra_build_targets += stamp-build64
16endif
17
18all build: stamp-build
19
20stamp-%: %/Makefile
21 $(MAKE) -C $*
22 touch $@
23
24build/Makefile:
25 mkdir -p $(@D)
26 cd $(@D); sh ../configure --prefix=/usr
27
28build64/Makefile:
29 mkdir -p $(@D)
30 cd $(@D); CC="$(CC64)" sh ../configure --prefix=/usr --build=$(HOST64)
31
Wichert Akkermand321ff92002-03-31 18:45:45 +000032clean:
Wichert Akkermand321ff92002-03-31 18:45:45 +000033 rm -rf debian/tmp debian/substvars debian/files
Roland McGrathc9b624f2004-08-31 08:40:50 +000034 rm -rf build64 stamp-build64
35 rm -rf build stamp-build
Wichert Akkermand321ff92002-03-31 18:45:45 +000036
37binary: binary-indep binary-arch
38
39binary-indep:
40
Roland McGrathc9b624f2004-08-31 08:40:50 +000041binary-arch: $(extra_build_targets) build checkroot
Wichert Akkermand321ff92002-03-31 18:45:45 +000042 test -f stamp-build || make $(MFLAGS) -f debian/rules build
43 -rm -rf debian/tmp debian/files debian/substvars
44
45 install -d -m 755 -o root -g root debian/tmp
46 # reset the mode to work around a bug in install
47 chown 755 debian/tmp
48 install -d -m 755 -o root -g root debian/tmp/DEBIAN
49
50# Install documentation
51 install -d -o root -g root -m 755 debian/tmp/usr/share/doc/$(package)
52 install -p -o root -g root -m 644 debian/changelog \
53 debian/tmp/usr/share/doc/$(package)/changelog.Debian
54 install -p -o root -g root -m 644 TODO \
55 debian/tmp/usr/share/doc/$(package)/TODO
56 install -p -o root -g root -m 644 NEWS \
57 debian/tmp/usr/share/doc/$(package)/changelog
58 gzip -9 debian/tmp/usr/share/doc/$(package)/*
59 install -p -o root -g root -m 644 debian/copyright \
60 debian/tmp/usr/share/doc/$(package)/copyright
61
62# Install strace
63 install -d -o root -g root -m 755 debian/tmp/usr/bin debian/tmp/usr/share/man/man1
Roland McGrathc9b624f2004-08-31 08:40:50 +000064 install -s -o root -g root -m 755 build/strace debian/tmp/usr/bin/strace
Wichert Akkermand321ff92002-03-31 18:45:45 +000065 install -p -o root -g root -m 644 strace.1 debian/tmp/usr/share/man/man1/strace.1
66 gzip -9 debian/tmp/usr/share/man/man1/strace.1
67
Roland McGrathc9b624f2004-08-31 08:40:50 +000068ifeq ($(build64),yes)
69 install -s -o root -g root -m 755 build64/strace debian/tmp/usr/bin/strace64
70 ln -s strace.1 debian/tmp/usr/share/man/man1/strace64.1
71endif
72
Wichert Akkermand321ff92002-03-31 18:45:45 +000073 dpkg-shlibdeps strace
74 dpkg-gencontrol -isp
75 dpkg --build debian/tmp ..
76
77checkroot:
78 test root = "`whoami`"