| 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 |
|
|---|
| 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)
|
|---|
| 15 |
|
|---|
| 16 | CFLAGS = -Wall
|
|---|
| 17 |
|
|---|
| 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 | # Build both architecture dependent and independent
|
|---|
| 28 | build: build-arch build-indep
|
|---|
| 29 |
|
|---|
| 30 | # Build architecture dependent
|
|---|
| 31 | build-arch: build-arch-stamp
|
|---|
| 32 |
|
|---|
| 33 | build-arch-stamp: Makefile
|
|---|
| 34 | dh_testdir
|
|---|
| 35 |
|
|---|
| 36 | # Compile the package.
|
|---|
| 37 | $(MAKE) oldconfig
|
|---|
| 38 | $(MAKE) busybox
|
|---|
| 39 |
|
|---|
| 40 | touch build-stamp
|
|---|
| 41 |
|
|---|
| 42 | # Build architecture independent
|
|---|
| 43 | build-indep: build-indep-stamp
|
|---|
| 44 |
|
|---|
| 45 | build-indep-stamp: Makefile
|
|---|
| 46 | # Nothing to do, the only indep item is the manual which is available as html in original source
|
|---|
| 47 | touch build-indep-stamp
|
|---|
| 48 |
|
|---|
| 49 | clean:
|
|---|
| 50 | dh_testdir
|
|---|
| 51 | dh_testroot
|
|---|
| 52 | rm -f build-arch-stamp build-indep-stamp
|
|---|
| 53 | # Clean temporary document directory
|
|---|
| 54 | rm -rf debian/doc-temp
|
|---|
| 55 | # Clean up.
|
|---|
| 56 | -$(MAKE) distclean
|
|---|
| 57 | rm -f config.log
|
|---|
| 58 | ifneq "$(wildcard /usr/share/misc/config.sub)" ""
|
|---|
| 59 | cp -f /usr/share/misc/config.sub config.sub
|
|---|
| 60 | endif
|
|---|
| 61 | ifneq "$(wildcard /usr/share/misc/config.guess)" ""
|
|---|
| 62 | cp -f /usr/share/misc/config.guess config.guess
|
|---|
| 63 | endif
|
|---|
| 64 |
|
|---|
| 65 | dh_clean
|
|---|
| 66 |
|
|---|
| 67 | # Install architecture dependent and independent
|
|---|
| 68 | install: install-arch install-indep
|
|---|
| 69 |
|
|---|
| 70 | # Install architecture dependent
|
|---|
| 71 | install-arch: build-arch
|
|---|
| 72 | dh_testdir
|
|---|
| 73 | dh_testroot
|
|---|
| 74 | dh_clean -k -s
|
|---|
| 75 | dh_installdirs -s
|
|---|
| 76 |
|
|---|
| 77 | # Install the package files into build directory:
|
|---|
| 78 | # - start with upstream make install
|
|---|
| 79 | $(MAKE) install PREFIX=$(CURDIR)/debian/$(PACKAGE_NAME)/usr/lib/mindi/rootfs
|
|---|
| 80 | # - copy doc
|
|---|
| 81 | mkdir -p debian/doc-temp
|
|---|
| 82 | cp -a ChangeLog INSTALL LICENSE AUTHORS README TODO changelog svn.log debian/doc-temp/html
|
|---|
| 83 |
|
|---|
| 84 | dh_install -s
|
|---|
| 85 |
|
|---|
| 86 | # Install architecture independent
|
|---|
| 87 | install-indep: build-indep
|
|---|
| 88 | dh_testdir
|
|---|
| 89 | dh_testroot
|
|---|
| 90 | dh_clean -k -i
|
|---|
| 91 | dh_installdirs -i
|
|---|
| 92 | dh_install -i
|
|---|
| 93 |
|
|---|
| 94 | # Must not depend on anything. This is to be called by
|
|---|
| 95 | # binary-arch/binary-indep
|
|---|
| 96 | # in another 'make' thread.
|
|---|
| 97 | binary-common:
|
|---|
| 98 | dh_testdir
|
|---|
| 99 | dh_testroot
|
|---|
| 100 | dh_installchangelogs ChangeLog
|
|---|
| 101 | dh_installdocs
|
|---|
| 102 | dh_installman
|
|---|
| 103 | dh_link
|
|---|
| 104 | dh_strip
|
|---|
| 105 | dh_compress
|
|---|
| 106 | dh_fixperms
|
|---|
| 107 | dh_installdeb
|
|---|
| 108 | dh_shlibdeps
|
|---|
| 109 | dh_gencontrol
|
|---|
| 110 | dh_md5sums
|
|---|
| 111 | dh_builddeb
|
|---|
| 112 |
|
|---|
| 113 | # Build architecture independant packages using the common target.
|
|---|
| 114 | binary-indep: build-indep install-indep
|
|---|
| 115 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
|
|---|
| 116 |
|
|---|
| 117 | # Build architecture dependant packages using the common target.
|
|---|
| 118 | binary-arch: build-arch install-arch
|
|---|
| 119 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
|
|---|
| 120 |
|
|---|
| 121 | # Build architecture depdendent and independent packages
|
|---|
| 122 | binary: binary-arch binary-indep
|
|---|
| 123 | .PHONY: clean binary
|
|---|