ia64/xen-unstable

view linux-2.4-xen-sparse/Makefile @ 7072:f9296342d9b2

Detangle the restart/reboot/halt/save/restore code. There is now one point
for management of shutdown state, XendDomainInfo.refreshShutdown, which is
able to cope whatever the current state of the domain. This fixes bug #124:
running reboot within a domU doesn't bring the domain back up after shutdown,
and bug #256: "xm reboot" could not make domU reboot.

Fix the refreshing inside XendDomain to ensure that the values returned by xm
list reflect reality correctly. We were removing XendDomainInfo instances,
but not creating them on start-up, so if xend were restarted, domain
information was being lost.

Merge XendDomain.dom0_unknown and initial_refresh into
XendDomainInfo.recreate.

Catch exceptions inside callInfo, and reraise them as XendErrors.

Remove unused XendDomain.close.

Further improvements are needed to XendDomainInfo to ensure that it avoids all
race conditions on shutdown, and can cope correctly with xend restarting
during a shutdown.

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