📄 makefile
字号:
# Makefile for Dynamips 0.2.6# Copyright (c) 2005-2006 Christophe Fillot.# Replace x86 by amd64 for a build on x86_64.# Use "nojit" for architectures that are not x86 or x86_64.DYNAMIPS_ARCH?=x86# Change this to 0 if your system doesn't support RFC 2553 extensionsHAS_RFC2553?=1# Change this to 1 if your system has libpcap-0.9.4 or better # (WinPcap is used for Cygwin)HAS_PCAP?=1# Current dynamips releaseVERSION_TRAIN=0.2.6VERSION_SUB=-RC3VERSION=$(VERSION_TRAIN)$(VERSION_SUB)VERSION_DEV=$(VERSION_TRAIN)-$(shell date +%Y%m%d-%H)# Executable binary extensionDESTDIR?=/usrBIN_EXT?=CC?=gccLD=ldRM=rmTAR=tarCP=cpLEX=flexARCH_INC_FILE=\"$(DYNAMIPS_ARCH)_trans.h\"CFLAGS+=-g -Wall -O3 -fomit-frame-pointer \ -DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" \ -DARCH_INC_FILE=$(ARCH_INC_FILE) -DDYNAMIPS_VERSION=\"$(VERSION)\" \ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \ -DHAS_RFC2553=$(HAS_RFC2553)PCAP_LIB=/usr/local/lib/libpcap.a#PCAP_LIB=-lpcapifeq ($(shell uname), FreeBSD) PTHREAD_LIBS?=-pthread CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS) \ -D_FILE_OFFSET_BITS=64 LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)elseifeq ($(shell uname), Linux) PTHREAD_LIBS?=-lpthread PCAP_LIB=-lpcap CFLAGS+=-I/usr/include -I. $(PTHREAD_CFLAGS) LIBS=-L/usr/lib -L. -lelf $(PTHREAD_LIBS) DESTDIR=/usrelseifeq ($(shell uname -s), Darwin) CFLAGS+=-I/usr/local/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64 LIBS=-L/usr/local/lib -L. -lelf -lpthreadelseifeq ($(shell uname -s), SunOS) CFLAGS+=-I/usr/local/include -DINADDR_NONE=0xFFFFFFFF \ -I /opt/csw/include -DSUNOS LIBS=-L/usr/local/lib -L. -lelf -lpthread -L/opt/csw/lib \ -lsocket -lnsl -lresolv PCAP_LIB=/opt/csw/lib/libpcap.aelseifeq ($(shell uname -o), Cygwin) CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf -DCYGWIN \ -D_FILE_OFFSET_BITS=64 LIBS=-L/usr/local/lib -L. -lelf -lpthread PCAP_LIB=-lpacket -lwpcapelse CFLAGS+=-I/usr/include/libelf -D_FILE_OFFSET_BITS=64 LIBS=-L. /usr/lib/libelf.a -lpthreadendifendifendifendifendifPROG=dynamips$(BIN_EXT)PACKAGE=$(PROG)-$(VERSION)ARCHIVE=$(PACKAGE).tar.gzPACKAGE_DEV=$(PROG)-$(VERSION_DEV)ARCHIVE_DEV=$(PACKAGE_DEV).tar.gz# Header and source filesHDR=mempool.h registry.h rbtree.h hash.h utils.h parser.h \ crc.h base64.h net.h net_io.h net_io_bridge.h net_io_filter.h \ atm.h frame_relay.h eth_switch.h \ ptask.h timer.h hypervisor.h dynamips.h insn_lookup.h \ vm.h mips64.h mips64_exec.h cpu.h cp0.h memory.h device.h \ nmc93c46.h cisco_eeprom.h ds1620.h \ pci_dev.h pci_io.h dev_gt.h dev_plx.h \ dev_dec21140.h dev_am79c971.h dev_mueslix.h dev_nm_16esw.h \ dev_vtty.h dev_c7200.h dev_c3600.h dev_c3600_bay.h \ dev_c2691.h dev_c3725.h dev_c3745.hSOURCES=mempool.c registry.c rbtree.c hash.c utils.c parser.c ptask.c timer.c \ crc.c base64.c net.c net_io.c net_io_bridge.c net_io_filter.c \ atm.c frame_relay.c eth_switch.c \ dynamips.c insn_lookup.c vm.c mips64.c mips64_jit.c mips64_exec.c \ cpu.c cp0.c memory.c device.c nmc93c46.c cisco_eeprom.c \ pci_dev.c pci_io.c \ dev_zero.c dev_vtty.c dev_ram.c dev_rom.c dev_nvram.c \ dev_bootflash.c dev_flash.c \ dev_remote.c dev_clpd6729.c dev_pcmcia_disk.c dev_gt.c \ dev_plx.c dev_dec21x50.c dev_pericom.c dev_ti2050b.c dev_ap1011.c \ dev_ns16552.c dev_dec21140.c dev_am79c971.c dev_mueslix.c \ dev_c3600.c dev_c3600_bay.c dev_c3600_iofpga.c \ dev_c3600_eth.c dev_c3600_serial.c \ dev_c7200.c dev_c7200_iofpga.c dev_c7200_mpfpga.c \ dev_c7200_sram.c dev_c7200_eth.c dev_c7200_serial.c dev_c7200_pos.c \ dev_c7200_bri.c \ dev_c2691.c dev_c2691_iofpga.c dev_c2691_eth.c dev_c2691_serial.c \ dev_c3725.c dev_c3725_iofpga.c dev_c3725_eth.c dev_c3725_serial.c \ dev_c3745.c dev_c3745_iofpga.c dev_c3745_eth.c dev_c3745_serial.c \ dev_nm_16esw.c dev_pa_a1.c dev_pa_mc8te1.c \ dev_sb1.c dev_sb1_io.c dev_sb1_pci.c hypervisor.c \ hv_nio.c hv_nio_bridge.c hv_frsw.c hv_atmsw.c hv_ethsw.c \ hv_vm.c hv_vm_debug.c \ hv_c7200.c hv_c3600.c hv_c2691.c hv_c3725.c hv_c3745.c# Profiling#SOURCES += profiler.c#CFLAGS += -p -DPROFILE -DPROFILE_FILE=\"$(PROG).profile\"ifeq ($(DYNAMIPS_ARCH),x86)HDR += x86-codegen.h x86_trans.hSOURCES += x86_trans.cendififeq ($(DYNAMIPS_ARCH),amd64)HDR += x86-codegen.h amd64-codegen.h amd64_trans.hSOURCES += amd64_trans.cendififeq ($(DYNAMIPS_ARCH),nojit)HDR += nojit_trans.hSOURCES += nojit_trans.cendif# RAW Ethernet support for Linuxifeq ($(shell uname), Linux)CFLAGS += -DLINUX_ETHHDR += linux_eth.hSOURCES += linux_eth.cendif# Generic Ethernet support with libpcap (0.9+)ifeq ($(HAS_PCAP), 1)CFLAGS += -DGEN_ETHHDR += gen_eth.hSOURCES += gen_eth.cLIBS += $(PCAP_LIB)endifC_OBJS=$(SOURCES:.c=.o)A_OBJS=$(ASMSRC:.S=.o)LEX_C=$(LEX_SOURCES:.l=.c)SUPPL=mips_mts.c Makefile ChangeLog COPYING README README.hypervisor TODO \ dynamips.1 nvram_export.1 hypervisor_mode.7 microcode debian/FILE_LIST := $(HDR) $(SOURCES) $(SUPPL) \ x86-codegen.h x86_trans.c x86_trans.h \ amd64-codegen.h amd64_trans.c amd64_trans.h \ nojit_trans.c nojit_trans.h \ linux_eth.c linux_eth.h gen_eth.c gen_eth.h \ profiler.c profiler_resolve.pl bin2c.c rom2c.c \ nvram_export.c.PHONY: allall: $(PROG) nvram_export$(PROG): microcode_dump.inc $(LEX_C) $(C_OBJS) $(A_OBJS) @echo "Linking $@" @$(CC) -o $@ $(C_OBJS) $(A_OBJS) $(LIBS)rom2c$(BIN_EXT): rom2c.c @echo "Linking $@" @$(CC) -Wall $(CFLAGS) -o $@ rom2c.c $(LIBS)microcode_dump.inc: rom2c$(BIN_EXT) microcode @$(CC) -Wall $(CFLAGS) -o $@ rom2c.c $(LIBS) @./rom2c microcode microcode_dump.incasmdefs$(BIN_EXT): asmdefs.c mips64.h @echo "Linking $@" @$(CC) -Wall $(CFLAGS) -o $@ asmdefs.casmdefs.h: asmdefs$(BIN_EXT) @echo "Building assembly definitions header file" @./asmdefsnvram_export$(BIN_EXT): nvram_export.c @echo "Linking $@" @$(CC) -Wall $(CFLAGS) -o $@ nvram_export.cinstall: $(PROG) nvram_export @echo "Installing" install -d $(DESTDIR)/bin $(DESTDIR)/man/man1 $(DESTDIR)/man/man7 $(DESTDIR)/etc install dynamips nvram_export $(DESTDIR)/bin install -m644 dynamips.1 $(DESTDIR)/man/man1 install -m644 nvram_export.1 $(DESTDIR)/man/man1 install -m644 hypervisor_mode.7 $(DESTDIR)/man/man7# install -m644 example $(DESTDIR)/etc/dynamips.PHONY: cleanclean: $(RM) -f rom2c$(BIN_EXT) microcode_dump.inc asmdefs$(BIN_EXT) \ asmdefs.h $(C_OBJS) $(A_OBJS) $(PROG) $(RM) -f *~.PHONY: packagepackage: @mkdir -p distrib/$(PACKAGE) @$(CP) -r $(FILE_LIST) distrib/$(PACKAGE) @cd distrib ; $(TAR) czf $(ARCHIVE) $(PACKAGE).PHONY: packdevpackdev: @mkdir -p distrib/$(PACKAGE_DEV) @$(CP) $(FILE_LIST) distrib/$(PACKAGE_DEV) @cd distrib ; $(TAR) czf $(ARCHIVE_DEV) $(PACKAGE_DEV).SUFFIXES: .c .h .S .l .y .o.S.o: @echo "Assembling $<" @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $<.c.o: @echo "Compiling $<" @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $<.l.c: $(LEX) -o$*.c $<
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -