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
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess.
export DH_COMPAT := 5
build: build-stamp
build-stamp:
dh_testdir
gcc -D_REENTRANT -fPIC -c libhello.c
gcc -o libhello.so.0.0 -shared -Wl,-soname,libhello.so.0 libhello.o
ln -s libhello.so.0.0 libhello.so
gcc -o hello hello.c -L. -lhello
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp *.o libhello.so.0.0
dh_clean
install: build-stamp
dh_testdir
dh_testroot
dh_clean -k
install -D hello $(CURDIR)/debian/hello/usr/bin/hello
install -D libhello.so.0.0 \
$(CURDIR)/debian/libhello0/usr/lib/libhello.so.0.0
ln -s libhello.so.0.0 \
$(CURDIR)/debian/libhello0/usr/lib/libhello.so.0
# Build architecture-dependent files here.
export DH_OPTIONS
binary-arch: DH_OPTIONS=-a
binary-arch: build-stamp install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
DH_OPTIONS= dh_strip -phello --dbg-package=hello-dbg
DH_OPTIONS= dh_strip -plibhello0 --dbg-package=libhello0-dbg
# Now break a few things. Copy the debugging data into places it
# shouldn't be.
cp $(CURDIR)/debian/hello-dbg/usr/lib/debug/usr/bin/hello \
$(CURDIR)/debian/hello/usr/bin/hello.dbg
cp $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/usr/lib/libhello.so.0.0 \
$(CURDIR)/debian/libhello0-dbg/usr/lib/libhello.so.dbg
dh_link
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary-indep:
binary: binary-indep binary-arch
.PHONY: binary binary-indep binary-arch build clean install
|