|
|
1.1 root 1: # Makefile for Dynamips 0.2.3
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.
6: ARCH=x86
7:
8: # Change this to 0 if your system doesn't support RFC 2553 extensions
9: HAS_RFC2553=1
10:
11: # Current dynamips release
12: VERSION=0.2.3b
13:
14: CC=gcc
15: LD=ld
16: RM=rm
17: TAR=tar
18: CP=cp
19: LEX=flex
20: ARCH_INC_FILE=\"$(ARCH)_trans.h\"
21: CFLAGS=-g -Wall -O3 -fomit-frame-pointer -DJIT_ARCH=\"$(ARCH)\" \
22: -DARCH_INC_FILE=$(ARCH_INC_FILE) \
23: -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
24: -DHAS_RFC2553=$(HAS_RFC2553)
25:
26: ifeq ($(shell uname), FreeBSD)
27: CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf
28: LIBS=-L/usr/local/lib -L. -lelf -pthread
29: else
30: ifeq ($(shell uname -o), Cygwin)
31: CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf
32: LIBS=-L/usr/local/lib -L. -lelf -lpthread
33: else
34: LIBS=-L. -lelf -lpthread
35: endif
36: endif
37:
38: PROG=dynamips
39: PACKAGE=$(PROG)-$(VERSION)
40: ARCHIVE=$(PACKAGE).tar.gz
41:
42: # Header and source files
43: HDR=mempool.h cfg_lexer.h cfg_parser.h rbtree.h hash.h utils.h \
44: net.h net_io.h net_io_bridge.h atm.h \
45: ptask.h dynamips.h insn_lookup.h \
46: mips64.h mips64_exec.h cpu.h cp0.h memory.h device.h \
47: nmc93c46.h ds1620.h pci_dev.h pcireg.h \
48: dev_vtty.h dev_c7200.h dev_c7200_bay.h
49: SOURCES=mempool.c cfg_lexer.c cfg_parser.c rbtree.c hash.c utils.c \
50: net.c net_io.c net_io_bridge.c atm.c ptask.c \
51: dynamips.c insn_lookup.c mips64.c mips64_jit.c mips64_exec.c \
52: cpu.c cp0.c memory.c device.c nmc93c46.c pci_dev.c pci_io.c \
53: dev_zero.c dev_vtty.c dev_nvram.c dev_rom.c dev_bootflash.c \
54: dev_clpd6729.c dev_iofpga.c dev_mpfpga.c dev_gt64k.c \
55: dev_dec21x50.c dev_pericom.c \
56: dev_c7200.c dev_c7200_bay.c dev_c7200_sram.c dev_dec21140.c \
57: dev_c7200_serial.c dev_pa_a1.c \
58: dev_sb1_duart.c
59:
60: # Profiling
61: #SOURCES += profiler.c
62: #CFLAGS += -p -DPROFILE -DPROFILE_FILE=\"$(PROG).profile\"
63:
64: ifeq ($(ARCH),x86)
65: HDR += x86-codegen.h x86_trans.h
66: SOURCES += x86_trans.c
67: endif
68:
69: ifeq ($(ARCH),amd64)
70: HDR += x86-codegen.h amd64-codegen.h amd64_trans.h
71: SOURCES += amd64_trans.c
72: endif
73:
74: ifeq ($(ARCH),nojit)
75: HDR += nojit_trans.h
76: SOURCES += nojit_trans.c
77: endif
78:
79: # RAW Ethernet support for Linux
80: ifeq ($(shell uname), Linux)
81: CFLAGS += -DLINUX_ETH
82: HDR += linux_eth.h
83: SOURCES += linux_eth.c
84: endif
85:
86: LEX_SOURCES=cfg_lexer.l
87:
88: OBJS=$(SOURCES:.c=.o)
89: LEX_C=$(LEX_SOURCES:.l=.c)
90:
91: SUPPL=Makefile ChangeLog README TODO microcode
92: FILE_LIST := $(HDR) $(SOURCES) $(SUPPL) \
93: x86-codegen.h x86_trans.c x86_trans.h \
94: amd64-codegen.h amd64_trans.c amd64_trans.h \
95: nojit_trans.c nojit_trans.h linux_eth.c linux_eth.h \
96: cfg_lexer.l profiler.c profiler_resolve.pl bin2c.c rom2c.c
97:
98: dynamips: microcode $(LEX_C) $(OBJS)
99: @echo "Linking $(PROG)"
100: @$(CC) -o $(PROG) $(OBJS) $(LIBS)
101:
102: .PHONY: microcode
103: microcode:
104: @$(CC) -Wall -o rom2c rom2c.c $(LIBS)
105: @./rom2c microcode microcode_dump.inc
106:
107: .PHONY: clean
108: clean:
109: $(RM) -f microcode_dump.inc $(OBJS) $(PROG)
110: $(RM) -f *~
111:
112: .PHONY: package
113: package:
114: @mkdir -p distrib/$(PACKAGE)
115: @$(CP) $(FILE_LIST) distrib/$(PACKAGE)
116: @cd distrib ; $(TAR) czf $(ARCHIVE) $(PACKAGE)
117:
118: .SUFFIXES: .c .h .l .y .o
119:
120: .c.o:
121: @echo "Compiling $<"
122: @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $<
123:
124: .l.c:
125: $(LEX) -o$*.c $<
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.