📄 makefile
字号:
VERSION = 1PATCHLEVEL = 0ALPHA =all: Version zImage.EXPORT_ALL_VARIABLES:CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ else echo sh; fi ; fi)## Make "config" the default target if there is no configuration file or# "depend" the target if there is no top-level dependency information.#ifeq (.config,$(wildcard .config))include .configifeq (.depend,$(wildcard .depend))include .dependelseCONFIGURATION = dependendifelseCONFIGURATION = configendififdef CONFIGURATIONCONFIGURE = dummyendif## ROOT_DEV specifies the default root-device when making the image.# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case# the default of FLOPPY is used by 'build'.#ROOT_DEV = CURRENT## If you want to preset the SVGA mode, uncomment the next line and# set SVGA_MODE to whatever number you want.# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.# The number is the same as you would ordinarily press at bootup.#SVGA_MODE= -DSVGA_MODE=NORMAL_VGA## standard CFLAGS#CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipeifdef CONFIG_CPPCFLAGS := $(CFLAGS) -x c++endififdef CONFIG_M486CFLAGS := $(CFLAGS) -m486elseCFLAGS := $(CFLAGS) -m386endif## if you want the ram-disk device, define this to be the# size in blocks.##RAMDISK = -DRAMDISK=512AS86 =as86 -0 -aLD86 =ld86 -0AS =asLD =ldHOSTCC =gccCC =gcc -D__KERNEL__MAKE =makeCPP =$(CC) -EAR =arSTRIP =stripARCHIVES =kernel/kernel.o mm/mm.o fs/fs.o net/net.o ipc/ipc.oFILESYSTEMS =fs/filesystems.aDRIVERS =drivers/block/block.a \ drivers/char/char.a \ drivers/net/net.a \ ibcs/ibcs.oLIBS =lib/lib.aSUBDIRS =kernel drivers mm fs net ipc ibcs libKERNELHDRS =/usr/src/linux/includeifdef CONFIG_SCSIDRIVERS := $(DRIVERS) drivers/scsi/scsi.aendififdef CONFIG_SOUNDDRIVERS := $(DRIVERS) drivers/sound/sound.aendififdef CONFIG_MATH_EMULATIONDRIVERS := $(DRIVERS) drivers/FPU-emu/math.aendif.c.s: $(CC) $(CFLAGS) -S -o $*.s $<.s.o: $(AS) -c -o $*.o $<.c.o: $(CC) $(CFLAGS) -c -o $*.o $<Version: dummy rm -f tools/version.hconfig: $(CONFIG_SHELL) Configure $(OPTS) < config.in @if grep -s '^CONFIG_SOUND' .tmpconfig ; then \ $(MAKE) -C drivers/sound config; \ else : ; fi mv .tmpconfig .configlinuxsubdirs: dummy set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; donetools/./version.h: tools/version.htools/version.h: $(CONFIGURE) Makefile @./makever.sh @echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL)$(ALPHA)\" > tools/version.h @echo \#define UTS_VERSION \"\#`cat .version` `date`\" >> tools/version.h @echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h @echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> tools/version.h @echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\" >> tools/version.htools/build: tools/build.c $(CONFIGURE) $(HOSTCC) $(CFLAGS) -o $@ $<boot/head.o: $(CONFIGURE) boot/head.sboot/head.s: boot/head.S $(CONFIGURE) include/linux/tasks.h $(CPP) -traditional $< -o $@tools/version.o: tools/version.c tools/version.hinit/main.o: $(CONFIGURE) init/main.c $(CC) $(CFLAGS) $(PROFILING) -c -o $*.o $<tools/system: boot/head.o init/main.o tools/version.o linuxsubdirs $(LD) $(LDFLAGS) -Ttext 1000 boot/head.o init/main.o tools/version.o \ $(ARCHIVES) \ $(FILESYSTEMS) \ $(DRIVERS) \ $(LIBS) \ -o tools/system nm tools/zSystem | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | \ sort > System.mapboot/setup: boot/setup.o $(LD86) -s -o $@ $<boot/setup.o: boot/setup.s $(AS86) -o $@ $<boot/setup.s: boot/setup.S $(CONFIGURE) include/linux/config.h Makefile $(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@boot/bootsect: boot/bootsect.o $(LD86) -s -o $@ $<boot/bootsect.o: boot/bootsect.s $(AS86) -o $@ $<boot/bootsect.s: boot/bootsect.S $(CONFIGURE) include/linux/config.h Makefile $(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@zBoot/zSystem: zBoot/*.c zBoot/*.S tools/zSystem $(MAKE) -C zBootzImage: $(CONFIGURE) boot/bootsect boot/setup zBoot/zSystem tools/build tools/build boot/bootsect boot/setup zBoot/zSystem $(ROOT_DEV) > zImage synczdisk: zImage dd bs=8192 if=zImage of=/dev/fd0zlilo: $(CONFIGURE) zImage if [ -f /vmlinuz ]; then mv /vmlinuz /vmlinuz.old; fi if [ -f /zSystem.map ]; then mv /zSystem.map /zSystem.old; fi cat zImage > /vmlinuz cp zSystem.map / if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fitools/zSystem: boot/head.o init/main.o tools/version.o linuxsubdirs $(LD) $(LDFLAGS) -Ttext 100000 boot/head.o init/main.o tools/version.o \ $(ARCHIVES) \ $(FILESYSTEMS) \ $(DRIVERS) \ $(LIBS) \ -o tools/zSystem nm tools/zSystem | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | \ sort > zSystem.mapfs: dummy $(MAKE) linuxsubdirs SUBDIRS=fslib: dummy $(MAKE) linuxsubdirs SUBDIRS=libmm: dummy $(MAKE) linuxsubdirs SUBDIRS=mmipc: dummy $(MAKE) linuxsubdirs SUBDIRS=ipckernel: dummy $(MAKE) linuxsubdirs SUBDIRS=kerneldrivers: dummy $(MAKE) linuxsubdirs SUBDIRS=driversnet: dummy $(MAKE) linuxsubdirs SUBDIRS=netclean: rm -f kernel/ksyms.lst rm -f core `find . -name '*.[oas]' -print` rm -f core `find . -name 'core' -print` rm -f zImage zSystem.map tools/zSystem tools/system rm -f Image System.map boot/bootsect boot/setup rm -f zBoot/zSystem zBoot/xtract zBoot/piggyback rm -f .tmp* drivers/sound/configure rm -f init/*.o tools/build boot/*.o tools/*.omrproper: clean rm -f include/linux/autoconf.h tools/version.h rm -f drivers/sound/local.h rm -f .version .config* config.old rm -f .depend `find . -name .depend -print`distclean: mrproperbackup: mrproper cd .. && tar cf - linux | gzip -9 > backup.gz syncdepend dep: touch tools/version.h for i in init/*.c;do echo -n "init/";$(CPP) -M $$i;done > .tmpdepend for i in tools/*.c;do echo -n "tools/";$(CPP) -M $$i;done >> .tmpdepend set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done rm -f tools/version.h mv .tmpdepend .dependifdef CONFIGURATION..$(CONFIGURATION): @echo @echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'" @echo $(MAKE) $(CONFIGURATION) @echo @echo "Successful. Try re-making (ignore the error that follows)" @echo exit 1dummy: ..$(CONFIGURATION)elsedummy:endif## Leave these dummy entries for now to tell people that they are going away..#lilo: @echo @echo Uncompressed kernel images no longer supported. Use @echo \"make zlilo\" instead. @echo @exit 1Image: @echo @echo Uncompressed kernel images no longer supported. Use @echo \"make zImage\" instead. @echo @exit 1disk: @echo @echo Uncompressed kernel images no longer supported. Use @echo \"make zdisk\" instead. @echo @exit 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -