/[dynamips]/upstream/dynamips-0.2.6-RC4/Makefile
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.6-RC4/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.6-RC1/Makefile revision 2 by dpavlin, Sat Oct 6 16:03:58 2007 UTC upstream/dynamips-0.2.6-RC3/Makefile revision 4 by dpavlin, Sat Oct 6 16:06:49 2007 UTC
# Line 1  Line 1 
1  # Makefile for Dynamips 0.2.5  # Makefile for Dynamips 0.2.6
2  # Copyright (c) 2005-2006 Christophe Fillot.  # Copyright (c) 2005-2006 Christophe Fillot.
3    
4  # Replace x86 by amd64 for a build on x86_64.  # Replace x86 by amd64 for a build on x86_64.
# Line 14  HAS_PCAP?=1 Line 14  HAS_PCAP?=1
14    
15  # Current dynamips release  # Current dynamips release
16  VERSION_TRAIN=0.2.6  VERSION_TRAIN=0.2.6
17  VERSION_SUB=-RC1  VERSION_SUB=-RC3
18    
19  VERSION=$(VERSION_TRAIN)$(VERSION_SUB)  VERSION=$(VERSION_TRAIN)$(VERSION_SUB)
20  VERSION_DEV=$(VERSION_TRAIN)-$(shell date +%Y%m%d-%H)  VERSION_DEV=$(VERSION_TRAIN)-$(shell date +%Y%m%d-%H)
21    
22  # Executable binary extension  # Executable binary extension
23    DESTDIR?=/usr
24  BIN_EXT?=  BIN_EXT?=
25    
26  CC?=gcc  CC?=gcc
# Line 32  ARCH_INC_FILE=\"$(DYNAMIPS_ARCH)_trans.h Line 33  ARCH_INC_FILE=\"$(DYNAMIPS_ARCH)_trans.h
33  CFLAGS+=-g -Wall -O3 -fomit-frame-pointer \  CFLAGS+=-g -Wall -O3 -fomit-frame-pointer \
34          -DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" \          -DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" \
35          -DARCH_INC_FILE=$(ARCH_INC_FILE) -DDYNAMIPS_VERSION=\"$(VERSION)\" \          -DARCH_INC_FILE=$(ARCH_INC_FILE) -DDYNAMIPS_VERSION=\"$(VERSION)\" \
36          -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \          -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
37          -DHAS_RFC2553=$(HAS_RFC2553)          -DHAS_RFC2553=$(HAS_RFC2553)
38    
39  PCAP_LIB=/usr/local/lib/libpcap.a  PCAP_LIB=/usr/local/lib/libpcap.a
# Line 40  PCAP_LIB=/usr/local/lib/libpcap.a Line 41  PCAP_LIB=/usr/local/lib/libpcap.a
41    
42  ifeq ($(shell uname), FreeBSD)  ifeq ($(shell uname), FreeBSD)
43     PTHREAD_LIBS?=-pthread     PTHREAD_LIBS?=-pthread
44     CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS)     CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS) \
45             -D_FILE_OFFSET_BITS=64
46     LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)     LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)
47  else  else
48    ifeq ($(shell uname), Linux)
49       PTHREAD_LIBS?=-lpthread
50       PCAP_LIB=-lpcap
51       CFLAGS+=-I/usr/include -I. $(PTHREAD_CFLAGS)
52       LIBS=-L/usr/lib -L. -lelf $(PTHREAD_LIBS)
53       DESTDIR=/usr
54    else
55  ifeq ($(shell uname -s), Darwin)  ifeq ($(shell uname -s), Darwin)
56     CFLAGS+=-I/usr/local/include -mdynamic-no-pic     CFLAGS+=-I/usr/local/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64
57     LIBS=-L/usr/local/lib -L. -lelf -lpthread     LIBS=-L/usr/local/lib -L. -lelf -lpthread
58  else  else
59    ifeq ($(shell uname -s), SunOS)
60       CFLAGS+=-I/usr/local/include -DINADDR_NONE=0xFFFFFFFF \
61            -I /opt/csw/include -DSUNOS
62       LIBS=-L/usr/local/lib -L. -lelf -lpthread -L/opt/csw/lib \
63            -lsocket -lnsl -lresolv
64       PCAP_LIB=/opt/csw/lib/libpcap.a
65    else
66  ifeq ($(shell uname -o), Cygwin)  ifeq ($(shell uname -o), Cygwin)
67     CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf -DCYGWIN     CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf -DCYGWIN \
68            -D_FILE_OFFSET_BITS=64
69     LIBS=-L/usr/local/lib -L. -lelf -lpthread     LIBS=-L/usr/local/lib -L. -lelf -lpthread
70     PCAP_LIB=-lpacket -lwpcap     PCAP_LIB=-lpacket -lwpcap
71  else  else
72     CFLAGS+=-I/usr/include/libelf     CFLAGS+=-I/usr/include/libelf -D_FILE_OFFSET_BITS=64
73     LIBS=-L. /usr/lib/libelf.a -lpthread     LIBS=-L. /usr/lib/libelf.a -lpthread
74  endif  endif
75  endif  endif
76  endif  endif
77    endif
78    endif
79    
80  PROG=dynamips$(BIN_EXT)  PROG=dynamips$(BIN_EXT)
81  PACKAGE=$(PROG)-$(VERSION)  PACKAGE=$(PROG)-$(VERSION)
# Line 69  ARCHIVE_DEV=$(PACKAGE_DEV).tar.gz Line 88  ARCHIVE_DEV=$(PACKAGE_DEV).tar.gz
88  HDR=mempool.h registry.h rbtree.h hash.h utils.h parser.h \  HDR=mempool.h registry.h rbtree.h hash.h utils.h parser.h \
89          crc.h base64.h net.h net_io.h net_io_bridge.h net_io_filter.h \          crc.h base64.h net.h net_io.h net_io_bridge.h net_io_filter.h \
90          atm.h frame_relay.h eth_switch.h \          atm.h frame_relay.h eth_switch.h \
91          ptask.h hypervisor.h dynamips.h insn_lookup.h \          ptask.h timer.h hypervisor.h dynamips.h insn_lookup.h \
92          vm.h mips64.h mips64_exec.h cpu.h cp0.h memory.h device.h \          vm.h mips64.h mips64_exec.h cpu.h cp0.h memory.h device.h \
93          nmc93c46.h cisco_eeprom.h ds1620.h pci_dev.h pci_io.h \          nmc93c46.h cisco_eeprom.h ds1620.h \
94          dev_dec21140.h dev_am79c971.h dev_mueslix.h \          pci_dev.h pci_io.h dev_gt.h dev_plx.h \
95          dev_vtty.h dev_c7200.h dev_c3600.h dev_c3600_bay.h          dev_dec21140.h dev_am79c971.h dev_mueslix.h dev_nm_16esw.h \
96  SOURCES=mempool.c registry.c rbtree.c hash.c utils.c parser.c ptask.c \          dev_vtty.h dev_c7200.h dev_c3600.h dev_c3600_bay.h \
97            dev_c2691.h dev_c3725.h dev_c3745.h
98    
99    SOURCES=mempool.c registry.c rbtree.c hash.c utils.c parser.c ptask.c timer.c \
100          crc.c base64.c net.c net_io.c net_io_bridge.c net_io_filter.c \          crc.c base64.c net.c net_io.c net_io_bridge.c net_io_filter.c \
101          atm.c frame_relay.c eth_switch.c \          atm.c frame_relay.c eth_switch.c \
102          dynamips.c insn_lookup.c vm.c mips64.c mips64_jit.c mips64_exec.c \          dynamips.c insn_lookup.c vm.c mips64.c mips64_jit.c mips64_exec.c \
103          cpu.c cp0.c memory.c device.c nmc93c46.c cisco_eeprom.c \          cpu.c cp0.c memory.c device.c nmc93c46.c cisco_eeprom.c \
104          pci_dev.c pci_io.c \          pci_dev.c pci_io.c \
105          dev_zero.c dev_vtty.c dev_ram.c dev_rom.c dev_nvram.c dev_bootflash.c \          dev_zero.c dev_vtty.c dev_ram.c dev_rom.c dev_nvram.c \
106          dev_remote.c dev_clpd6729.c dev_pcmcia_disk.c dev_gt64k.c \          dev_bootflash.c dev_flash.c \
107          dev_plx9060.c dev_dec21x50.c dev_pericom.c dev_ap1011.c \          dev_remote.c dev_clpd6729.c dev_pcmcia_disk.c dev_gt.c \
108            dev_plx.c dev_dec21x50.c dev_pericom.c dev_ti2050b.c dev_ap1011.c \
109          dev_ns16552.c dev_dec21140.c dev_am79c971.c dev_mueslix.c \          dev_ns16552.c dev_dec21140.c dev_am79c971.c dev_mueslix.c \
110          dev_c3600.c dev_c3600_bay.c dev_c3600_iofpga.c \          dev_c3600.c dev_c3600_bay.c dev_c3600_iofpga.c \
111          dev_c3600_eth.c dev_c3600_serial.c dev_c3600_esw.c \          dev_c3600_eth.c dev_c3600_serial.c \
112          dev_c7200.c dev_c7200_iofpga.c dev_c7200_mpfpga.c \          dev_c7200.c dev_c7200_iofpga.c dev_c7200_mpfpga.c \
113          dev_c7200_sram.c dev_c7200_eth.c dev_c7200_serial.c dev_c7200_pos.c \          dev_c7200_sram.c dev_c7200_eth.c dev_c7200_serial.c dev_c7200_pos.c \
114          dev_c7200_bri.c \          dev_c7200_bri.c \
115          dev_pa_a1.c dev_sb1.c dev_sb1_io.c dev_sb1_pci.c hypervisor.c \          dev_c2691.c dev_c2691_iofpga.c dev_c2691_eth.c dev_c2691_serial.c \
116            dev_c3725.c dev_c3725_iofpga.c dev_c3725_eth.c dev_c3725_serial.c \
117            dev_c3745.c dev_c3745_iofpga.c dev_c3745_eth.c dev_c3745_serial.c \
118            dev_nm_16esw.c dev_pa_a1.c dev_pa_mc8te1.c \
119            dev_sb1.c dev_sb1_io.c dev_sb1_pci.c hypervisor.c \
120          hv_nio.c hv_nio_bridge.c hv_frsw.c hv_atmsw.c hv_ethsw.c \          hv_nio.c hv_nio_bridge.c hv_frsw.c hv_atmsw.c hv_ethsw.c \
121          hv_vm.c hv_vm_debug.c hv_c7200.c hv_c3600.c          hv_vm.c hv_vm_debug.c \
122            hv_c7200.c hv_c3600.c hv_c2691.c hv_c3725.c hv_c3745.c
123    
124  # Profiling  # Profiling
125  #SOURCES += profiler.c  #SOURCES += profiler.c
# Line 100  SOURCES=mempool.c registry.c rbtree.c ha Line 128  SOURCES=mempool.c registry.c rbtree.c ha
128  ifeq ($(DYNAMIPS_ARCH),x86)  ifeq ($(DYNAMIPS_ARCH),x86)
129  HDR += x86-codegen.h x86_trans.h  HDR += x86-codegen.h x86_trans.h
130  SOURCES += x86_trans.c  SOURCES += x86_trans.c
 ASMSRC += x86_asm.S  
 CFLAGS += -DFAST_ASM  
131  endif  endif
132    
133  ifeq ($(DYNAMIPS_ARCH),amd64)  ifeq ($(DYNAMIPS_ARCH),amd64)
# Line 134  C_OBJS=$(SOURCES:.c=.o) Line 160  C_OBJS=$(SOURCES:.c=.o)
160  A_OBJS=$(ASMSRC:.S=.o)  A_OBJS=$(ASMSRC:.S=.o)
161  LEX_C=$(LEX_SOURCES:.l=.c)  LEX_C=$(LEX_SOURCES:.l=.c)
162    
163  SUPPL=Makefile ChangeLog COPYING README README.hypervisor TODO \  SUPPL=mips_mts.c Makefile ChangeLog COPYING README README.hypervisor TODO \
164          dynamips.1 nvram_export.1 hypervisor_mode.7 microcode          dynamips.1 nvram_export.1 hypervisor_mode.7 microcode debian/
165    
166  FILE_LIST := $(HDR) $(SOURCES) $(SUPPL) \  FILE_LIST := $(HDR) $(SOURCES) $(SUPPL) \
167          x86-codegen.h x86_trans.c x86_trans.h x86_asm.S \          x86-codegen.h x86_trans.c x86_trans.h \
168          amd64-codegen.h amd64_trans.c amd64_trans.h \          amd64-codegen.h amd64_trans.c amd64_trans.h \
169          nojit_trans.c nojit_trans.h asmdefs.c \          nojit_trans.c nojit_trans.h \
170          linux_eth.c linux_eth.h gen_eth.c gen_eth.h \          linux_eth.c linux_eth.h gen_eth.c gen_eth.h \
171          profiler.c profiler_resolve.pl bin2c.c rom2c.c \          profiler.c profiler_resolve.pl bin2c.c rom2c.c \
172          nvram_export.c          nvram_export.c
# Line 147  FILE_LIST := $(HDR) $(SOURCES) $(SUPPL) Line 174  FILE_LIST := $(HDR) $(SOURCES) $(SUPPL)
174  .PHONY: all  .PHONY: all
175  all: $(PROG) nvram_export  all: $(PROG) nvram_export
176    
177  $(PROG): microcode_dump.inc asmdefs.h $(LEX_C) $(C_OBJS) $(A_OBJS)  $(PROG): microcode_dump.inc $(LEX_C) $(C_OBJS) $(A_OBJS)
178          @echo "Linking $@"          @echo "Linking $@"
179          @$(CC) -o $@ $(C_OBJS) $(A_OBJS) $(LIBS)          @$(CC) -o $@ $(C_OBJS) $(A_OBJS) $(LIBS)
180    
# Line 171  nvram_export$(BIN_EXT): nvram_export.c Line 198  nvram_export$(BIN_EXT): nvram_export.c
198          @echo "Linking $@"          @echo "Linking $@"
199          @$(CC) -Wall $(CFLAGS) -o $@ nvram_export.c          @$(CC) -Wall $(CFLAGS) -o $@ nvram_export.c
200    
201    install: $(PROG) nvram_export
202            @echo "Installing"
203            install -d $(DESTDIR)/bin $(DESTDIR)/man/man1 $(DESTDIR)/man/man7 $(DESTDIR)/etc
204            install dynamips nvram_export   $(DESTDIR)/bin
205            install -m644 dynamips.1        $(DESTDIR)/man/man1
206            install -m644 nvram_export.1    $(DESTDIR)/man/man1
207            install -m644 hypervisor_mode.7 $(DESTDIR)/man/man7
208    # install -m644 example         $(DESTDIR)/etc/dynamips
209    
210    
211  .PHONY: clean  .PHONY: clean
212  clean:  clean:
213          $(RM) -f rom2c$(BIN_EXT) microcode_dump.inc asmdefs$(BIN_EXT) \          $(RM) -f rom2c$(BIN_EXT) microcode_dump.inc asmdefs$(BIN_EXT) \
# Line 180  clean: Line 217  clean:
217  .PHONY: package  .PHONY: package
218  package:  package:
219          @mkdir -p distrib/$(PACKAGE)          @mkdir -p distrib/$(PACKAGE)
220          @$(CP) $(FILE_LIST) distrib/$(PACKAGE)          @$(CP) -r $(FILE_LIST) distrib/$(PACKAGE)
221          @cd distrib ; $(TAR) czf $(ARCHIVE) $(PACKAGE)          @cd distrib ; $(TAR) czf $(ARCHIVE) $(PACKAGE)
222    
223  .PHONY: packdev  .PHONY: packdev

Legend:
Removed from v.2  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.26