| 1 | VERSION = 2 |
|---|
| 2 | PATCHLEVEL = 4 |
|---|
| 3 | SUBLEVEL = 35 |
|---|
| 4 | EXTRAVERSION = |
|---|
| 5 | |
|---|
| 6 | KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
|---|
| 7 | |
|---|
| 8 | ARCH = mips |
|---|
| 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 -Os -fomit-frame-pointer |
|---|
| 21 | |
|---|
| 22 | CROSS_COMPILE = mipsel-linux- |
|---|
| 23 | |
|---|
| 24 | # |
|---|
| 25 | # Include the make variables (CC, etc...) |
|---|
| 26 | # |
|---|
| 27 | |
|---|
| 28 | AS = /opt/3.3.4/bin/$(CROSS_COMPILE)as |
|---|
| 29 | LD = /opt/3.3.4/bin/$(CROSS_COMPILE)ld |
|---|
| 30 | CC = /opt/3.3.4/bin/$(CROSS_COMPILE)gcc |
|---|
| 31 | CPP = $(CC) -E |
|---|
| 32 | AR = /opt/3.3.4/bin/$(CROSS_COMPILE)ar |
|---|
| 33 | NM = /opt/3.3.4/bin/$(CROSS_COMPILE)nm |
|---|
| 34 | STRIP = /opt/3.3.4/bin/$(CROSS_COMPILE)strip |
|---|
| 35 | OBJCOPY = /opt/3.3.4/bin/$(CROSS_COMPILE)objcopy |
|---|
| 36 | OBJDUMP = /opt/3.3.4/bin/$(CROSS_COMPILE)objdump |
|---|
| 37 | MAKEFILES = $(TOPDIR)/.config |
|---|
| 38 | GENKSYMS = /sbin/genksyms |
|---|
| 39 | DEPMOD = /sbin/depmod |
|---|
| 40 | MODFLAGS = -DMODULE |
|---|
| 41 | CFLAGS_KERNEL = -fno-delayed-branch |
|---|
| 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 | check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) |
|---|
| 93 | if_gcc4 = $(shell if echo __GNUC__ | $(CC) -E -xc - | grep -q '^4$$' > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) |
|---|
| 94 | |
|---|
| 95 | CPPFLAGS := -D__KERNEL__ -I$(HPATH) |
|---|
| 96 | |
|---|
| 97 | CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ |
|---|
| 98 | -fno-strict-aliasing -fno-common |
|---|
| 99 | CFLAGS += -fno-builtin-strpbrk -fno-builtin-sprintf |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | ifndef CONFIG_FRAME_POINTER |
|---|
| 103 | CFLAGS += -fomit-frame-pointer |
|---|
| 104 | endif |
|---|
| 105 | AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) |
|---|
| 106 | |
|---|
| 107 | CFLAGS += $(call check_gcc, -funit-at-a-time,) |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | # disable pointer signedness warnings in gcc 4.0 |
|---|
| 111 | CFLAGS += $(call check_gcc,-Wno-pointer-sign,) |
|---|
| 112 | |
|---|
| 113 | CFLAGS += -fno-delayed-branch |
|---|
| 114 | CFLAGS += $(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 | |
|---|
| 126 | export 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 | |
|---|
| 136 | export 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 | |
|---|
| 145 | CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o |
|---|
| 146 | NETWORKS =net/network.o |
|---|
| 147 | |
|---|
| 148 | LIBS =$(TOPDIR)/lib/lib.a |
|---|
| 149 | SUBDIRS =kernel drivers mm fs net ipc lib crypto |
|---|
| 150 | |
|---|
| 151 | DRIVERS-n := |
|---|
| 152 | DRIVERS-y := |
|---|
| 153 | DRIVERS-m := |
|---|
| 154 | DRIVERS- := |
|---|
| 155 | |
|---|
| 156 | DRIVERS-$(CONFIG_ACPI_BOOT) += drivers/acpi/acpi.o |
|---|
| 157 | DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o |
|---|
| 158 | DRIVERS-y += drivers/char/char.o \ |
|---|
| 159 | drivers/block/block.o \ |
|---|
| 160 | drivers/misc/misc.o \ |
|---|
| 161 | drivers/net/net.o |
|---|
| 162 | DRIVERS-$(CONFIG_AGP) += drivers/char/agp/agp.o |
|---|
| 163 | DRIVERS-$(CONFIG_DRM_NEW) += drivers/char/drm/drm.o |
|---|
| 164 | DRIVERS-$(CONFIG_DRM_OLD) += drivers/char/drm-4.0/drm.o |
|---|
| 165 | DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a |
|---|
| 166 | DRIVERS-$(CONFIG_NET_FC) += drivers/net/fc/fc.o |
|---|
| 167 | DRIVERS-$(CONFIG_DEV_APPLETALK) += drivers/net/appletalk/appletalk.o |
|---|
| 168 | DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.o |
|---|
| 169 | DRIVERS-$(CONFIG_WAN) += drivers/net/wan/wan.o |
|---|
| 170 | DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnetdrv.o |
|---|
| 171 | DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o |
|---|
| 172 | DRIVERS-$(CONFIG_IDE) += drivers/ide/idedriver.o |
|---|
| 173 | DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a |
|---|
| 174 | DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o |
|---|
| 175 | DRIVERS-$(CONFIG_FUSION_BOOT) += drivers/message/fusion/fusion.o |
|---|
| 176 | DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o |
|---|
| 177 | |
|---|
| 178 | ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),) |
|---|
| 179 | DRIVERS-y += drivers/cdrom/driver.o |
|---|
| 180 | endif |
|---|
| 181 | |
|---|
| 182 | DRIVERS-$(CONFIG_SOUND) += drivers/sound/sounddrivers.o |
|---|
| 183 | DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o |
|---|
| 184 | DRIVERS-$(CONFIG_MTD) += drivers/mtd/mtdlink.o |
|---|
| 185 | DRIVERS-$(CONFIG_PCMCIA) += drivers/pcmcia/pcmcia.o |
|---|
| 186 | DRIVERS-$(CONFIG_NET_PCMCIA) += drivers/net/pcmcia/pcmcia_net.o |
|---|
| 187 | DRIVERS-$(CONFIG_NET_WIRELESS) += drivers/net/wireless/wireless_net.o |
|---|
| 188 | DRIVERS-$(CONFIG_PCMCIA_CHRDEV) += drivers/char/pcmcia/pcmcia_char.o |
|---|
| 189 | DRIVERS-$(CONFIG_DIO) += drivers/dio/dio.a |
|---|
| 190 | DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o |
|---|
| 191 | DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o |
|---|
| 192 | DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a |
|---|
| 193 | DRIVERS-$(CONFIG_PPC32) += drivers/macintosh/macintosh.o |
|---|
| 194 | DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o |
|---|
| 195 | DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o |
|---|
| 196 | DRIVERS-$(CONFIG_I2C) += drivers/i2c/i2c.o |
|---|
| 197 | DRIVERS-$(CONFIG_VT) += drivers/video/video.o |
|---|
| 198 | DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a |
|---|
| 199 | DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o |
|---|
| 200 | DRIVERS-$(CONFIG_TC) += drivers/tc/tc.a |
|---|
| 201 | DRIVERS-$(CONFIG_USB) += drivers/usb/usbdrv.o |
|---|
| 202 | DRIVERS-$(CONFIG_USB_GADGET) += drivers/usb/gadget/built-in.o |
|---|
| 203 | DRIVERS-y +=drivers/media/media.o |
|---|
| 204 | DRIVERS-$(CONFIG_INPUT) += drivers/input/inputdrv.o |
|---|
| 205 | DRIVERS-$(CONFIG_HIL) += drivers/hil/hil.o |
|---|
| 206 | DRIVERS-$(CONFIG_I2O) += drivers/message/i2o/i2o.o |
|---|
| 207 | DRIVERS-$(CONFIG_IRDA) += drivers/net/irda/irda.o |
|---|
| 208 | DRIVERS-$(CONFIG_PHONE) += drivers/telephony/telephony.o |
|---|
| 209 | DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o |
|---|
| 210 | DRIVERS-$(CONFIG_GSC) += drivers/gsc/gscbus.o |
|---|
| 211 | DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o |
|---|
| 212 | DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o |
|---|
| 213 | DRIVERS-$(CONFIG_ISDN_BOOL) += drivers/isdn/vmlinux-obj.o |
|---|
| 214 | DRIVERS-$(CONFIG_CRYPTO) += crypto/crypto.o |
|---|
| 215 | |
|---|
| 216 | DRIVERS := $(DRIVERS-y) |
|---|
| 217 | |
|---|
| 218 | |
|---|
| 219 | # files removed with 'make clean' |
|---|
| 220 | CLEAN_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' |
|---|
| 247 | CLEAN_DIRS = \ |
|---|
| 248 | modules |
|---|
| 249 | |
|---|
| 250 | # files removed with 'make mrproper' |
|---|
| 251 | MRPROPER_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' |
|---|
| 274 | MRPROPER_DIRS = \ |
|---|
| 275 | include/config \ |
|---|
| 276 | $(TOPDIR)/include/linux/modules |
|---|
| 277 | |
|---|
| 278 | |
|---|
| 279 | include 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 | |
|---|
| 288 | kbuild_2_4_nostdinc := -nostdinc -iwithprefix include |
|---|
| 289 | export kbuild_2_4_nostdinc |
|---|
| 290 | |
|---|
| 291 | export CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL |
|---|
| 292 | |
|---|
| 293 | export 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 | |
|---|
| 300 | Version: dummy |
|---|
| 301 | @rm -f include/linux/compile.h |
|---|
| 302 | |
|---|
| 303 | boot: vmlinux |
|---|
| 304 | @$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot |
|---|
| 305 | |
|---|
| 306 | vmlinux: 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 | |
|---|
| 317 | symlinks: |
|---|
| 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 | |
|---|
| 324 | oldconfig: symlinks |
|---|
| 325 | $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in |
|---|
| 326 | |
|---|
| 327 | xconfig: symlinks |
|---|
| 328 | $(MAKE) -C scripts kconfig.tk |
|---|
| 329 | wish -f scripts/kconfig.tk |
|---|
| 330 | |
|---|
| 331 | menuconfig: include/linux/version.h symlinks |
|---|
| 332 | $(MAKE) -C scripts/lxdialog all |
|---|
| 333 | $(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in |
|---|
| 334 | |
|---|
| 335 | config: symlinks |
|---|
| 336 | $(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in |
|---|
| 337 | |
|---|
| 338 | include/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 | |
|---|
| 342 | linuxsubdirs: $(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 | |
|---|
| 350 | newversion: |
|---|
| 351 | . scripts/mkversion > .tmpversion |
|---|
| 352 | @mv -f .tmpversion .version |
|---|
| 353 | |
|---|
| 354 | uts_len := 64 |
|---|
| 355 | uts_truncate := sed -e 's/\(.\{1,$(uts_len)\}\).*/\1/' |
|---|
| 356 | |
|---|
| 357 | include/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 | |
|---|
| 374 | include/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 | |
|---|
| 382 | comma := , |
|---|
| 383 | |
|---|
| 384 | init/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 | |
|---|
| 387 | init/main.o: init/main.c include/config/MARKER |
|---|
| 388 | $(CC) $(CFLAGS) -O1 $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $< |
|---|
| 389 | |
|---|
| 390 | init/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 | |
|---|
| 393 | fs lib mm ipc kernel drivers net: dummy |
|---|
| 394 | $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@) |
|---|
| 395 | |
|---|
| 396 | TAGS: 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 |
|---|
| 402 | tags: 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 | |
|---|
| 408 | ifdef CONFIG_MODULES |
|---|
| 409 | ifdef CONFIG_MODVERSIONS |
|---|
| 410 | MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h |
|---|
| 411 | endif |
|---|
| 412 | |
|---|
| 413 | .PHONY: modules |
|---|
| 414 | modules: $(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 |
|---|
| 421 | modules_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. |
|---|
| 435 | ifeq "$(strip $(INSTALL_MOD_PATH))" "" |
|---|
| 436 | depmod_opts := |
|---|
| 437 | else |
|---|
| 438 | depmod_opts := -b $(INSTALL_MOD_PATH) -r |
|---|
| 439 | endif |
|---|
| 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 | |
|---|
| 459 | else |
|---|
| 460 | modules 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 |
|---|
| 467 | endif |
|---|
| 468 | |
|---|
| 469 | clean: 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 | |
|---|
| 476 | mrproper: 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 | |
|---|
| 482 | distclean: 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 | |
|---|
| 489 | backup: mrproper |
|---|
| 490 | cd .. && tar cf - linux/ | gzip -9 > backup.gz |
|---|
| 491 | sync |
|---|
| 492 | |
|---|
| 493 | sgmldocs: |
|---|
| 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 | |
|---|
| 499 | psdocs: sgmldocs |
|---|
| 500 | $(MAKE) -C Documentation/DocBook ps |
|---|
| 501 | |
|---|
| 502 | pdfdocs: sgmldocs |
|---|
| 503 | $(MAKE) -C Documentation/DocBook pdf |
|---|
| 504 | |
|---|
| 505 | htmldocs: sgmldocs |
|---|
| 506 | $(MAKE) -C Documentation/DocBook html |
|---|
| 507 | |
|---|
| 508 | mandocs: |
|---|
| 509 | chmod 755 $(TOPDIR)/scripts/kernel-doc |
|---|
| 510 | chmod 755 $(TOPDIR)/scripts/split-man |
|---|
| 511 | $(MAKE) -C Documentation/DocBook man |
|---|
| 512 | |
|---|
| 513 | sums: |
|---|
| 514 | find . -type f -print | sort | env -i xargs sum > .SUMS |
|---|
| 515 | |
|---|
| 516 | dep-files: scripts/mkdep archdep include/linux/version.h |
|---|
| 517 | rm -f .depend .hdepend |
|---|
| 518 | $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" |
|---|
| 519 | ifdef CONFIG_MODVERSIONS |
|---|
| 520 | $(MAKE) update-modverfile |
|---|
| 521 | endif |
|---|
| 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 | |
|---|
| 525 | ifdef CONFIG_MODVERSIONS |
|---|
| 526 | MODVERFILE := $(TOPDIR)/include/linux/modversions.h |
|---|
| 527 | else |
|---|
| 528 | MODVERFILE := |
|---|
| 529 | endif |
|---|
| 530 | export MODVERFILE |
|---|
| 531 | |
|---|
| 532 | depend dep: dep-files |
|---|
| 533 | |
|---|
| 534 | checkconfig: |
|---|
| 535 | find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl |
|---|
| 536 | |
|---|
| 537 | checkhelp: |
|---|
| 538 | find * -name [cC]onfig.in -print | sort | xargs $(PERL) -w scripts/checkhelp.pl |
|---|
| 539 | |
|---|
| 540 | checkincludes: |
|---|
| 541 | find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl |
|---|
| 542 | |
|---|
| 543 | ifdef 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) |
|---|
| 555 | dummy: |
|---|
| 556 | |
|---|
| 557 | else |
|---|
| 558 | |
|---|
| 559 | dummy: |
|---|
| 560 | |
|---|
| 561 | endif |
|---|
| 562 | |
|---|
| 563 | include Rules.make |
|---|
| 564 | |
|---|
| 565 | # |
|---|
| 566 | # This generates dependencies for the .h files. |
|---|
| 567 | # |
|---|
| 568 | |
|---|
| 569 | scripts/mkdep: scripts/mkdep.c |
|---|
| 570 | $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c |
|---|
| 571 | |
|---|
| 572 | scripts/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 | # |
|---|
| 580 | spec: |
|---|
| 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 | # |
|---|
| 590 | rpm: 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 |
|---|