Advertisement
Guest User

Untitled

a guest
Mar 29th, 2010
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 5.84 KB | None | 0 0
  1. #!/usr/bin/make -f
  2. # -*- makefile -*-
  3. # Sample debian/rules that uses debhelper.
  4. # GNU copyright 1997 to 1999 by Joey Hess.
  5. #
  6. # Modified to make a template file for a multi-binary package with separated
  7. # build-arch and build-indep targets  by Bill Allombert 2001
  8.  
  9. # Uncomment this to turn on verbose mode.
  10. #export DH_VERBOSE=1
  11.  
  12. # This has to be exported to make some magic below work.
  13. export DH_OPTIONS
  14.  
  15. non_epoch_version=$(shell echo $(KVERS) | perl -pe 's/^\d+://')
  16.  
  17. PACKAGE=iscsitarget
  18. psource=iscsitarget-source
  19. pmodules = $(PACKAGE)-module-$(non_epoch_version)
  20.  
  21. MA_DIR ?= /usr/share/modass
  22. -include $(MA_DIR)/include/generic.make
  23. -include $(MA_DIR)/include/common-rules.make
  24.  
  25. CFLAGS = -Wall -g
  26.  
  27. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  28.         CFLAGS += -O0
  29. else
  30.         CFLAGS += -O2
  31. endif
  32. ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  33.         INSTALL_PROGRAM += -s
  34. endif
  35.  
  36. # module-assistant stuff
  37. MAJOR=$(shell echo $(KVERS) | sed -e 's/\(...\).*/\1/')
  38. ifeq ($(MAJOR),2.6)
  39. KO=k
  40. endif
  41.  
  42. kdist_clean:
  43.         dh_clean
  44.          $(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd)/kernel clean
  45.  
  46. # prep-deb-files rewrites the debian/ files as needed. See RATIONALE for
  47. # details
  48. kdist_config: prep-deb-files
  49. # ... additional kernel specific things to configure...
  50.  
  51. kdist_configure: kdist_config
  52.  
  53. binary-modules: prep-deb-files
  54.         dh_testdir
  55.         dh_testroot
  56.         dh_clean -k
  57.         #$(MAKE) -C $(KSRC) KERNEL_SOURCES=$(KSRC) MODVERSIONS=detect KERNEL=linux-$(KVERS) KDIR=$(KSRC) SUBDIRS=$(shell pwd)/kernel modules
  58.         $(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd)/kernel modules
  59.  
  60.         #$(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd)/kernel modules_install DESTDIR=$(CURDIR)/debian/$(pmodules)
  61.         install -m644 -b -D $(shell pwd)/kernel/iscsi_trgt.$(KO)o $(CURDIR)/debian/${pmodules}/lib/modules/$(KVERS)/kernel/drivers/iscsi/iscsi_trgt.$(KO)o
  62.  
  63.         dh_installdocs
  64.         dh_installchangelogs
  65.         dh_compress
  66.         dh_fixperms
  67.         dh_installdeb
  68.         dh_gencontrol -- -v$(VERSION)
  69.         dh_md5sums
  70.         dh_builddeb --destdir=$(DEB_DESTDIR)
  71.  
  72. #Architecture
  73. build: build-arch build-indep
  74.  
  75. build-arch: build-arch-stamp
  76. build-arch-stamp:
  77.         dh_testdir
  78.         $(MAKE) -C usr
  79.         touch build-arch-stamp
  80.  
  81. build-indep: build-indep-stamp
  82. build-indep-stamp:
  83.         touch build-indep-stamp
  84.  
  85. clean:
  86.         dh_testdir
  87.         dh_testroot
  88.         rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
  89.         $(MAKE) -C usr clean
  90.         dh_clean
  91.  
  92. install: install-arch install-indep
  93. install-indep:
  94.         dh_testdir
  95.         dh_testroot
  96.         dh_clean -k -i
  97.         dh_installdirs -i
  98.  
  99.         # Create the directories to install the source into
  100.         dh_installdirs -p$(psource)  usr/src/modules/$(PACKAGE)
  101.         dh_installdirs -p$(psource)  usr/src/modules/$(PACKAGE)/debian
  102.         dh_installdirs -p$(psource)  usr/src/modules/$(PACKAGE)/include
  103.         dh_installdirs -p$(psource)  usr/src/modules/$(PACKAGE)/kernel
  104.  
  105.         # Copy only the driver source to the proper location
  106.         cp kernel/*  debian/$(psource)/usr/src/modules/$(PACKAGE)/kernel/
  107.         cp include/* debian/$(psource)/usr/src/modules/$(PACKAGE)/include/
  108.  
  109.         # Copy the needed debian/ pieces to the proper location
  110.         cp debian/*-module-* \
  111.                 debian/$(psource)/usr/src/modules/$(PACKAGE)/debian
  112.         cp debian/control.modules.in \
  113.                 debian/$(psource)/usr/src/modules/$(PACKAGE)/debian/control.in
  114.         cp debian/rules \
  115.                 debian/$(psource)/usr/src/modules/$(PACKAGE)/debian
  116.         cp debian/changelog \
  117.                 debian/$(psource)/usr/src/modules/$(PACKAGE)/debian
  118.         cp debian/copyright \
  119.                 debian/$(psource)/usr/src/modules/$(PACKAGE)/debian
  120.  
  121. #        install debian/ files
  122.         cd debian ; cp changelog control compat *.modules.in rules copyright $(psource)/usr/src/modules/$(PACKAGE)/debian
  123.  
  124. #        create toplevel module Makefile
  125.         echo "obj-m = kernel/" > debian/$(psource)/usr/src/modules/$(PACKAGE)/Makefile
  126.  
  127. #        tar the stuff
  128.         cd debian/$(psource)/usr/src/ ; tar cvjf iscsitarget.tar.bz2 modules ; rm -rf modules
  129.  
  130.         install -m 755 $(CURDIR)/debian/modass.iscsitarget-source $(CURDIR)/debian/$(psource)/usr/share/modass/overrides/iscsitarget-source
  131.         dh_install -i
  132.  
  133. install-arch:
  134.         dh_testdir
  135.         dh_testroot
  136.         dh_clean -k -s
  137.         dh_installdirs -s
  138.         dh_install -s
  139.  
  140.         # install override
  141.         mkdir -p debian/iscsitarget/usr/share/lintian/overrides
  142.         cp debian/iscsitarget.overrides \
  143.                 debian/iscsitarget/usr/share/lintian/overrides/iscsitarget
  144.  
  145.  
  146.  
  147. # Must not depend on anything. This is to be called by
  148. # binary-arch/binary-indep
  149. # in another 'make' thread.
  150. binary-common:
  151.         dh_testdir
  152.         dh_testroot
  153.         dh_installchangelogs ChangeLog
  154.         dh_installdocs
  155.         dh_installinit
  156.         dh_installman
  157.         dh_link
  158.         dh_strip
  159.         dh_compress
  160.         dh_fixperms
  161.         chmod 600 $(CURDIR)/debian/iscsitarget/etc/ietd.conf
  162.         dh_makeshlibs
  163.         dh_installdeb
  164.         dh_shlibdeps
  165.         dh_gencontrol
  166.         dh_md5sums
  167.         dh_builddeb
  168. # Build architecture independant packages using the common target.
  169. binary-indep: build-indep install-indep
  170.         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
  171.  
  172. # Build architecture dependant packages using the common target.
  173. binary-arch: build-arch install-arch
  174.         $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
  175.  
  176. binary: binary-arch binary-indep
  177. .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184. ERROR =
  185.  
  186. make: *** usr: No such file or directory.  Stop.
  187. make: *** [clean] Error 2
  188. dpkg-buildpackage: failure: debian/rules clean gave error exit status 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement