Version:
~ [ 0.6-2.3.46 ] ~
Architecture:
~ [ um ] ~
1 VERSION = 2
2 PATCHLEVEL = 3
3 SUBLEVEL = 46
4 EXTRAVERSION =
5
6 #ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
7 ARCH = um
8
9 .EXPORT_ALL_VARIABLES:
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 if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
15
16 HPATH = $(TOPDIR)/include
17 FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net
18
19 HOSTCC =gcc
20 HOSTCFLAGS =-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
21
22 CROSS_COMPILE =
23
24 AS =$(CROSS_COMPILE)as
25 LD =$(CROSS_COMPILE)ld
26 CC =$(CROSS_COMPILE)gcc
27 CPP =$(CC) -E
28 AR =$(CROSS_COMPILE)ar
29 NM =$(CROSS_COMPILE)nm
30 STRIP =$(CROSS_COMPILE)strip
31 OBJDUMP =$(CROSS_COMPILE)objdump
32 MAKE =make
33 GENKSYMS=/sbin/genksyms
34
35 all: do-it-all
36
37 #
38 # Make "config" the default target if there is no configuration file or
39 # "depend" the target if there is no top-level dependency information.
40 #
41 ifeq (.config,$(wildcard .config))
42 include .config
43 ifeq (.depend,$(wildcard .depend))
44 include .depend
45 do-it-all: Version vmlinux
46 else
47 CONFIGURATION = depend
48 do-it-all: depend
49 endif
50 else
51 CONFIGURATION = config
52 do-it-all: config
53 endif
54
55 #
56 # ROOT_DEV specifies the default root-device when making the image.
57 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
58 # the default of FLOPPY is used by 'build'.
59 #
60
61 ROOT_DEV = CURRENT
62
63 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
64
65 #
66 # INSTALL_PATH specifies where to place the updated kernel and system map
67 # images. Uncomment if you want to place them anywhere other than root.
68
69 #INSTALL_PATH=/boot
70
71 #
72 # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
73 # relocations required by build roots. This is not defined in the
74 # makefile but the arguement can be passed to make if needed.
75 #
76
77 #
78 # If you want to preset the SVGA mode, uncomment the next line and
79 # set SVGA_MODE to whatever number you want.
80 # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
81 # The number is the same as you would ordinarily press at bootup.
82 #
83
84 SVGA_MODE= -DSVGA_MODE=NORMAL_VGA
85
86 #
87 # standard CFLAGS
88 #
89
90 CPPFLAGS := -D__KERNEL__ -I$(HPATH)
91
92 ifdef CONFIG_SMP
93 CPPFLAGS += -D__SMP__
94 endif
95
96 CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
97 AFLAGS := $(CPPFLAGS)
98
99 # use '-fno-strict-aliasing', but only if the compiler can take it
100 CFLAGS += $(shell if $(CC) -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-strict-aliasing"; fi)
101
102 #
103 # if you want the RAM disk device, define this to be the
104 # size in blocks.
105 #
106
107 #RAMDISK = -DRAMDISK=512
108
109 # Include the make variables (CC, etc...)
110 #
111
112 CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
113 NETWORKS =net/network.a
114 DRIVERS =drivers/block/block.a \
115 drivers/char/char.o \
116 drivers/misc/misc.o \
117 drivers/net/net.o \
118 drivers/parport/parport.a
119 LIBS =$(TOPDIR)/lib/lib.a
120 SUBDIRS =kernel drivers mm fs net ipc lib
121
122 ifdef CONFIG_DRM
123 DRIVERS += drivers/char/drm/drm.o
124 endif
125
126 ifeq ($(CONFIG_AGP),y)
127 DRIVERS += drivers/char/agp/agp.o
128 endif
129
130 ifdef CONFIG_NUBUS
131 DRIVERS := $(DRIVERS) drivers/nubus/nubus.a
132 endif
133
134 ifeq ($(CONFIG_ISDN),y)
135 DRIVERS := $(DRIVERS) drivers/isdn/isdn.a
136 endif
137
138 ifdef CONFIG_NET_FC
139 DRIVERS := $(DRIVERS) drivers/net/fc/fc.a
140 endif
141
142 ifdef CONFIG_TR
143 DRIVERS := $(DRIVERS) drivers/net/tokenring/tr.a
144 endif
145
146 ifdef CONFIG_WAN
147 DRIVERS := $(DRIVERS) drivers/net/wan/wan.a
148 endif
149
150 ifeq ($(CONFIG_ARCNET),y)
151 DRIVERS := $(DRIVERS) drivers/net/arcnet/arcnet.a
152 endif
153
154 ifdef CONFIG_ATM
155 DRIVERS := $(DRIVERS) drivers/atm/atm.a
156 endif
157
158 ifeq ($(CONFIG_SCSI),y)
159 DRIVERS := $(DRIVERS) drivers/scsi/scsi.a
160 endif
161
162 ifeq ($(CONFIG_IEEE1394),y)
163 DRIVERS := $(DRIVERS) drivers/ieee1394/ieee1394.a
164 endif
165
166 ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),)
167 DRIVERS := $(DRIVERS) drivers/cdrom/cdrom.a
168 endif
169
170 ifeq ($(CONFIG_SOUND),y)
171 DRIVERS := $(DRIVERS) drivers/sound/sounddrivers.o
172 endif
173
174 ifdef CONFIG_PCI
175 DRIVERS := $(DRIVERS) drivers/pci/pci.a
176 endif
177
178 ifeq ($(CONFIG_PCMCIA),y)
179 DRIVERS := $(DRIVERS) drivers/pcmcia/pcmcia.o
180 endif
181
182 ifeq ($(CONFIG_PCMCIA_NETCARD),y)
183 DRIVERS := $(DRIVERS) drivers/net/pcmcia/pcmcia_net.o
184 endif
185
186 ifeq ($(CONFIG_PCMCIA_CHRDEV),y)
187 DRIVERS := $(DRIVERS) drivers/char/pcmcia/pcmcia_char.o
188 endif
189
190 ifdef CONFIG_DIO
191 DRIVERS := $(DRIVERS) drivers/dio/dio.a
192 endif
193
194 ifdef CONFIG_SBUS
195 DRIVERS := $(DRIVERS) drivers/sbus/sbus.a
196 endif
197
198 ifdef CONFIG_ZORRO
199 DRIVERS := $(DRIVERS) drivers/zorro/zorro.a
200 endif
201
202 ifeq ($(CONFIG_FC4),y)
203 DRIVERS := $(DRIVERS) drivers/fc4/fc4.a
204 endif
205
206 ifdef CONFIG_PPC
207 DRIVERS := $(DRIVERS) drivers/macintosh/macintosh.a
208 endif
209
210 ifeq ($(CONFIG_ISAPNP),y)
211 DRIVERS := $(DRIVERS) drivers/pnp/pnp.o
212 endif
213
214 ifdef CONFIG_SGI
215 DRIVERS := $(DRIVERS) drivers/sgi/sgi.a
216 endif
217
218 ifdef CONFIG_VT
219 DRIVERS := $(DRIVERS) drivers/video/video.o
220 endif
221
222 ifeq ($(CONFIG_PARIDE),y)
223 DRIVERS := $(DRIVERS) drivers/block/paride/paride.a
224 endif
225
226 ifdef CONFIG_HAMRADIO
227 DRIVERS := $(DRIVERS) drivers/net/hamradio/hamradio.o
228 endif
229
230 ifeq ($(CONFIG_TC),y)
231 DRIVERS := $(DRIVERS) drivers/tc/tc.a
232 endif
233
234 ifeq ($(CONFIG_USB),y)
235 DRIVERS := $(DRIVERS) drivers/usb/usbdrv.o
236 endif
237
238 ifeq ($(CONFIG_I2O),y)
239 DRIVERS := $(DRIVERS) drivers/i2o/i2o.a
240 endif
241
242 ifeq ($(CONFIG_IRDA),y)
243 DRIVERS := $(DRIVERS) drivers/net/irda/irda_drivers.a
244 endif
245
246 ifeq ($(CONFIG_I2C),y)
247 DRIVERS := $(DRIVERS) drivers/i2c/i2c.a
248 endif
249
250 ifeq ($(CONFIG_PHONE),y)
251 DRIVERS := $(DRIVERS) drivers/telephony/telephony.a
252 endif
253
254 include arch/$(ARCH)/Makefile
255
256 .S.s:
257 $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.s $<
258 .S.o:
259 $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $<
260
261 Version: dummy
262 @rm -f include/linux/compile.h
263
264 boot: vmlinux
265 @$(MAKE) -C arch/$(ARCH)/boot
266
267 vmlinux: $(CONFIGURATION) init/main.o init/version.o linuxsubdirs
268 $(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o \
269 --start-group \
270 $(CORE_FILES) \
271 $(NETWORKS) \
272 $(DRIVERS) \
273 $(LIBS) \
274 --end-group \
275 -o vmlinux
276 $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
277
278 symlinks:
279 rm -f include/asm
280 ( cd include ; ln -sf asm-$(ARCH) asm)
281 @if [ ! -d include/linux/modules ]; then \
282 mkdir include/linux/modules; \
283 fi
284
285 oldconfig: symlinks
286 $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
287
288 xconfig: symlinks
289 $(MAKE) -C scripts kconfig.tk
290 wish -f scripts/kconfig.tk
291
292 menuconfig: include/linux/version.h symlinks
293 $(MAKE) -C scripts/lxdialog all
294 $(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in
295
296 config: symlinks
297 $(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
298
299 include/config/MARKER: scripts/split-include include/linux/autoconf.h
300 scripts/split-include include/linux/autoconf.h include/config
301 @ touch include/config/MARKER
302
303 linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
304
305 $(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER
306 $(MAKE) -C $(patsubst _dir_%, %, $@)
307
308 $(TOPDIR)/include/linux/version.h: include/linux/version.h
309 $(TOPDIR)/include/linux/compile.h: include/linux/compile.h
310
311 newversion:
312 @if [ ! -f .version ]; then \
313 echo 1 > .version; \
314 else \
315 expr 0`cat .version` + 1 > .version; \
316 fi
317
318 include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
319 @echo -n \#define UTS_VERSION \"\#`cat .version` > .ver
320 @if [ -n "$(CONFIG_SMP)" ] ; then echo -n " SMP" >> .ver; fi
321 @if [ -f .name ]; then echo -n \-`cat .name` >> .ver; fi
322 @echo ' '`date`'"' >> .ver
323 @echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> .ver
324 @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> .ver
325 @echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> .ver
326 @if [ -x /bin/dnsdomainname ]; then \
327 echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname`\"; \
328 elif [ -x /bin/domainname ]; then \
329 echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\"; \
330 else \
331 echo \#define LINUX_COMPILE_DOMAIN ; \
332 fi >> .ver
333 @echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -1`\" >> .ver
334 @mv -f .ver $@
335
336 include/linux/version.h: ./Makefile
337 @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
338 @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
339 @echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver
340 @mv -f .ver $@
341
342 init/version.o: init/version.c include/linux/compile.h include/config/MARKER
343 $(CC) $(CFLAGS) -DUTS_MACHINE='"$(ARCH)"' -c -o init/version.o init/version.c
344
345 init/main.o: init/main.c include/config/MARKER
346 $(CC) $(CFLAGS) $(PROFILING) -c -o $*.o $<
347
348 fs lib mm ipc kernel drivers net: dummy
349 $(MAKE) $(subst $@, _dir_$@, $@)
350
351 TAGS: dummy
352 etags `find include/asm-$(ARCH) -name '*.h'`
353 find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs etags -a
354 find $(SUBDIRS) init -name '*.c' | xargs etags -a
355
356 # Exuberant ctags works better with -I
357 tags: dummy
358 CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__initlocaldata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
359 ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
360 find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
361 find $(SUBDIRS) init -name '*.c' | xargs ctags $$CTAGSF -a
362
363 MODFLAGS = -DMODULE
364 ifdef CONFIG_MODULES
365 ifdef CONFIG_MODVERSIONS
366 MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
367 endif
368
369 modules: $(patsubst %, _mod_%, $(SUBDIRS))
370
371 modules/MARKER:
372 mkdir -p modules
373 touch modules/MARKER
374
375 $(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER modules/MARKER
376 $(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules
377
378 modules_install:
379 @( \
380 MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE); \
381 cd modules; \
382 MODULES=""; \
383 inst_mod() { These="`cat $$1`"; MODULES="$$MODULES $$These"; \
384 mkdir -p $$MODLIB/$$2; cp $$These $$MODLIB/$$2; \
385 echo Installing modules under $$MODLIB/$$2; \
386 }; \
387 mkdir -p $$MODLIB; \
388 \
389 if [ -f BLOCK_MODULES ]; then inst_mod BLOCK_MODULES block; fi; \
390 if [ -f NET_MODULES ]; then inst_mod NET_MODULES net; fi; \
391 if [ -f IPV4_MODULES ]; then inst_mod IPV4_MODULES ipv4; fi; \
392 if [ -f IPV6_MODULES ]; then inst_mod IPV6_MODULES ipv6; fi; \
393 if [ -f ATM_MODULES ]; then inst_mod ATM_MODULES atm; fi; \
394 if [ -f SCSI_MODULES ]; then inst_mod SCSI_MODULES scsi; fi; \
395 if [ -f FS_MODULES ]; then inst_mod FS_MODULES fs; fi; \
396 if [ -f NLS_MODULES ]; then inst_mod NLS_MODULES fs; fi; \
397 if [ -f CDROM_MODULES ]; then inst_mod CDROM_MODULES cdrom; fi; \
398 if [ -f HAM_MODULES ]; then inst_mod HAM_MODULES net; fi; \
399 if [ -f SOUND_MODULES ]; then inst_mod SOUND_MODULES sound; fi; \
400 if [ -f VIDEO_MODULES ]; then inst_mod VIDEO_MODULES video; fi; \
401 if [ -f FC4_MODULES ]; then inst_mod FC4_MODULES fc4; fi; \
402 if [ -f IRDA_MODULES ]; then inst_mod IRDA_MODULES net; fi; \
403 if [ -f SK98LIN_MODULES ]; then inst_mod SK98LIN_MODULES net; fi; \
404 if [ -f USB_MODULES ]; then inst_mod USB_MODULES usb; fi; \
405 if [ -f IEEE1394_MODULES ]; then inst_mod IEEE1394_MODULES ieee1394; fi; \
406 if [ -f PCMCIA_MODULES ]; then inst_mod PCMCIA_MODULES pcmcia; fi; \
407 if [ -f PCMCIA_NET_MODULES ]; then inst_mod PCMCIA_NET_MODULES pcmcia; fi; \
408 if [ -f PCMCIA_CHAR_MODULES ]; then inst_mod PCMCIA_CHAR_MODULES pcmcia; fi; \
409 if [ -f PCMCIA_SCSI_MODULES ]; then inst_mod PCMCIA_SCSI_MODULES pcmcia; fi; \
410 \
411 ls -1 -U *.o | sort > $$MODLIB/.allmods; \
412 echo $$MODULES | tr ' ' '\n' | sort | comm -23 $$MODLIB/.allmods - > $$MODLIB/.misc; \
413 if [ -s $$MODLIB/.misc ]; then inst_mod $$MODLIB/.misc misc; fi; \
414 rm -f $$MODLIB/.misc $$MODLIB/.allmods; \
415 )
416
417 # modules disabled....
418
419 else
420 modules modules_install: dummy
421 @echo
422 @echo "The present kernel configuration has modules disabled."
423 @echo "Type 'make config' and enable loadable module support."
424 @echo "Then build a kernel with module support enabled."
425 @echo
426 @exit 1
427 endif
428
429 clean: archclean
430 rm -f kernel/ksyms.lst include/linux/compile.h
431 find . -name '*.[oas]' -type f -print | grep -v lxdialog/ | xargs rm -f
432 rm -f core `find . -type f -name 'core' -print`
433 rm -f core `find . -type f -name '.*.flags' -print`
434 rm -f vmlinux System.map
435 rm -f .tmp*
436 rm -f drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c
437 rm -f drivers/char/conmakehash
438 rm -f drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist
439 rm -f drivers/sound/bin2hex drivers/sound/hex2hex
440 rm -f net/khttpd/make_times_h
441 rm -f net/khttpd/times.h
442 rm -f submenu*
443 rm -rf modules
444
445 mrproper: clean archmrproper
446 rm -f include/linux/autoconf.h include/linux/version.h
447 rm -f drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h
448 rm -f drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h
449 rm -f drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h
450 rm -f drivers/net/hamradio/soundmodem/gentbl
451 rm -f drivers/char/hfmodem/gentbl drivers/char/hfmodem/tables.h
452 rm -f drivers/sound/*_boot.h drivers/sound/.*.boot
453 rm -f drivers/sound/msndinit.c
454 rm -f drivers/sound/msndperm.c
455 rm -f drivers/sound/pndsperm.c
456 rm -f drivers/sound/pndspini.c
457 rm -f .version .config* config.in config.old
458 rm -f scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp
459 rm -f scripts/lxdialog/*.o scripts/lxdialog/lxdialog
460 rm -f .menuconfig.log
461 rm -f include/asm
462 rm -rf include/config
463 rm -f .depend `find . -type f -name .depend -print`
464 rm -f core `find . -type f -size 0 -print`
465 rm -f .hdepend scripts/mkdep scripts/split-include
466 rm -f $(TOPDIR)/include/linux/modversions.h
467 rm -rf $(TOPDIR)/include/linux/modules
468
469 distclean: mrproper
470 rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
471 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
472 -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS tags
473
474 backup: mrproper
475 cd .. && tar cf - linux/ | gzip -9 > backup.gz
476 sync
477
478 sums:
479 find . -type f -print | sort | xargs sum > .SUMS
480
481 dep-files: scripts/mkdep archdep include/linux/version.h
482 scripts/mkdep init/*.c > .depend
483 scripts/mkdep `find $(FINDHPATH) -follow -name \*.h ! -name modversions.h -print` > .hdepend
484 $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
485
486 MODVERFILE :=
487
488 ifdef CONFIG_MODVERSIONS
489 MODVERFILE := $(TOPDIR)/include/linux/modversions.h
490 endif
491
492 depend dep: dep-files $(MODVERFILE)
493
494 # make checkconfig: Prune 'scripts' directory to avoid "false positives".
495 checkconfig:
496 find * -name '*.[hcS]' -type f -print | grep -v scripts/ | sort | xargs perl -w scripts/checkconfig.pl
497
498 checkhelp:
499 perl -w scripts/checkhelp.pl `find * -name [cC]onfig.in -print`
500
501 ifdef CONFIGURATION
502 ..$(CONFIGURATION):
503 @echo
504 @echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'"
505 @echo
506 $(MAKE) $(CONFIGURATION)
507 @echo
508 @echo "Successful. Try re-making (ignore the error that follows)"
509 @echo
510 exit 1
511
512 #dummy: ..$(CONFIGURATION)
513 dummy:
514
515 else
516
517 dummy:
518
519 endif
520
521 include Rules.make
522
523 #
524 # This generates dependencies for the .h files.
525 #
526
527 scripts/mkdep: scripts/mkdep.c
528 $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
529
530 scripts/split-include: scripts/split-include.c
531 $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.