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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
#! /usr/bin/make -f
############################ -*- Mode: Makefile -*- ###########################
## rules ---
## Author : Manoj Srivastava ( srivasta@pilgrim.umass.edu )
## Created On : Sat Apr 27 06:36:31 1996
## Created On Node : melkor.pilgrim.umass.edu
## Last Modified By : Manoj Srivastava
## Last Modified On : Tue Mar 19 23:19:51 2002
## Last Machine Used: glaurung.green-gryphon.com
## Update Count : 136
## Status : Unknown, Use with caution!
## HISTORY :
## Description :
##
###############################################################################
ifdef ARCH
ha:=-a$(ARCH)
endif
# set the dpkg-architecture vars
export DEB_BUILD_ARCH := $(shell dpkg-architecture $(ha) -qDEB_BUILD_ARCH)
export DEB_BUILD_GNU_CPU := $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_CPU)
export DEB_BUILD_GNU_SYSTEM:= $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_SYSTEM)
export DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_TYPE)
export DEB_HOST_ARCH := $(shell dpkg-architecture $(ha) -qDEB_HOST_ARCH)
export DEB_HOST_GNU_CPU := $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_CPU)
export DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_SYSTEM)
export DEB_HOST_GNU_TYPE := $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_TYPE)
#
# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \
# sed 's/^Version: *//')
#
# $Id: rules,v 1.34 2002/03/20 05:19:56 srivasta Exp $
# Please change the maintainer information, as well as the debian version
# below, (and maybe the priority as well, espescially if you are uploading
# an official package)
# The maintainer information.
maintainer := Manoj Srivastava
email := srivasta@debian.org
# Priority of this version (or urgency, as dchanges would call it)
priority := Low
# Package specific stuff
# The name of the package (for example, `emacs').
package = kernel-package
version := $(shell perl -n0777e 'if ($$. == 1 && m/\(([\S]+)\)/o){print "$$1\n";}' debian/changelog)
FILES_TO_CLEAN = debian/files
STAMPS_TO_CLEAN = stamp-binary
DIRS_TO_CLEAN =
CONFLOC := /etc/kernel-pkg.conf
LIBLOC := /usr/share/kernel-package
MODULE_LOC := /usr/src/modules
DOCFILES = README.doc README.headers README.image README.modules \
README.source README.tecra sample.kernel-img.conf \
kernel_grub_conf.sh
# Location of the source dir
SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
TMPTOP = $(SRCTOP)/debian/tmp
# where kernel-package files go to
DEBDIR := $(LIBLOC)
DEBDIR_NAME:= $(shell basename $(DEBDIR))
DOCDIR = $(TMPTOP)/usr/share/doc/$(package)
MAN1DIR = $(TMPTOP)/usr/share/man/man1
MAN5DIR = $(TMPTOP)/usr/share/man/man5
MAN8DIR = $(TMPTOP)/usr/share/man/man8
LINTIANDIR:= $(TMPTOP)/usr/share/lintian/overrides
BASH_DIR:= $(TMPTOP)/etc/bash_completion.d
# install commands
install_file= install -p -o root -g root -m 644
install_program= install -p -o root -g root -m 755
make_directory= install -p -d -o root -g root -m 755
all build:
# Builds the binary package.
clean:
rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
rm -f -r $(TMPTOP)
rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS
binary: binary-arch binary-indep
binary-arch: build
# builds the architecture dependent part
binary-indep: build stamp-binary
stamp-binary:
@test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
(echo need root priviledges; exit 1)
$(checkdir)
rm -rf $(TMPTOP) $(TMPTOP).deb
$(make_directory) $(TMPTOP)/DEBIAN
$(make_directory) $(TMPTOP)/etc
$(make_directory) $(TMPTOP)/usr/bin
$(make_directory) $(TMPTOP)/usr/sbin
$(make_directory) $(TMPTOP)/usr/share/$(package)
$(make_directory) $(MAN1DIR)
$(make_directory) $(MAN5DIR)
$(make_directory) $(MAN8DIR)
$(make_directory) $(DOCDIR)
$(make_directory) $(LINTIANDIR)
$(make_directory) $(BASH_DIR)
$(install_file) debian/conffiles $(TMPTOP)/DEBIAN/conffiles
$(install_program) debian/postinst $(TMPTOP)/DEBIAN/postinst
$(install_program) debian/prerm $(TMPTOP)/DEBIAN/prerm
$(install_file) debian/changelog $(DOCDIR)/changelog
$(install_file) README $(DOCDIR)/README
$(install_file) kernel/Flavours $(DOCDIR)/Flavours
$(install_file) Problems $(DOCDIR)/Problems
$(install_file) _make-kpkg $(BASH_DIR)/make_kpkg
$(install_file) Multi-Arch $(DOCDIR)/Multi-Arch
$(install_file) Rationale $(DOCDIR)/Rationale
gzip -9fqr $(DOCDIR)
(cd $(DOCDIR); for file in $(DOCFILES); do \
ln -s ../../kernel-package/$$file $$file; \
done)
$(install_file) debian/copyright $(DOCDIR)/copyright
$(install_file) kernel-pkg.conf.5 $(MAN5DIR)/kernel-pkg.conf.5
$(install_file) kernel-img.conf.5 $(MAN5DIR)/kernel-img.conf.5
$(install_file) kernel-package.5 $(MAN5DIR)/kernel-package.5
$(install_file) make-kpkg.8 $(MAN1DIR)/make-kpkg.1
$(install_file) kernel-packageconfig.8 $(MAN8DIR)/
gzip -9fqr $(TMPTOP)/usr/share/man
echo 'kernel-package: postinst-does-not-set-usr-doc-link'\
> $(LINTIANDIR)/$(package)
$(install_file) kernel-pkg.conf $(TMPTOP)/etc/kernel-pkg.conf
$(install_program) kernel-packageconfig \
$(TMPTOP)/usr/sbin/kernel-packageconfig
$(install_program) make-kpkg $(TMPTOP)/usr/bin/make-kpkg
(cd kernel; tar cf - * | \
(cd $(TMPTOP)/usr/share/$(package);\
tar xf -))
$(install_file) Rationale $(TMPTOP)/usr/share/$(package)/
# Hack, tell the rules file what version of kernel package it is
sed -e 's/=K=V/$(version)/' kernel/rules > \
$(TMPTOP)/usr/share/$(package)/rules
dpkg-gencontrol -isp
chown -R root.root $(TMPTOP)
dpkg --build $(TMPTOP) ..
touch stamp-binary
define checkdir
test -f make-kpkg -a -f debian/rules
endef
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
.PHONY: binary binary-arch binary-indep clean
|