📄 makefile.main
字号:
## Makefile for Etherboot## Most of the time you should edit Config## Common options:# VERSION_*=v - Set the major and minor version numbers## NS8390 options:# -DINCLUDE_NE - Include NE1000/NE2000 support# -DNE_SCAN=list - Probe for NE base address using list of# comma separated hex addresses# -DINCLUDE_3C503 - Include 3c503 support# -DT503_SHMEM - Use 3c503 shared memory mode (off by default)# -DINCLUDE_WD - Include Western Digital/SMC support# -DWD_DEFAULT_MEM- Default memory location for WD/SMC cards# -DWD_790_PIO - Read/write to WD/SMC 790 cards in PIO mode (default# is to use shared memory) Try this if you get "Bogus# packet, ignoring" messages, common on ISA/PCI hybrid# systems.# -DCOMPEX_RL2000_FIX## If you have a Compex RL2000 PCI 32-bit (11F6:1401),# and the bootrom hangs in "Probing...[NE*000/PCI]",# try enabling this fix... it worked for me :).# In the first packet write somehow it somehow doesn't# get back the expected data so it is stuck in a loop.# I didn't bother to investigate what or why because it works# when I interrupt the loop if it takes more then COMPEX_RL2000_TRIES.# The code will notify if it does a abort.# SomniOne - somnione@gmx.net## 3C509 option:# -DINCLUDE_3C509 - Include 3c509 support## 3C90X options:# -DINCLUDE_3C90X - Include 3c90x support## Warning Warning Warning# If you use any of the XCVR options below, please do not complain about# the behaviour with Linux drivers to the kernel developers. You are# on your own if you do this. Please read 3c90x.txt to understand# what they do. If you don't understand them, ask for help on the# Etherboot mailing list. And please document what you did to the NIC# on the NIC so that people after you won't get nasty surprises.## -DCFG_3C90X_PRESERVE_XCVR - Reset the transceiver type to the value it# had initially just before the loaded code is started.# -DCFG_3C90X_XCVR - Hardcode the tranceiver type Etherboot uses.# -DCFG_3C90X_BOOTROM_FIX - If you have a 3c905B with buggy ROM# interface, setting this option might "fix" it. Use# with caution and read the docs in 3c90x.txt!## See the documentation file 3c90x.txt for more details.## CS89X0 (optional) options:# -DINCLUDE_CS89X0- Include CS89x0 support# -DCS_SCAN=list - Probe for CS89x0 base address using list of# comma separated hex addresses; increasing the# address by one (0x300 -> 0x301) will force a# more aggressive probing algorithm. This might# be neccessary after a soft-reset of the NIC.## LANCE options:# -DINCLUDE_NE2100- Include NE2100 support# -DINCLUDE_NI6510- Include NI6510 support## SK_G16 options:# -DINCLUDE_SK_G16- Include SK_G16 support## I82586 options:# -DINCLUDE_3C507 - Include 3c507 support# -DINCLUDE_NI5210- Include NI5210 support# -DINCLUDE_EXOS205-Include EXOS205 support## SMC9000 options:# -DINCLUDE_SMC9000 - Include SMC9000 driver# -DSMC9000_SCAN=list - List of I/O addresses to probe## TIARA (Fujitsu Etherstar) options:# -DINCLUDE_TIARA - Include Tiara support## NI5010 options:# -DINCLUDE_NI5010 - Include NI5010 support## TULIP options:# -DINCLUDE_TULIP - Include Tulip support## RTL8139 options:# -DINCLUDE_RTL8139 - Include RTL8139 support## SIS900 options:# -DINCLUDE_SIS900 - Include SIS900 support## NATSEMI options:# -DINCLUDE_NATSEMI - Include NATSEMI support#all: $(UTILS) $(BUILD_LIBS) allimgsSRCS:=BOBJS:=MAKEROM= $(PERL) ./util/makerom.plVERSION_MAJOR= 5VERSION_MINOR= 2VERSION_PATCH= 4EXTRAVERSION=VERSION= $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(EXTRAVERSION)CFLAGS+= -DVERSION_MAJOR=$(VERSION_MAJOR) \ -DVERSION_MINOR=$(VERSION_MINOR) \ -DVERSION=\"$(VERSION)\" -DRELOC=$(RELOCADDR) $(OLDGAS) \ -I include -I arch/$(ARCH)/include \ -DARCH=$(ARCH)IDENT= '$(@F) $(VERSION) (GPL) etherboot.org'# Find out if we're using binutils 2.9.1 which uses a different syntax in some# places (most prominently in the opcode prefix area).OLDGAS:= $(shell $(AS) --version | grep -q '2\.9\.1' && echo -DGAS291)BUILD_LIBS= $(BLIB)BUILD_IMGS= $(IMGS)3C503FLAGS= -DINCLUDE_3C503 # -DT503_SHMEM# Note that the suffix to MAKEROM_ is the (mixed case) basename of the ROM fileMAKEROM_3c503= -33C507FLAGS= -DINCLUDE_3C5073C509FLAGS= -DINCLUDE_3C5093C529FLAGS= -DINCLUDE_3C5293C595FLAGS= -DINCLUDE_3C5953C90XFLAGS= -DINCLUDE_3C90XCS89X0FLAGS= -DINCLUDE_CS89X0EEPROFLAGS= -DINCLUDE_EEPROEEPRO100FLAGS= -DINCLUDE_EEPRO100E1000FLAGS= -DINCLUDE_E1000EPIC100FLAGS= -DINCLUDE_EPIC100EXOS205FLAGS= -DINCLUDE_EXOS205LANCEFLAGS= -DINCLUDE_LANCE # Lance/PCI!NE2100FLAGS= -DINCLUDE_NE2100NEFLAGS= -DINCLUDE_NE -DNE_SCAN=0x300,0x280,0x320,0x340,0x380NS8390FLAGS= -DINCLUDE_NS8390 # NE2000/PCI!NI5010FLAGS= -DINCLUDE_NI5010NI5210FLAGS= -DINCLUDE_NI5210NI6510FLAGS= -DINCLUDE_NI6510RTL8139FLAGS= -DINCLUDE_RTL8139SK_G16FLAGS= -DINCLUDE_SK_G16SIS900FLAGS= -DINCLUDE_SIS900NATSEMIFLAGS= -DINCLUDE_NATSEMISMC9000FLAGS= -DINCLUDE_SMC9000SUNDANCEFLAGS= -DINCLUDE_SUNDANCETLANFLAGS= -DINCLUDE_TLANTIARAFLAGS= -DINCLUDE_TIARADEPCAFLAGS= -DINCLUDE_DEPCA # -DDEPCA_MODEL=DEPCA -DDEPCA_RAM_BASE=0xd0000TULIPFLAGS= -DINCLUDE_TULIPOTULIPFLAGS= -DINCLUDE_OTULIPVIA_RHINEFLAGS= -DINCLUDE_VIA_RHINEWDFLAGS= -DINCLUDE_WD -DWD_DEFAULT_MEM=0xCC000W89C840FLAGS= -DINCLUDE_W89C840SRCS+= core/serial.c core/rsa.cSRCS+= core/main.c core/pci.c core/osloader.c core/nfs.cSRCS+= core/misc.c core/config.c core/relocate.c core/heap.cSRCS+= drivers/disk/floppy.c core/nic.c core/disk.c core/timer.cSRCS+= core/proto_slam.c core/proto_tftm.cSRCS+= core/isapnp.c core/md5.cSRCS+= core/pcmcia.c core/i82365.cBOBJS+= $(BIN)/main.o $(BIN)/osloader.o $(BIN)/nfs.o $(BIN)/misc.oBOBJS+= $(BIN)/proto_slam.o $(BIN)/proto_tftm.oBOBJS+= $(BIN)/floppy.o $(BIN)/md5.oBOBJS+= $(BIN)/serial.o $(BIN)/timer.o $(BIN)/relocate.o $(BIN)/heap.oBOBJS+= $(BIN)/nic.o $(BIN)/disk.oBOBJS+= $(BIN)/isapnp.oBOBJS+= $(BIN)/pci.o $(BIN)/rsa.oBOBJS+= $(BIN)/vsprintf.oBOBJS+= $(BIN)/pcmcia.o $(BIN)/i82365.oBLIB= $(BIN)/bootlib.a LIBS= $(BLIB)UTILS+= $(BIN)/nrv2bSTDDEPS= $(START) $(BLIB) $(UTILS)ELF_DEPS= $(ELF_START) $(BLIB)# MAKEDEPS is the one target that is depended by all ROMs, so we check gcc here# If you are confident that gcc 2.96 works for you, you can remove the lines# that check gcc in the toolcheck ruleMAKEDEPS+= Makefile Makefile.main Config genrules.pl $(BIN)/toolcheckMAKEDEPS+= arch/$(ARCH)/Makefile arch/$(ARCH)/ConfigCHECKSIZE= { read d1; read d1 d2 d3 size d4; [ $$size -gt $(ROMLIMIT) ] &&\ { $(RM) $@; echo "ERROR: code size exceeds limit!"; exit 1; }; exit 0; }# Start of targets$(BIN)/toolcheck: Makefile Config @if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; \ then \ echo 'gcc 2.96 is unsuitable for compiling Etherboot'; \ echo 'Use gcc 2.95 or gcc 3.x instead'; \ exit 1; \ else \ touch $(BIN)/toolcheck; \ fi; \ if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; \ then \ echo 'Your Perl version has a Unicode handling bug'; \ echo 'To workaround, execute this before compiling Etherboot:'; \ echo 'export LANG=$${LANG%.UTF-8}'; \ exit 1; \ fiinclude arch/$(ARCH)/Makefile# We need allimgs because $(IMGS) is not defined until# the Makefile fragment "Roms" is read.allimgs: $(BIN)/Roms $(BUILD_IMGS)# Common files$(BLIB): $(BOBJS) $(AR) rv $@ $(BOBJS) $(RANLIB) $@# LinuxBIOS support code$(BIN)/linuxbios.o: firmware/linuxbios/linuxbios.c include/etherboot.h include/dev.h firmware/linuxbios/linuxbios_tables.h# Do not add driver specific dependencies here unless it's something the# genrules.pl script *can't* deal with, i.e. if it is not C code.# Utilities$(BIN)/lzhuf: util/lzhuf.c $(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -o $@ $<# Roms file$(BIN)/Roms $(BIN)/NIC: genrules.pl $(SRCS) mkdir -p $(@D) $(PERL) ./genrules.pl $(BIN)/NIC $(ARCH) $(SRCS) > $(BIN)/Roms# Pattern Rules# general rules for compiling/assembling source files$(BIN)/%.o: core/%.c $(MAKEDEPS) $(CC) $(CFLAGS) -o $@ -c $<$(BIN)/%.s: core/%.c $(MAKEDEPS) $(CC) $(CFLAGS) -S -o $@ -c $<$(BIN)/%.o: drivers/disk/%.c $(MAKEDEPS) $(CC) $(CFLAGS) -o $@ -c $<$(BIN)/%.o: drivers/net/%.c $(MAKEDEPS) $(CC) $(CFLAGS) -o $@ -c $<$(BIN)/%.o: firmware/linuxbios/%.c $(MAKEDEPS) $(CC) $(CFLAGS) -o $@ -c $<# Rule for the super etherboot image.$(BIN)/etherboot.o: $(DOBJS) $(LD) -r $(DOBJS) -o $@$(BIN)/etherboot-pci.o: $(PCIOBJS) $(LD) -r $(PCIOBJS) -o $@# general ruls for generating .img files$(BIN)/%.tmp: $(BIN)/%.o $(START) $(BIN)/config.o arch/$(ARCH)/core/etherboot.lds $(LIBS) $(STDDEPS) $(MAKEDEPS) $(LD) $(LDFLAGS) -T arch/$(ARCH)/core/etherboot.lds -o $@ $(START) $(BIN)/config.o $< $(LIBS) @$(SIZE) $@ | $(CHECKSIZE)$(BIN)/%.img: $(BIN)/%.tmp $(MAKEDEPS) $(OBJCOPY) -O binary $< $@# general rule for .z (compressed binary code), may be overridden$(BIN)/%.z: $(BIN)/%.img $(BIN)/nrv2b $(MAKEDEPS) $(BIN)/nrv2b e $< $@# Housekeepingclean: $(RM) $(BIN)/*../index.html: ../index.xhtml (cd ..; m4 -P -DHOSTSITE=SOURCEFORGE index.xhtml > index.html)../index-berlios.html: ../index.xhtml (cd ..; m4 -P -DHOSTSITE=BERLIOS index.xhtml > index-berlios.html)tarball: ../index.html ../index-berlios.html (echo -n $(VERSION) ''; date -u +'%Y-%m-%d') > ../VERSION (cd ../..; tar cf /tmp/etherboot-$(VERSION).tar --exclude CVS --exclude doc etherboot-$(VERSION)) bzip2 -9 < /tmp/etherboot-$(VERSION).tar > /tmp/etherboot-$(VERSION).tar.bz2 gzip -9 < /tmp/etherboot-$(VERSION).tar > /tmp/etherboot-$(VERSION).tar.gzversion: @echo $(VERSION)romlimit: @echo $(ROMLIMIT)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -