Annotation of cf/Makefile, revision 1.1.1.3

1.1.1.3 ! root        1: # Makefile for Dynamips 0.2.4
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
                      9: HAS_RFC2553=1
                     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.3 ! root       16: VERSION=0.2.4
1.1       root       17: 
1.1.1.3 ! root       18: CC?=gcc
1.1       root       19: LD=ld
                     20: RM=rm
                     21: TAR=tar
                     22: CP=cp
                     23: LEX=flex
1.1.1.3 ! root       24: ARCH_INC_FILE=\"$(DYNAMIPS_ARCH)_trans.h\"
        !            25: CFLAGS+=-g -Wall -O3 -fomit-frame-pointer -DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" \
        !            26:        -DARCH_INC_FILE=$(ARCH_INC_FILE) -DDYNAMIPS_VERSION=\"$(VERSION)\" \
1.1       root       27:        -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
                     28:        -DHAS_RFC2553=$(HAS_RFC2553)
                     29: 
1.1.1.2   root       30: PCAP_LIB=-lpcap
                     31: 
1.1       root       32: ifeq ($(shell uname), FreeBSD)
1.1.1.3 ! root       33:    PTHREAD_LIBS?=-pthread
        !            34:    CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS)
        !            35:    LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)
1.1       root       36: else
1.1.1.2   root       37: ifeq ($(shell uname -s), Darwin)
                     38:    CFLAGS+=-I/usr/local/include
                     39:    LIBS=-L/usr/local/lib -L. -lelf -lpthread
                     40: else
1.1       root       41: ifeq ($(shell uname -o), Cygwin)
                     42:    CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf
                     43:    LIBS=-L/usr/local/lib -L. -lelf -lpthread
1.1.1.2   root       44:    PCAP_LIB=-lpacket -lwpcap
1.1       root       45: else
                     46:    LIBS=-L. -lelf -lpthread
                     47: endif
                     48: endif
1.1.1.2   root       49: endif
1.1       root       50: 
                     51: PROG=dynamips
                     52: PACKAGE=$(PROG)-$(VERSION)
                     53: ARCHIVE=$(PACKAGE).tar.gz
                     54: 
                     55: # Header and source files
1.1.1.2   root       56: HDR=mempool.h cfg_lexer.h cfg_parser.h rbtree.h hash.h utils.h crc.h \
1.1.1.3 ! root       57:        net.h net_io.h net_io_bridge.h atm.h frame_relay.h \
1.1       root       58:        ptask.h dynamips.h insn_lookup.h \
                     59:        mips64.h mips64_exec.h cpu.h cp0.h memory.h device.h \
                     60:        nmc93c46.h ds1620.h pci_dev.h pcireg.h \
                     61:        dev_vtty.h dev_c7200.h dev_c7200_bay.h
1.1.1.2   root       62: SOURCES=mempool.c cfg_lexer.c cfg_parser.c rbtree.c hash.c utils.c crc.c \
1.1.1.3 ! root       63:        net.c net_io.c net_io_bridge.c atm.c frame_relay.c ptask.c \
1.1       root       64:        dynamips.c insn_lookup.c mips64.c mips64_jit.c mips64_exec.c \
                     65:        cpu.c cp0.c memory.c device.c nmc93c46.c pci_dev.c pci_io.c \
                     66:        dev_zero.c dev_vtty.c dev_nvram.c dev_rom.c dev_bootflash.c \
                     67:        dev_clpd6729.c dev_iofpga.c dev_mpfpga.c dev_gt64k.c \
1.1.1.3 ! root       68:        dev_dec21x50.c dev_pericom.c dev_remote.c \
1.1       root       69:        dev_c7200.c dev_c7200_bay.c dev_c7200_sram.c dev_dec21140.c \
1.1.1.3 ! root       70:        dev_c7200_serial.c dev_c7200_pos.c dev_pa_a1.c \
1.1       root       71:        dev_sb1_duart.c
                     72: 
                     73: # Profiling
                     74: #SOURCES += profiler.c
                     75: #CFLAGS += -p -DPROFILE -DPROFILE_FILE=\"$(PROG).profile\"
                     76: 
1.1.1.3 ! root       77: ifeq ($(DYNAMIPS_ARCH),x86)
1.1       root       78: HDR += x86-codegen.h x86_trans.h
                     79: SOURCES += x86_trans.c
                     80: endif
                     81: 
1.1.1.3 ! root       82: ifeq ($(DYNAMIPS_ARCH),amd64)
1.1       root       83: HDR += x86-codegen.h amd64-codegen.h amd64_trans.h
                     84: SOURCES += amd64_trans.c
                     85: endif
                     86: 
1.1.1.3 ! root       87: ifeq ($(DYNAMIPS_ARCH),nojit)
1.1       root       88: HDR += nojit_trans.h
                     89: SOURCES += nojit_trans.c
                     90: endif
                     91: 
                     92: # RAW Ethernet support for Linux
                     93: ifeq ($(shell uname), Linux)
                     94: CFLAGS += -DLINUX_ETH
                     95: HDR += linux_eth.h
                     96: SOURCES += linux_eth.c
                     97: endif
                     98: 
1.1.1.2   root       99: # Generic Ethernet support with libpcap (0.9+)
                    100: ifeq ($(HAS_PCAP), 1)
                    101: CFLAGS += -DGEN_ETH
                    102: HDR += gen_eth.h
                    103: SOURCES += gen_eth.c
                    104: 
                    105: LIBS += $(PCAP_LIB)
                    106: endif
                    107: 
1.1       root      108: LEX_SOURCES=cfg_lexer.l
                    109: 
                    110: OBJS=$(SOURCES:.c=.o)
                    111: LEX_C=$(LEX_SOURCES:.l=.c)
                    112: 
                    113: SUPPL=Makefile ChangeLog README TODO microcode
                    114: FILE_LIST := $(HDR) $(SOURCES) $(SUPPL) \
                    115:        x86-codegen.h x86_trans.c x86_trans.h \
                    116:        amd64-codegen.h amd64_trans.c amd64_trans.h \
1.1.1.2   root      117:        nojit_trans.c nojit_trans.h \
                    118:        linux_eth.c linux_eth.h gen_eth.c gen_eth.h \
1.1       root      119:        cfg_lexer.l profiler.c profiler_resolve.pl bin2c.c rom2c.c
                    120: 
                    121: dynamips: microcode $(LEX_C) $(OBJS)
                    122:        @echo "Linking $(PROG)"
                    123:        @$(CC) -o $(PROG) $(OBJS) $(LIBS)
                    124: 
                    125: .PHONY: microcode
                    126: microcode: 
1.1.1.3 ! root      127:        @$(CC) -Wall $(CFLAGS) -o rom2c rom2c.c $(LIBS)
1.1       root      128:        @./rom2c microcode microcode_dump.inc
                    129: 
                    130: .PHONY: clean
                    131: clean:
                    132:        $(RM) -f microcode_dump.inc $(OBJS) $(PROG)
                    133:        $(RM) -f *~
                    134: 
                    135: .PHONY: package
                    136: package:
                    137:        @mkdir -p distrib/$(PACKAGE)
                    138:        @$(CP) $(FILE_LIST) distrib/$(PACKAGE)
                    139:        @cd distrib ; $(TAR) czf $(ARCHIVE) $(PACKAGE)
                    140: 
                    141: .SUFFIXES: .c .h .l .y .o
                    142: 
                    143: .c.o:
                    144:        @echo "Compiling $<"
                    145:        @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $<
                    146: 
                    147: .l.c:
                    148:        $(LEX) -o$*.c $<

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.