[823] | 1 | #!/usr/bin/make -f
|
---|
| 2 | # Sample debian/rules that uses debhelper.
|
---|
| 3 | # GNU copyright 1997 to 1999 by Joey Hess.
|
---|
| 4 |
|
---|
| 5 | # Uncomment this to turn on verbose mode.
|
---|
| 6 | #export DH_VERBOSE=1
|
---|
| 7 |
|
---|
| 8 | # Define package name for a one-stop change.
|
---|
| 9 | PACKAGE_NAME = mindi-busybox
|
---|
| 10 |
|
---|
[983] | 11 | # These are used for cross-compiling and for saving the configure script
|
---|
| 12 | # from having to guess our platform (since we know it already)
|
---|
| 13 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
---|
| 14 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
---|
[823] | 15 |
|
---|
[983] | 16 | CFLAGS = -Wall
|
---|
[823] | 17 |
|
---|
[983] | 18 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
---|
| 19 | CFLAGS += -O0
|
---|
| 20 | else
|
---|
| 21 | CFLAGS += -O2
|
---|
| 22 | endif
|
---|
| 23 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
---|
| 24 | INSTALL_PROGRAM += -s
|
---|
| 25 | endif
|
---|
| 26 |
|
---|
| 27 | config.status: configure
|
---|
| 28 | dh_testdir
|
---|
| 29 | # Configure the package.
|
---|
| 30 | CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr
|
---|
| 31 |
|
---|
| 32 | # Build both architecture dependent and independent
|
---|
| 33 | build: build-arch build-indep
|
---|
| 34 |
|
---|
| 35 | # Build architecture dependent
|
---|
| 36 | build-arch: build-arch-stamp
|
---|
| 37 |
|
---|
| 38 | build-arch-stamp: config.status
|
---|
| 39 | dh_testdir
|
---|
| 40 |
|
---|
| 41 | # Compile the package.
|
---|
| 42 | $(MAKE) oldconfig
|
---|
| 43 | $(MAKE) busybox
|
---|
| 44 |
|
---|
| 45 | touch build-stamp
|
---|
| 46 |
|
---|
| 47 | # Build architecture independent
|
---|
| 48 | build-indep: build-indep-stamp
|
---|
| 49 |
|
---|
| 50 | build-indep-stamp: config.status
|
---|
| 51 | # Nothing to do, the only indep item is the manual which is available as html in original source
|
---|
| 52 | touch build-indep-stamp
|
---|
| 53 |
|
---|
[823] | 54 | clean:
|
---|
| 55 | dh_testdir
|
---|
| 56 | dh_testroot
|
---|
[983] | 57 | rm -f build-arch-stamp build-indep-stamp
|
---|
| 58 | # Clean temporary document directory
|
---|
| 59 | rm -rf debian/doc-temp
|
---|
| 60 | # Clean up.
|
---|
| 61 | -$(MAKE) distclean
|
---|
| 62 | rm -f config.log
|
---|
| 63 | ifneq "$(wildcard /usr/share/misc/config.sub)" ""
|
---|
| 64 | cp -f /usr/share/misc/config.sub config.sub
|
---|
| 65 | endif
|
---|
| 66 | ifneq "$(wildcard /usr/share/misc/config.guess)" ""
|
---|
| 67 | cp -f /usr/share/misc/config.guess config.guess
|
---|
| 68 | endif
|
---|
| 69 |
|
---|
[823] | 70 | dh_clean
|
---|
| 71 |
|
---|
[983] | 72 | # Install architecture dependent and independent
|
---|
| 73 | install: install-arch install-indep
|
---|
| 74 |
|
---|
| 75 | # Install architecture dependent
|
---|
| 76 | install-arch: build-arch
|
---|
[823] | 77 | dh_testdir
|
---|
| 78 | dh_testroot
|
---|
[983] | 79 | dh_clean -k -s
|
---|
| 80 | dh_installdirs -s
|
---|
[823] | 81 |
|
---|
[983] | 82 | # Install the package files into build directory:
|
---|
| 83 | # - start with upstream make install
|
---|
| 84 | $(MAKE) install PREFIX=$(CURDIR)/debian/$(PACKAGE_NAME)/usr/lib/mindi/rootfs
|
---|
| 85 | # - copy doc
|
---|
| 86 | mkdir -p debian/doc-temp
|
---|
| 87 | cp -a ChangeLog INSTALL LICENSE AUTHORS README TODO changelog svn.log debian/doc-temp/html
|
---|
[823] | 88 |
|
---|
[983] | 89 | dh_install -s
|
---|
| 90 |
|
---|
| 91 | # Install architecture independent
|
---|
| 92 | install-indep: build-indep
|
---|
[823] | 93 | dh_testdir
|
---|
| 94 | dh_testroot
|
---|
[983] | 95 | dh_clean -k -i
|
---|
| 96 | dh_installdirs -i
|
---|
| 97 | dh_install -i
|
---|
| 98 |
|
---|
| 99 | # Must not depend on anything. This is to be called by
|
---|
| 100 | # binary-arch/binary-indep
|
---|
| 101 | # in another 'make' thread.
|
---|
| 102 | binary-common:
|
---|
| 103 | dh_testdir
|
---|
| 104 | dh_testroot
|
---|
[823] | 105 | dh_installchangelogs ChangeLog
|
---|
| 106 | dh_installdocs
|
---|
[983] | 107 | dh_installman
|
---|
[823] | 108 | dh_link
|
---|
| 109 | dh_strip
|
---|
| 110 | dh_compress
|
---|
| 111 | dh_fixperms
|
---|
| 112 | dh_installdeb
|
---|
[983] | 113 | dh_shlibdeps
|
---|
[823] | 114 | dh_gencontrol
|
---|
| 115 | dh_md5sums
|
---|
| 116 | dh_builddeb
|
---|
| 117 |
|
---|
[983] | 118 | # Build architecture independant packages using the common target.
|
---|
| 119 | binary-indep: build-indep install-indep
|
---|
| 120 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
|
---|
| 121 |
|
---|
| 122 | # Build architecture dependant packages using the common target.
|
---|
| 123 | binary-arch: build-arch install-arch
|
---|
| 124 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
|
---|
| 125 |
|
---|
| 126 | # Build architecture depdendent and independent packages
|
---|
| 127 | binary: binary-arch binary-indep
|
---|
| 128 | .PHONY: clean binary
|
---|