|
|
1.1.1.6 ! root 1: # Makefile for Dynamips 0.2.6 1.1 root 2: # Copyright (c) 2005-2006 Christophe Fillot. 3: 4: # Replace x86 by amd64 for a build on x86_64. 5: # Use "nojit" for architectures that are not x86 or x86_64. 1.1.1.3 root 6: DYNAMIPS_ARCH?=x86 1.1 root 7: 8: # Change this to 0 if your system doesn't support RFC 2553 extensions 1.1.1.4 root 9: HAS_RFC2553?=1 1.1 root 10: 1.1.1.2 root 11: # Change this to 1 if your system has libpcap-0.9.4 or better 12: # (WinPcap is used for Cygwin) 1.1.1.3 root 13: HAS_PCAP?=1 1.1.1.2 root 14: 1.1 root 15: # Current dynamips release 1.1.1.5 root 16: VERSION_TRAIN=0.2.6 1.1.1.6 ! root 17: VERSION_SUB=-RC2 1.1.1.5 root 18: 19: VERSION=$(VERSION_TRAIN)$(VERSION_SUB) 20: VERSION_DEV=$(VERSION_TRAIN)-$(shell date +%Y%m%d-%H) 1.1.1.4 root 21: 22: # Executable binary extension 23: BIN_EXT?= 1.1 root 24: 1.1.1.3 root 25: CC?=gcc 1.1 root 26: LD=ld 27: RM=rm 28: TAR=tar 29: CP=cp 30: LEX=flex 1.1.1.3 root 31: ARCH_INC_FILE=\"$(DYNAMIPS_ARCH)_trans.h\" 1.1.1.4 root 32: CFLAGS+=-g -Wall -O3 -fomit-frame-pointer \ 33: -DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" \ 1.1.1.3 root 34: -DARCH_INC_FILE=$(ARCH_INC_FILE) -DDYNAMIPS_VERSION=\"$(VERSION)\" \ 1.1.1.6 ! root 35: -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \ 1.1 root 36: -DHAS_RFC2553=$(HAS_RFC2553) 37: 1.1.1.4 root 38: PCAP_LIB=/usr/local/lib/libpcap.a 39: #PCAP_LIB=-lpcap 1.1.1.2 root 40: 1.1 root 41: ifeq ($(shell uname), FreeBSD) 1.1.1.3 root 42: PTHREAD_LIBS?=-pthread 1.1.1.6 ! root 43: CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS) \ ! 44: -D_FILE_OFFSET_BITS=64 1.1.1.3 root 45: LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS) 1.1 root 46: else 1.1.1.2 root 47: ifeq ($(shell uname -s), Darwin) 1.1.1.6 ! root 48: CFLAGS+=-I/usr/local/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64 1.1.1.2 root 49: LIBS=-L/usr/local/lib -L. -lelf -lpthread 50: else 1.1.1.6 ! root 51: ifeq ($(shell uname -s), SunOS) ! 52: CFLAGS+=-I/usr/local/include -DINADDR_NONE=0xFFFFFFFF \ ! 53: -I /opt/csw/include -DSUNOS ! 54: LIBS=-L/usr/local/lib -L. -lelf -lpthread -L/opt/csw/lib \ ! 55: -lsocket -lnsl -lresolv ! 56: PCAP_LIB=/opt/csw/lib/libpcap.a ! 57: else 1.1 root 58: ifeq ($(shell uname -o), Cygwin) 1.1.1.6 ! root 59: CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf -DCYGWIN \ ! 60: -D_FILE_OFFSET_BITS=64 1.1 root 61: LIBS=-L/usr/local/lib -L. -lelf -lpthread 1.1.1.2 root 62: PCAP_LIB=-lpacket -lwpcap 1.1 root 63: else 1.1.1.6 ! root 64: CFLAGS+=-I/usr/include/libelf -D_FILE_OFFSET_BITS=64 1.1.1.4 root 65: LIBS=-L. /usr/lib/libelf.a -lpthread 1.1 root 66: endif 67: endif 1.1.1.2 root 68: endif 1.1.1.6 ! root 69: endif 1.1 root 70: 1.1.1.4 root 71: PROG=dynamips$(BIN_EXT) 1.1 root 72: PACKAGE=$(PROG)-$(VERSION) 73: ARCHIVE=$(PACKAGE).tar.gz 74: 1.1.1.4 root 75: PACKAGE_DEV=$(PROG)-$(VERSION_DEV) 76: ARCHIVE_DEV=$(PACKAGE_DEV).tar.gz 77: 1.1 root 78: # Header and source files 1.1.1.4 root 79: HDR=mempool.h registry.h rbtree.h hash.h utils.h parser.h \ 80: crc.h base64.h net.h net_io.h net_io_bridge.h net_io_filter.h \ 81: atm.h frame_relay.h eth_switch.h \ 1.1.1.6 ! root 82: ptask.h timer.h hypervisor.h dynamips.h insn_lookup.h \ 1.1.1.4 root 83: vm.h mips64.h mips64_exec.h cpu.h cp0.h memory.h device.h \ 84: nmc93c46.h cisco_eeprom.h ds1620.h pci_dev.h pci_io.h \ 85: dev_dec21140.h dev_am79c971.h dev_mueslix.h \ 86: dev_vtty.h dev_c7200.h dev_c3600.h dev_c3600_bay.h 1.1.1.6 ! root 87: SOURCES=mempool.c registry.c rbtree.c hash.c utils.c parser.c ptask.c timer.c \ 1.1.1.4 root 88: crc.c base64.c net.c net_io.c net_io_bridge.c net_io_filter.c \ 89: atm.c frame_relay.c eth_switch.c \ 90: dynamips.c insn_lookup.c vm.c mips64.c mips64_jit.c mips64_exec.c \ 91: cpu.c cp0.c memory.c device.c nmc93c46.c cisco_eeprom.c \ 92: pci_dev.c pci_io.c \ 93: dev_zero.c dev_vtty.c dev_ram.c dev_rom.c dev_nvram.c dev_bootflash.c \ 94: dev_remote.c dev_clpd6729.c dev_pcmcia_disk.c dev_gt64k.c \ 95: dev_plx9060.c dev_dec21x50.c dev_pericom.c dev_ap1011.c \ 96: dev_ns16552.c dev_dec21140.c dev_am79c971.c dev_mueslix.c \ 97: dev_c3600.c dev_c3600_bay.c dev_c3600_iofpga.c \ 1.1.1.5 root 98: dev_c3600_eth.c dev_c3600_serial.c dev_c3600_esw.c \ 1.1.1.4 root 99: dev_c7200.c dev_c7200_iofpga.c dev_c7200_mpfpga.c \ 100: dev_c7200_sram.c dev_c7200_eth.c dev_c7200_serial.c dev_c7200_pos.c \ 101: dev_c7200_bri.c \ 102: dev_pa_a1.c dev_sb1.c dev_sb1_io.c dev_sb1_pci.c hypervisor.c \ 103: hv_nio.c hv_nio_bridge.c hv_frsw.c hv_atmsw.c hv_ethsw.c \ 1.1.1.5 root 104: hv_vm.c hv_vm_debug.c hv_c7200.c hv_c3600.c 1.1 root 105: 106: # Profiling 107: #SOURCES += profiler.c 108: #CFLAGS += -p -DPROFILE -DPROFILE_FILE=\"$(PROG).profile\" 109: 1.1.1.3 root 110: ifeq ($(DYNAMIPS_ARCH),x86) 1.1 root 111: HDR += x86-codegen.h x86_trans.h 112: SOURCES += x86_trans.c 1.1.1.4 root 113: ASMSRC += x86_asm.S 114: CFLAGS += -DFAST_ASM 1.1 root 115: endif 116: 1.1.1.3 root 117: ifeq ($(DYNAMIPS_ARCH),amd64) 1.1 root 118: HDR += x86-codegen.h amd64-codegen.h amd64_trans.h 119: SOURCES += amd64_trans.c 120: endif 121: 1.1.1.3 root 122: ifeq ($(DYNAMIPS_ARCH),nojit) 1.1 root 123: HDR += nojit_trans.h 124: SOURCES += nojit_trans.c 125: endif 126: 127: # RAW Ethernet support for Linux 128: ifeq ($(shell uname), Linux) 129: CFLAGS += -DLINUX_ETH 130: HDR += linux_eth.h 131: SOURCES += linux_eth.c 132: endif 133: 1.1.1.2 root 134: # Generic Ethernet support with libpcap (0.9+) 135: ifeq ($(HAS_PCAP), 1) 136: CFLAGS += -DGEN_ETH 137: HDR += gen_eth.h 138: SOURCES += gen_eth.c 139: 140: LIBS += $(PCAP_LIB) 141: endif 142: 1.1.1.4 root 143: C_OBJS=$(SOURCES:.c=.o) 144: A_OBJS=$(ASMSRC:.S=.o) 1.1 root 145: LEX_C=$(LEX_SOURCES:.l=.c) 146: 1.1.1.4 root 147: SUPPL=Makefile ChangeLog COPYING README README.hypervisor TODO \ 148: dynamips.1 nvram_export.1 hypervisor_mode.7 microcode 1.1 root 149: FILE_LIST := $(HDR) $(SOURCES) $(SUPPL) \ 1.1.1.4 root 150: x86-codegen.h x86_trans.c x86_trans.h x86_asm.S \ 1.1 root 151: amd64-codegen.h amd64_trans.c amd64_trans.h \ 1.1.1.4 root 152: nojit_trans.c nojit_trans.h asmdefs.c \ 1.1.1.2 root 153: linux_eth.c linux_eth.h gen_eth.c gen_eth.h \ 1.1.1.4 root 154: profiler.c profiler_resolve.pl bin2c.c rom2c.c \ 155: nvram_export.c 156: 157: .PHONY: all 158: all: $(PROG) nvram_export 159: 160: $(PROG): microcode_dump.inc asmdefs.h $(LEX_C) $(C_OBJS) $(A_OBJS) 161: @echo "Linking $@" 162: @$(CC) -o $@ $(C_OBJS) $(A_OBJS) $(LIBS) 163: 164: rom2c$(BIN_EXT): rom2c.c 165: @echo "Linking $@" 166: @$(CC) -Wall $(CFLAGS) -o $@ rom2c.c $(LIBS) 1.1 root 167: 1.1.1.4 root 168: microcode_dump.inc: rom2c$(BIN_EXT) microcode 169: @$(CC) -Wall $(CFLAGS) -o $@ rom2c.c $(LIBS) 1.1 root 170: @./rom2c microcode microcode_dump.inc 171: 1.1.1.4 root 172: asmdefs$(BIN_EXT): asmdefs.c mips64.h 173: @echo "Linking $@" 174: @$(CC) -Wall $(CFLAGS) -o $@ asmdefs.c 175: 176: asmdefs.h: asmdefs$(BIN_EXT) 177: @echo "Building assembly definitions header file" 178: @./asmdefs 179: 180: nvram_export$(BIN_EXT): nvram_export.c 181: @echo "Linking $@" 182: @$(CC) -Wall $(CFLAGS) -o $@ nvram_export.c 183: 1.1 root 184: .PHONY: clean 185: clean: 1.1.1.4 root 186: $(RM) -f rom2c$(BIN_EXT) microcode_dump.inc asmdefs$(BIN_EXT) \ 187: asmdefs.h $(C_OBJS) $(A_OBJS) $(PROG) 1.1 root 188: $(RM) -f *~ 189: 190: .PHONY: package 191: package: 192: @mkdir -p distrib/$(PACKAGE) 193: @$(CP) $(FILE_LIST) distrib/$(PACKAGE) 194: @cd distrib ; $(TAR) czf $(ARCHIVE) $(PACKAGE) 195: 1.1.1.4 root 196: .PHONY: packdev 197: packdev: 198: @mkdir -p distrib/$(PACKAGE_DEV) 199: @$(CP) $(FILE_LIST) distrib/$(PACKAGE_DEV) 200: @cd distrib ; $(TAR) czf $(ARCHIVE_DEV) $(PACKAGE_DEV) 201: 202: .SUFFIXES: .c .h .S .l .y .o 203: 204: .S.o: 205: @echo "Assembling $<" 206: @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $< 1.1 root 207: 208: .c.o: 209: @echo "Compiling $<" 210: @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $< 211: 212: .l.c: 213: $(LEX) -o$*.c $<
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.