2
# Sample debian/rules that uses debhelper.
3
# GNU copyright 1997 to 1999 by Joey Hess.
5
# Uncomment this to turn on verbose mode.
8
# This is the debhelper compatability version to use.
11
ifeq ($(shell id -u),0)
15
include $(CURDIR)/debian/conf.mk
19
.PHONY: build build-stamp
20
build: configure-stamp build-stamp
27
@echo "PATCHLEVEL = $(PATCHLEVEL) " ;
28
@echo "Kernel compiler version : $(kernel_cc)" ;
29
@echo "Detected compiler version : $(module_cc)" ;
32
@if [ "$(kernel_cc)" != "$(module_cc)" ]; then \
34
echo "You appear to be compiling the NVIDIA kernel module with "; \
35
echo "a compiler different from the one that was used to compile "; \
36
echo "the running kernel. This may be perfectly alright and you "; \
37
echo "may be building this module for another kernel in which case"; \
38
echo "you may ignore this message."; \
40
echo "The compiler that will be used to compile this module has been"; \
41
echo "determined from:" ; \
42
echo " 1) the CC environment variable " ; \
43
echo " 2) that specified in "; \
44
echo " $(KSRC)/include/linux/compile.h" ; \
47
@echo "Using compiler $(CC) version $(module_cc)";
51
touch $(CURDIR)/$(dirname)/gcc-check
52
touch $(CURDIR)/$(dirname)/cc-sanity-check
55
IGNORE_CC_MISMATCH=1 CC="$(CC)" $(MAKE) -C $(CURDIR)/$(dirname) -f Makefile SYSSRC=$(KSRC) $(KPKG_EXTRAV_ARG) KBUILD_PARAMS=$(KBUILD_PARAMS) module;
66
sed 's/#KVERS#/$(KVERS)/g' debian/control.template > $(CURDIR)/debian/control
67
sed 's/#KVERS#/$(KVERS)/g' debian/dirs.template > $(CURDIR)/debian/dirs
68
sed 's/#KVERS#/$(KVERS)/g' debian/override.template > $(CURDIR)/debian/override
73
install -m 0644 $(CURDIR)/debian/override $(CURDIR)/debian/nvidia-kernel-$(KVERS)/usr/share/lintian/overrides/nvidia-kernel-$(KVERS)
74
if [ "$(PATCHLEVEL)" = "6" ] ; then \
75
install -m 0644 $(CURDIR)/$(dirname)/nvidia.ko $(CURDIR)/debian/nvidia-kernel-$(KVERS)/lib/modules/$(KVERS)/nvidia/nvidia.ko ; \
77
install -m 0644 $(CURDIR)/$(dirname)/nvidia.o $(CURDIR)/debian/nvidia-kernel-$(KVERS)/lib/modules/$(KVERS)/nvidia/nvidia.o ;\
84
.PHONY: binary_modules
85
binary_modules: build install
102
# You may want to make some executables suid here.
107
dh_gencontrol -- -v$(PKG_VERSION)
109
ifeq "$(origin KPKG_DEST_DIR)" "undefined"
110
ifeq "$(origin KMAINT)" "undefined"
111
dh_builddeb --destdir=$(CURDIR)/..
113
dh_builddeb --destdir=$(KSRC)/..
116
dh_builddeb --destdir=$(KPKG_DEST_DIR)
121
clean: clean.Makefile unpatch
122
if [ -f $(CURDIR)/debian/control.template ]; then \
123
cp $(CURDIR)/debian/control.template $(CURDIR)/debian/control; \
127
rm -f build-stamp configure-stamp
130
$(MAKE) clean SYSSRC=$(KSRC) -C $(CURDIR)/$(dirname) -f Makefile $(KPKG_EXTRAV_ARG)
132
rm -f $(CURDIR)/$(dirname)/Makefile || true;
133
-rm $(CURDIR)/$(dirname)/gcc-check
134
-rm $(CURDIR)/$(dirname)/cc-sanity-check
138
-rm $(CURDIR)/debian/control
139
-rm $(CURDIR)/debian/dirs
140
-rm $(CURDIR)/debian/override
144
if [ -e patch-stamp ]; then \
145
dpatch deapply-all ; \
146
rm -rf patch-stamp debian/patched ; \
148
patch -R -p3 < $(CURDIR)/debian/patches/xen.patch
152
# The kdist_configure target is called by make-kpkg modules_config. It
153
# should configure the module so it is ready for compilation (mostly
154
# useful for calling configure)
157
$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules configure
159
.PHONY: kdist_configure
161
$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules configure
163
# the kdist_image target is called by make-kpkg modules_image. It is
164
# responsible for compiling the module and creating the package. It
165
# should also clean up after making the module. Please note we use a
166
# seperate binary-modules target to make testing the package building
170
echo "ROOT_CMD = $(ROOT_CMD)"
171
$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary_modules
172
$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean
176
# the kdist_clean target is called by make-kpkg modules_clean. It is
177
# responsible for cleaning up any changes that have been made by the
178
# other kdist_commands (except for the .deb files created).
181
$(MAKE) $(MFLAGS) -f debian/rules clean
184
$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary_modules
185
# Build a .changes file.
186
dpkg-genchanges -b -e"$(KMAINT) <$(KEMAIL)>" -u"$(CURDIR)/../.." > $(CHFILE)
187
debsign -e"$(KMAINT) <$(KEMAIL)>" $(CHFILE)
188
$(MAKE) $(MFLAGS) -f debian/rules clean