source: src/linux/brcm/linux.v24/Makefile @ 7744

Last change on this file since 7744 was 7744, checked in by BrainSlayer, 6 years ago

2.4.35.1 update

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