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