home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / debian / ruleset / modules.mk < prev   
Encoding:
Text File  |  2006-03-27  |  13.5 KB  |  261 lines

  1. ######################### -*- Mode: Makefile-Gmake -*- ########################
  2. ## modules.mk --- 
  3. ## Author           : Manoj Srivastava ( srivasta@glaurung.internal.golden-gryphon.com ) 
  4. ## Created On       : Mon Oct 31 10:37:44 2005
  5. ## Created On Node  : glaurung.internal.golden-gryphon.com
  6. ## Last Modified By : Manoj Srivastava
  7. ## Last Modified On : Mon Mar 27 10:57:27 2006
  8. ## Last Machine Used: glaurung.internal.golden-gryphon.com
  9. ## Update Count     : 7
  10. ## Status           : Unknown, Use with caution!
  11. ## HISTORY          : 
  12. ## Description      : This file contains the targets responsible for third party
  13. ##                    module interaction. 
  14. ##
  15. ## arch-tag: 0c2c8a37-03da-48a2-9d87-27330c559025
  16. ##
  17. ## 
  18. ## This program is free software; you can redistribute it and/or modify
  19. ## it under the terms of the GNU General Public License as published by
  20. ## the Free Software Foundation; either version 2 of the License, or
  21. ## (at your option) any later version.
  22. ##
  23. ## This program is distributed in the hope that it will be useful,
  24. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  26. ## GNU General Public License for more details.
  27. ##
  28. ## You should have received a copy of the GNU General Public License
  29. ## along with this program; if not, write to the Free Software
  30. ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  31. ##
  32. ###############################################################################
  33.  
  34. define mod_inst_cmds
  35.         @(                                                           \
  36.         MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(version);           \
  37.         cd modules;                                                  \
  38.         MODULES="";                                                  \
  39.         inst_mod() { These="$$(cat $$1)"; MODULES="$$MODULES $$These"; \
  40.                 mkdir -p $$MODLIB/$$2; cp $$These $$MODLIB/$$2;               \
  41.                 echo Installing modules under $$MODLIB/$$2; \
  42.         }; \
  43.                                                                                \
  44.     if [ -f BLOCK_MODULES    ]; then inst_mod BLOCK_MODULES    block; fi; \
  45.     if [ -f NET_MODULES      ]; then inst_mod NET_MODULES      net;   fi; \
  46.     if [ -f IPV4_MODULES     ]; then inst_mod IPV4_MODULES     ipv4;  fi; \
  47.     if [ -f IPV6_MODULES     ]; then inst_mod IPV6_MODULES     ipv6;  fi; \
  48.          if [ -f ATM_MODULES      ]; then inst_mod ATM_MODULES      atm;   fi; \
  49.     if [ -f SCSI_MODULES     ]; then inst_mod SCSI_MODULES     scsi;  fi; \
  50.     if [ -f FS_MODULES       ]; then inst_mod FS_MODULES       fs;    fi; \
  51.     if [ -f NLS_MODULES      ]; then inst_mod NLS_MODULES      fs;    fi;        \
  52.     if [ -f CDROM_MODULES    ]; then inst_mod CDROM_MODULES    cdrom; fi;        \
  53.     if [ -f HAM_MODULES      ]; then inst_mod HAM_MODULES      net;   fi;        \
  54.     if [ -f SOUND_MODULES    ]; then inst_mod SOUND_MODULES    sound; fi;        \
  55.     if [ -f VIDEO_MODULES    ]; then inst_mod VIDEO_MODULES    video; fi;        \
  56.     if [ -f FC4_MODULES      ]; then inst_mod FC4_MODULES      fc4;   fi;        \
  57.     if [ -f IRDA_MODULES     ]; then inst_mod IRDA_MODULES     net;   fi;        \
  58.          if [ -f USB_MODULES      ]; then inst_mod USB_MODULES      usb;   fi;        \
  59.          if [ -f SK98LIN_MODULES  ]; then inst_mod SK98LIN_MODULES  net;   fi;        \
  60.          if [ -f SKFP_MODULES     ]; then inst_mod SKFP_MODULES     net;   fi;        \
  61.          if [ -f IEEE1394_MODULES ]; then inst_mod IEEE1394_MODULES ieee1394; fi;     \
  62.          if [ -f PCMCIA_MODULES   ]; then inst_mod PCMCIA_MODULES pcmcia;   fi;       \
  63.          if [ -f PCMCIA_NET_MODULES ]; then inst_mod PCMCIA_NET_MODULES pcmcia; fi;   \
  64.          if [ -f PCMCIA_CHAR_MODULES ]; then inst_mod PCMCIA_CHAR_MODULES pcmcia; fi; \
  65.          if [ -f PCMCIA_SCSI_MODULES ]; then inst_mod PCMCIA_SCSI_MODULES pcmcia; fi; \
  66.                                                                                       \
  67.         for f in *.o; do [ -r $$f ] && echo $$f; done > .allmods; \
  68.         echo $$MODULES | tr ' ' '\n' | sort | comm -23 .allmods - > .misc; \
  69.         if [ -s .misc ]; then inst_mod .misc misc; fi; \
  70.         rm -f .misc .allmods; \
  71.         )
  72. endef
  73.  
  74.  
  75. # only generate module image packages
  76. modules-image modules_image: .config
  77. ifeq ($(strip $(shell grep -E ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),)
  78.     @echo Modules not configured, so not making $@
  79. else
  80. ifneq ($(strip $(HAVE_VERSION_MISMATCH)),)
  81.     @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1)
  82. endif
  83.     $(if $(subst $(strip $(UTS_RELEASE_VERSION)),,$(strip $(version))), \
  84.         echo "The UTS Release version in include/linux/version.h"; \
  85.         echo "     \"$(strip $(UTS_RELEASE_VERSION))\" "; \
  86.         echo "does not match current version:"; \
  87.         echo "     \"$(strip $(version))\" "; \
  88.         echo "Please correct this."; \
  89.         exit 2,)
  90.     -for module in $(valid_modules) ; do                       \
  91.           if test -d  $$module; then                                \
  92.         (cd $$module;                                          \
  93.               if ./debian/rules KVERS="$(version)" KSRC="$(SRCTOP)" \
  94.                              KMAINT="$(pgp)" KEMAIL="$(email)"      \
  95.                              KPKG_DEST_DIR="$(KPKG_DEST_DIR)"       \
  96.                              KPKG_MAINTAINER="$(maintainer)"        \
  97.                              KPKG_EXTRAV_ARG="$(EXTRAV_ARG)"        \
  98.                              ARCH="$(KERNEL_ARCH)"                  \
  99.                              KDREV="$(debian)" kdist_image; then    \
  100.                   echo "Module $$module processed fine";            \
  101.               else                                                  \
  102.                    echo "Module $$module failed.";                  \
  103.                    if [ "X$(strip $(ROOT_CMD))" != "X" ]; then      \
  104.                       echo "Perhaps $$module does not understand --rootcmd?";  \
  105.                       echo "If you see messages that indicate that it is not"; \
  106.                       echo "in fact being built as root, please file a bug ";  \
  107.                       echo "against $$module.";                     \
  108.                    fi;                                              \
  109.                    echo "Hit return to Continue";                   \
  110.          read ans;                                        \
  111.               fi;                                                   \
  112.          );                                                    \
  113.       else                                                      \
  114.                echo "Module $$module does not exist";               \
  115.                echo "Hit return to Continue?";                      \
  116.       fi;                                                       \
  117.         done
  118. endif
  119.  
  120. # generate the modules packages and sign them
  121. modules: .config
  122. ifeq ($(strip $(shell grep -E ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),)
  123.     @echo Modules not configured, so not making $@
  124. else
  125. ifneq ($(strip $(HAVE_VERSION_MISMATCH)),)
  126.     @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1)
  127. endif
  128.     $(if $(subst $(strip $(UTS_RELEASE_VERSION)),,$(strip $(version))), \
  129.         echo "The UTS Release version in include/linux/version.h"; \
  130.         echo "     \"$(strip $(UTS_RELEASE_VERSION))\" "; \
  131.         echo "does not match current version:"; \
  132.         echo "     \"$(strip $(version))\" "; \
  133.         echo "Please correct this."; \
  134.         exit 2,)
  135.     -for module in $(valid_modules) ; do                       \
  136.           if test -d  $$module; then                                \
  137.         (cd $$module;                                          \
  138.               if ./debian/rules KVERS="$(version)" KSRC="$(SRCTOP)" \
  139.                              KMAINT="$(pgp)" KEMAIL="$(email)"      \
  140.                              KPKG_DEST_DIR="$(KPKG_DEST_DIR)"       \
  141.                              KPKG_MAINTAINER="$(maintainer)"        \
  142.                              ARCH=$(KERNEL_ARCH)                    \
  143.                              KPKG_EXTRAV_ARG="$(EXTRAV_ARG)"        \
  144.                              KDREV="$(debian)" kdist; then          \
  145.                   echo "Module $$module processed fine";            \
  146.               else                                                  \
  147.                    echo "Module $$module failed.";                  \
  148.                    if [ "X$(strip $(ROOT_CMD))" != "X" ]; then      \
  149.                       echo "Perhaps $$module does not understand --rootcmd?";  \
  150.                       echo "If you see messages that indicate that it is not"; \
  151.                       echo "in fact being built as root, please file a bug ";  \
  152.                       echo "against $$module.";                     \
  153.                    fi;                                              \
  154.                    echo "Hit return to Continue?";                  \
  155.          read ans;                                          \
  156.               fi;                                                   \
  157.          );                                                     \
  158.       else                                                      \
  159.                echo "Module $$module does not exist";               \
  160.                echo "Hit return to Continue?";                      \
  161.       fi;                                                       \
  162.         done
  163. endif
  164.  
  165. # configure the modules packages
  166. modules-config modules_config: .config
  167. ifeq ($(strip $(shell grep -E ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),)
  168.     @echo Modules not configured, so not making $@
  169. else
  170. ifneq ($(strip $(HAVE_VERSION_MISMATCH)),)
  171.     @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1)
  172. endif
  173.     $(if $(subst $(strip $(UTS_RELEASE_VERSION)),,$(strip $(version))), \
  174.         echo "The UTS Release version in include/linux/version.h"; \
  175.         echo "     \"$(strip $(UTS_RELEASE_VERSION))\" "; \
  176.         echo "does not match current version:"; \
  177.         echo "     \"$(strip $(version))\" "; \
  178.         echo "Please correct this."; \
  179.         exit 2,)
  180.     -for module in $(valid_modules) ; do                       \
  181.           if test -d  $$module; then                                \
  182.         (cd $$module;                                          \
  183.               if ./debian/rules KVERS="$(version)" KSRC="$(SRCTOP)" \
  184.                              KMAINT="$(pgp)" KEMAIL="$(email)"      \
  185.                              KPKG_DEST_DIR="$(KPKG_DEST_DIR)"       \
  186.                              KPKG_MAINTAINER="$(maintainer)"        \
  187.                              ARCH=$(KERNEL_ARCH)                    \
  188.                              KPKG_EXTRAV_ARG="$(EXTRAV_ARG)"        \
  189.                              KDREV="$(debian)" kdist_configure; then\
  190.                   echo "Module $$module configured fine";           \
  191.               else                                                  \
  192.                    echo "Module $$module failed to configure";      \
  193.                    echo "Hit return to Continue?";                  \
  194.          read ans;                                        \
  195.               fi;                                                   \
  196.          );                                                    \
  197.       else                                                      \
  198.                echo "Module $$module does not exist";               \
  199.                echo "Hit return to Continue?";                      \
  200.       fi;                                                      \
  201.         done
  202. endif
  203.  
  204. modules-clean modules_clean: .config
  205. ifeq ($(strip $(shell grep -E ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),)
  206.     @echo Modules not configured, so not making $@
  207. else
  208.     $(if $(subst $(strip $(UTS_RELEASE_VERSION)),,$(strip $(version))), \
  209.         echo "The UTS Release version in include/linux/version.h"; \
  210.         echo "     \"$(strip $(UTS_RELEASE_VERSION))\" "; \
  211.         echo "does not match current version:"; \
  212.         echo "     \"$(strip $(version))\" "; \
  213.         echo "Please correct this."; \
  214.         exit 2,)
  215.     -for module in $(valid_modules); do                        \
  216.           if test -d  $$module; then                                \
  217.         (cd $$module;                                          \
  218.               if ./debian/rules KVERS="$(version)" KSRC="$(SRCTOP)" \
  219.                              KMAINT="$(pgp)" KEMAIL="$(email)"      \
  220.                              KPKG_DEST_DIR="$(KPKG_DEST_DIR)"       \
  221.                              KPKG_MAINTAINER="$(maintainer)"        \
  222.                              ARCH=$(KERNEL_ARCH)                    \
  223.                              KPKG_EXTRAV_ARG="$(EXTRAV_ARG)"        \
  224.                              KDREV="$(debian)" kdist_clean; then    \
  225.                   echo "Module $$module cleaned";                   \
  226.               else                                                  \
  227.                    echo "Module $$module failed to clean up";       \
  228.                    echo "Hit return to Continue?";                  \
  229.          read ans;                                          \
  230.               fi;                                                   \
  231.          );                                                     \
  232.       else                                                      \
  233.                echo "Module $$module does not exist";               \
  234.                echo "Hit return to Continue?";                      \
  235.       fi;                                                       \
  236.         done
  237. endif
  238.  
  239.  
  240. #         2.0.38    2.2.12    2.3.1
  241. # BLOCK_MODULES    X    X    X
  242. # NET_MODULES    X    X    X
  243. # IPV4_MODULES    X    X    X
  244. # IPV6_MODULES        X    X
  245. # ATM_MODULES            X
  246. # SCSI_MODULES    X    X    X
  247. # FS_MODULES    X    X    X
  248. # NLS_MODULES        X    X
  249. # CDROM_MODULES    X    X    X
  250. # HAM_MODULES        X    X
  251. # SOUND_MODULES        X    X
  252. # VIDEO_MODULES        X    X
  253. # FC4_MODULES        X    X
  254. # IRDA_MODULES        X    X
  255. # USB_MODULES            X
  256.  
  257.  
  258. #Local variables:
  259. #mode: makefile
  260. #End:
  261.