Version:  2.0.40 2.2.26 2.4.37 3.13 3.14 3.15 3.16 3.17 3.18 3.19 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10

Linux/Makefile

  1 VERSION = 2
  2 PATCHLEVEL = 4
  3 SUBLEVEL = 37
  4 EXTRAVERSION =
  5 
  6 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
  7 
  8 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
  9 KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
 10 
 11 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 12           else if [ -x /bin/bash ]; then echo /bin/bash; \
 13           else echo sh; fi ; fi)
 14 TOPDIR  := $(shell /bin/pwd)
 15 
 16 HPATH           = $(TOPDIR)/include
 17 FINDHPATH       = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
 18 
 19 HOSTCC          = gcc
 20 HOSTCFLAGS      = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 21 
 22 CROSS_COMPILE   =
 23 
 24 #
 25 # Include the make variables (CC, etc...)
 26 #
 27 
 28 AS              = $(CROSS_COMPILE)as
 29 LD              = $(CROSS_COMPILE)ld
 30 CC              = $(CROSS_COMPILE)gcc
 31 CPP             = $(CC) -E
 32 AR              = $(CROSS_COMPILE)ar
 33 NM              = $(CROSS_COMPILE)nm
 34 STRIP           = $(CROSS_COMPILE)strip
 35 OBJCOPY         = $(CROSS_COMPILE)objcopy
 36 OBJDUMP         = $(CROSS_COMPILE)objdump
 37 MAKEFILES       = $(TOPDIR)/.config
 38 GENKSYMS        = /sbin/genksyms
 39 DEPMOD          = /sbin/depmod
 40 MODFLAGS        = -DMODULE
 41 CFLAGS_KERNEL   =
 42 PERL            = perl
 43 AWK             = awk
 44 RPM             := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
 45                         else echo rpm; fi)
 46 
 47 export  VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
 48         CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
 49         CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL AWK
 50 
 51 all:    do-it-all
 52 
 53 #
 54 # Make "config" the default target if there is no configuration file or
 55 # "depend" the target if there is no top-level dependency information.
 56 #
 57 
 58 ifeq (.config,$(wildcard .config))
 59 include .config
 60 ifeq (.depend,$(wildcard .depend))
 61 include .depend
 62 do-it-all:      Version vmlinux
 63 else
 64 CONFIGURATION = depend
 65 do-it-all:      depend
 66 endif
 67 else
 68 CONFIGURATION = config
 69 do-it-all:      config
 70 endif
 71 
 72 #
 73 # INSTALL_PATH specifies where to place the updated kernel and system map
 74 # images.  Uncomment if you want to place them anywhere other than root.
 75 #
 76 
 77 #export INSTALL_PATH=/boot
 78 
 79 #
 80 # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
 81 # relocations required by build roots.  This is not defined in the
 82 # makefile but the arguement can be passed to make if needed.
 83 #
 84 
 85 MODLIB  := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
 86 export MODLIB
 87 
 88 #
 89 # standard CFLAGS
 90 #
 91 
 92 CPPFLAGS := -D__KERNEL__ -I$(HPATH)
 93 
 94 CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
 95           -fno-strict-aliasing -fno-common
 96 CFLAGS += -fno-builtin-strpbrk -fno-builtin-sprintf
 97 ifndef CONFIG_FRAME_POINTER
 98 CFLAGS += -fomit-frame-pointer
 99 endif
100 AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
101 
102 check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
103 if_gcc4 = $(shell if echo __GNUC__ | $(CC) -E -xc - | grep -q '^4$$' > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
104 
105 # disable pointer signedness warnings in gcc 4.0
106 CFLAGS += $(call check_gcc,-Wno-pointer-sign,)
107 
108 #
109 # ROOT_DEV specifies the default root-device when making the image.
110 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
111 # the default of FLOPPY is used by 'build'.
112 # This is i386 specific.
113 #
114 
115 export ROOT_DEV = CURRENT
116 
117 #
118 # If you want to preset the SVGA mode, uncomment the next line and
119 # set SVGA_MODE to whatever number you want.
120 # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
121 # The number is the same as you would ordinarily press at bootup.
122 # This is i386 specific.
123 #
124 
125 export SVGA_MODE = -DSVGA_MODE=NORMAL_VGA
126 
127 #
128 # If you want the RAM disk device, define this to be the size in blocks.
129 # This is i386 specific.
130 #
131 
132 #export RAMDISK = -DRAMDISK=512
133 
134 CORE_FILES      =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
135 NETWORKS        =net/network.o
136 
137 LIBS            =$(TOPDIR)/lib/lib.a
138 SUBDIRS         =kernel drivers mm fs net ipc lib crypto
139 
140 DRIVERS-n :=
141 DRIVERS-y :=
142 DRIVERS-m :=
143 DRIVERS-  :=
144 
145 DRIVERS-$(CONFIG_ACPI_BOOT) += drivers/acpi/acpi.o
146 DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o
147 DRIVERS-y += drivers/char/char.o \
148         drivers/block/block.o \
149         drivers/misc/misc.o \
150         drivers/net/net.o
151 DRIVERS-$(CONFIG_AGP) += drivers/char/agp/agp.o
152 DRIVERS-$(CONFIG_DRM_NEW) += drivers/char/drm/drm.o
153 DRIVERS-$(CONFIG_DRM_OLD) += drivers/char/drm-4.0/drm.o
154 DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a
155 DRIVERS-$(CONFIG_NET_FC) += drivers/net/fc/fc.o
156 DRIVERS-$(CONFIG_DEV_APPLETALK) += drivers/net/appletalk/appletalk.o
157 DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.o
158 DRIVERS-$(CONFIG_WAN) += drivers/net/wan/wan.o
159 DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnetdrv.o
160 DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o
161 DRIVERS-$(CONFIG_IDE) += drivers/ide/idedriver.o
162 DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
163 DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o
164 DRIVERS-$(CONFIG_FUSION_BOOT) += drivers/message/fusion/fusion.o
165 DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o
166 
167 ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),)
168 DRIVERS-y += drivers/cdrom/driver.o
169 endif
170 
171 DRIVERS-$(CONFIG_SOUND) += drivers/sound/sounddrivers.o
172 DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o
173 DRIVERS-$(CONFIG_MTD) += drivers/mtd/mtdlink.o
174 DRIVERS-$(CONFIG_PCMCIA) += drivers/pcmcia/pcmcia.o
175 DRIVERS-$(CONFIG_NET_PCMCIA) += drivers/net/pcmcia/pcmcia_net.o
176 DRIVERS-$(CONFIG_NET_WIRELESS) += drivers/net/wireless/wireless_net.o
177 DRIVERS-$(CONFIG_PCMCIA_CHRDEV) += drivers/char/pcmcia/pcmcia_char.o
178 DRIVERS-$(CONFIG_DIO) += drivers/dio/dio.a
179 DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o
180 DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o
181 DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
182 DRIVERS-$(CONFIG_PPC32) += drivers/macintosh/macintosh.o
183 DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o
184 DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o
185 DRIVERS-$(CONFIG_I2C) += drivers/i2c/i2c.o
186 DRIVERS-$(CONFIG_VT) += drivers/video/video.o
187 DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a
188 DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o
189 DRIVERS-$(CONFIG_TC) += drivers/tc/tc.a
190 DRIVERS-$(CONFIG_USB) += drivers/usb/usbdrv.o
191 DRIVERS-$(CONFIG_USB_GADGET) += drivers/usb/gadget/built-in.o
192 DRIVERS-y +=drivers/media/media.o
193 DRIVERS-$(CONFIG_INPUT) += drivers/input/inputdrv.o
194 DRIVERS-$(CONFIG_HIL) += drivers/hil/hil.o
195 DRIVERS-$(CONFIG_I2O) += drivers/message/i2o/i2o.o
196 DRIVERS-$(CONFIG_IRDA) += drivers/net/irda/irda.o
197 DRIVERS-$(CONFIG_PHONE) += drivers/telephony/telephony.o
198 DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o
199 DRIVERS-$(CONFIG_GSC) += drivers/gsc/gscbus.o
200 DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o
201 DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o
202 DRIVERS-$(CONFIG_ISDN_BOOL) += drivers/isdn/vmlinux-obj.o
203 DRIVERS-$(CONFIG_CRYPTO) += crypto/crypto.o
204 
205 DRIVERS := $(DRIVERS-y)
206 
207 
208 # files removed with 'make clean'
209 CLEAN_FILES = \
210         kernel/ksyms.lst include/linux/compile.h \
211         vmlinux System.map \
212         .tmp* \
213         drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
214         drivers/char/conmakehash \
215         drivers/char/drm/*-mod.c \
216         drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \
217         drivers/zorro/devlist.h drivers/zorro/gen-devlist \
218         drivers/sound/bin2hex drivers/sound/hex2hex \
219         drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} \
220         drivers/scsi/aic7xxx/aicasm/aicasm \
221         drivers/scsi/aic7xxx/aicasm/aicasm_gram.c \
222         drivers/scsi/aic7xxx/aicasm/aicasm_gram.h \
223         drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.c \
224         drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.h \
225         drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.c \
226         drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \
227         drivers/scsi/aic7xxx/aicasm/aicdb.h \
228         drivers/scsi/aic7xxx/aicasm/y.tab.h \
229         drivers/scsi/53c700_d.h \
230         drivers/tc/lk201-map.c \
231         net/khttpd/make_times_h \
232         net/khttpd/times.h \
233         submenu* \
234         drivers/ieee1394/oui.c
235 # directories removed with 'make clean'
236 CLEAN_DIRS = \
237         modules
238 
239 # files removed with 'make mrproper'
240 MRPROPER_FILES = \
241         include/linux/autoconf.h include/linux/version.h \
242         lib/crc32table.h lib/gen_crc32table \
243         drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h \
244         drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h \
245         drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h \
246         drivers/net/hamradio/soundmodem/gentbl \
247         drivers/sound/*_boot.h drivers/sound/.*.boot \
248         drivers/sound/msndinit.c \
249         drivers/sound/msndperm.c \
250         drivers/sound/pndsperm.c \
251         drivers/sound/pndspini.c \
252         drivers/atm/fore200e_*_fw.c drivers/atm/.fore200e_*.fw \
253         .version .config* config.in config.old \
254         scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp \
255         scripts/lxdialog/*.o scripts/lxdialog/lxdialog \
256         .menuconfig.log \
257         include/asm \
258         .hdepend scripts/mkdep scripts/split-include scripts/docproc \
259         $(TOPDIR)/include/linux/modversions.h \
260         kernel.spec
261 
262 # directories removed with 'make mrproper'
263 MRPROPER_DIRS = \
264         include/config \
265         $(TOPDIR)/include/linux/modules
266 
267 
268 include arch/$(ARCH)/Makefile
269 
270 # Extra cflags for kbuild 2.4.  The default is to forbid includes by kernel code
271 # from user space headers.  Some UML code requires user space headers, in the
272 # UML Makefiles add 'kbuild_2_4_nostdinc :=' before include Rules.make.  No
273 # other kernel code should include user space headers, if you need
274 # 'kbuild_2_4_nostdinc :=' or -I/usr/include for kernel code and you are not UML
275 # then your code is broken!  KAO.
276 
277 kbuild_2_4_nostdinc     := -nostdinc -iwithprefix include
278 export kbuild_2_4_nostdinc
279 
280 export  CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL
281 
282 export  NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS
283 
284 .S.s:
285         $(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -o $*.s $<
286 .S.o:
287         $(CC) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -c -o $*.o $<
288 
289 Version: dummy
290         @rm -f include/linux/compile.h
291 
292 boot: vmlinux
293         @$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot
294 
295 vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o init/do_mounts.o linuxsubdirs
296         $(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o init/do_mounts.o \
297                 --start-group \
298                 $(CORE_FILES) \
299                 $(DRIVERS) \
300                 $(NETWORKS) \
301                 $(LIBS) \
302                 --end-group \
303                 -o vmlinux
304         $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
305 
306 symlinks:
307         rm -f include/asm
308         ( cd include ; ln -sf asm-$(ARCH) asm)
309         @if [ ! -d include/linux/modules ]; then \
310                 mkdir include/linux/modules; \
311         fi
312 
313 oldconfig: symlinks
314         $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
315 
316 xconfig: symlinks
317         $(MAKE) -C scripts kconfig.tk
318         wish -f scripts/kconfig.tk
319 
320 menuconfig: include/linux/version.h symlinks
321         $(MAKE) -C scripts/lxdialog all
322         $(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in
323 
324 config: symlinks
325         $(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
326 
327 include/config/MARKER: scripts/split-include include/linux/autoconf.h
328         scripts/split-include include/linux/autoconf.h include/config
329         @ touch include/config/MARKER
330 
331 linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
332 
333 $(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
334         $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@)
335 
336 $(TOPDIR)/include/linux/version.h: include/linux/version.h
337 $(TOPDIR)/include/linux/compile.h: include/linux/compile.h
338 
339 newversion:
340         . scripts/mkversion > .tmpversion
341         @mv -f .tmpversion .version
342 
343 uts_len         := 64
344 uts_truncate    := sed -e 's/\(.\{1,$(uts_len)\}\).*/\1/'
345 
346 include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
347         @echo -n \#`cat .version` > .ver1
348         @if [ -n "$(CONFIG_SMP)" ] ; then echo -n " SMP" >> .ver1; fi
349         @if [ -f .name ]; then  echo -n \-`cat .name` >> .ver1; fi
350         @LANG=C echo ' '`date` >> .ver1
351         @echo \#define UTS_VERSION \"`cat .ver1 | $(uts_truncate)`\" > .ver
352         @LANG=C echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> .ver
353         @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> .ver
354         @echo \#define LINUX_COMPILE_HOST \"`hostname | $(uts_truncate)`\" >> .ver
355         @([ -x /bin/dnsdomainname ] && /bin/dnsdomainname > .ver1) || \
356          ([ -x /bin/domainname ] && /bin/domainname > .ver1) || \
357          echo > .ver1
358         @echo \#define LINUX_COMPILE_DOMAIN \"`cat .ver1 | $(uts_truncate)`\" >> .ver
359         @echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -n 1`\" >> .ver
360         @mv -f .ver $@
361         @rm -f .ver1
362 
363 include/linux/version.h: ./Makefile
364         @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
365           (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
366         @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
367         @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
368         @echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver
369         @mv -f .ver $@
370 
371 comma   := ,
372 
373 init/version.o: init/version.c include/linux/compile.h include/config/MARKER
374         $(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DUTS_MACHINE='"$(ARCH)"' -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o init/version.o init/version.c
375 
376 init/main.o: init/main.c include/config/MARKER
377         $(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
378 
379 init/do_mounts.o: init/do_mounts.c include/config/MARKER
380         $(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
381 
382 fs lib mm ipc kernel drivers net: dummy
383         $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
384 
385 TAGS: dummy
386         { find include/asm-${ARCH} -name '*.h' -print ; \
387         find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print ; \
388         find $(SUBDIRS) init arch/${ARCH} -name '*.[chS]' ; } | grep -v SCCS | grep -v '\.svn' | etags -
389 
390 # Exuberant ctags works better with -I
391 tags: dummy
392         CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
393         ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
394         find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
395         find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a
396 
397 ifdef CONFIG_MODULES
398 ifdef CONFIG_MODVERSIONS
399 MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
400 endif
401 
402 .PHONY: modules
403 modules: $(patsubst %, _mod_%, $(SUBDIRS))
404 
405 .PHONY: $(patsubst %, _mod_%, $(SUBDIRS))
406 $(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER
407         $(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules
408 
409 .PHONY: modules_install
410 modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post
411 
412 .PHONY: _modinst_
413 _modinst_:
414         @rm -rf $(MODLIB)/kernel
415         @rm -f $(MODLIB)/build
416         @mkdir -p $(MODLIB)/kernel
417         @ln -s $(TOPDIR) $(MODLIB)/build
418 
419 # If System.map exists, run depmod.  This deliberately does not have a
420 # dependency on System.map since that would run the dependency tree on
421 # vmlinux.  This depmod is only for convenience to give the initial
422 # boot a modules.dep even before / is mounted read-write.  However the
423 # boot script depmod is the master version.
424 ifeq "$(strip $(INSTALL_MOD_PATH))" ""
425 depmod_opts     :=
426 else
427 depmod_opts     := -b $(INSTALL_MOD_PATH) -r
428 endif
429 .PHONY: _modinst_post
430 _modinst_post: _modinst_post_pcmcia
431         if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
432 
433 # Backwards compatibilty symlinks for people still using old versions
434 # of pcmcia-cs with hard coded pathnames on insmod.  Remove
435 # _modinst_post_pcmcia for kernel 2.4.1.
436 .PHONY: _modinst_post_pcmcia
437 _modinst_post_pcmcia:
438         cd $(MODLIB); \
439         mkdir -p pcmcia; \
440         find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
441 
442 .PHONY: $(patsubst %, _modinst_%, $(SUBDIRS))
443 $(patsubst %, _modinst_%, $(SUBDIRS)) :
444         $(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install
445 
446 # modules disabled....
447 
448 else
449 modules modules_install: dummy
450         @echo
451         @echo "The present kernel configuration has modules disabled."
452         @echo "Type 'make config' and enable loadable module support."
453         @echo "Then build a kernel with module support enabled."
454         @echo
455         @exit 1
456 endif
457 
458 clean:  archclean
459         find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \
460                 | grep -v lxdialog/ | xargs rm -f
461         rm -f $(CLEAN_FILES)
462         rm -rf $(CLEAN_DIRS)
463         $(MAKE) -C Documentation/DocBook clean
464 
465 mrproper: clean archmrproper
466         find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f
467         rm -f $(MRPROPER_FILES)
468         rm -rf $(MRPROPER_DIRS)
469         $(MAKE) -C Documentation/DocBook mrproper
470 
471 distclean: mrproper
472         rm -f core `find . \( -not -type d \) -and \
473                 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
474                 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
475                 -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
476 
477 backup: mrproper
478         cd .. && tar cf - linux/ | gzip -9 > backup.gz
479         sync
480 
481 sgmldocs: 
482         chmod 755 $(TOPDIR)/scripts/docgen
483         chmod 755 $(TOPDIR)/scripts/gen-all-syms
484         chmod 755 $(TOPDIR)/scripts/kernel-doc
485         $(MAKE) -C $(TOPDIR)/Documentation/DocBook books
486 
487 psdocs: sgmldocs
488         $(MAKE) -C Documentation/DocBook ps
489 
490 pdfdocs: sgmldocs
491         $(MAKE) -C Documentation/DocBook pdf
492 
493 htmldocs: sgmldocs
494         $(MAKE) -C Documentation/DocBook html
495 
496 mandocs:
497         chmod 755 $(TOPDIR)/scripts/kernel-doc
498         chmod 755 $(TOPDIR)/scripts/split-man
499         $(MAKE) -C Documentation/DocBook man
500 
501 sums:
502         find . -type f -print | sort | xargs sum > .SUMS
503 
504 dep-files: scripts/mkdep archdep include/linux/version.h
505         rm -f .depend .hdepend
506         $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
507 ifdef CONFIG_MODVERSIONS
508         $(MAKE) update-modverfile
509 endif
510         scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
511         scripts/mkdep -- init/*.c > .depend
512 
513 ifdef CONFIG_MODVERSIONS
514 MODVERFILE := $(TOPDIR)/include/linux/modversions.h
515 else
516 MODVERFILE :=
517 endif
518 export  MODVERFILE
519 
520 depend dep: dep-files
521 
522 checkconfig:
523         find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl
524 
525 checkhelp:
526         find * -name [cC]onfig.in -print | sort | xargs $(PERL) -w scripts/checkhelp.pl
527 
528 checkincludes:
529         find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl
530 
531 ifdef CONFIGURATION
532 ..$(CONFIGURATION):
533         @echo
534         @echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'"
535         @echo
536         $(MAKE) $(CONFIGURATION)
537         @echo
538         @echo "Successful. Try re-making (ignore the error that follows)"
539         @echo
540         exit 1
541 
542 #dummy: ..$(CONFIGURATION)
543 dummy:
544 
545 else
546 
547 dummy:
548 
549 endif
550 
551 include Rules.make
552 
553 #
554 # This generates dependencies for the .h files.
555 #
556 
557 scripts/mkdep: scripts/mkdep.c
558         $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
559 
560 scripts/split-include: scripts/split-include.c
561         $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
562 
563 #
564 # RPM target
565 #
566 #       If you do a make spec before packing the tarball you can rpm -ta it
567 #
568 spec:
569         . scripts/mkspec >kernel.spec
570 
571 #
572 #       Build a tar ball, generate an rpm from it and pack the result
573 #       There arw two bits of magic here
574 #       1) The use of /. to avoid tar packing just the symlink
575 #       2) Removing the .dep files as they have source paths in them that
576 #          will become invalid
577 #
578 rpm:    clean spec
579         find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
580         set -e; \
581         cd $(TOPDIR)/.. ; \
582         ln -sf $(TOPDIR) $(KERNELPATH) ; \
583         tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
584         rm $(KERNELPATH) ; \
585         cd $(TOPDIR) ; \
586         . scripts/mkversion > .version ; \
587         $(RPM) -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
588         rm $(TOPDIR)/../$(KERNELPATH).tar.gz

This page was automatically generated by LXR 0.3.1 (source).  •  Linux is a registered trademark of Linus Torvalds  •  Contact us