forked from pool/dynamips
178 lines
5.7 KiB
Diff
178 lines
5.7 KiB
Diff
|
diff -uNr old-dynamips-0.2.8-RC3//Makefile dynamips-0.2.8-RC3/Makefile
|
||
|
--- old-dynamips-0.2.8-RC3//Makefile 2011-03-30 15:01:30.000000000 +0200
|
||
|
+++ dynamips-0.2.8-RC3/Makefile 2011-04-11 16:33:07.451266220 +0200
|
||
|
@@ -7,9 +7,13 @@
|
||
|
# - Use "nojit" for unsupported architectures.
|
||
|
export DYNAMIPS_ARCH?=x86
|
||
|
|
||
|
-# Do you want to use lib (for 32 bit compiling) or lib64
|
||
|
-export DYNAMIPS_LIB?=lib
|
||
|
-#export DYNAMIPS_LIB?=lib64
|
||
|
+ifeq ($(DYNAMIPS_ARCH), amd64)
|
||
|
+DYNAMIPS_LIB?=lib64
|
||
|
+LIBDIR?=/usr/lib64
|
||
|
+else
|
||
|
+DYNAMIPS_LIB?=lib
|
||
|
+LIBDIR?=/usr/lib
|
||
|
+endif
|
||
|
|
||
|
# For MAC x64 you can compile the "unstable" version, which should work
|
||
|
# fine, or use stable if you prefer.
|
||
|
@@ -33,8 +37,6 @@
|
||
|
export VERSION_SUB=-RC3
|
||
|
|
||
|
# Executable binary extension
|
||
|
-export DESTDIR?=/usr
|
||
|
-export BIN_EXT?=
|
||
|
|
||
|
|
||
|
.PHONY: all dynamips.stable dynamips.unstable
|
||
|
@@ -50,13 +52,13 @@
|
||
|
|
||
|
install: dynamips.$(DYNAMIPS_CODE)
|
||
|
@echo "Installing"
|
||
|
- install -d $(DESTDIR)/bin $(DESTDIR)/man/man1 $(DESTDIR)/man/man7 $(DESTDIR)/etc
|
||
|
+ install -d $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/man/man1 $(DESTDIR)/usr/share/man/man7 $(DESTDIR)/etc
|
||
|
cp dynamips.$(DYNAMIPS_CODE) dynamips
|
||
|
- install dynamips $(DYNAMIPS_CODE)/nvram_export $(DESTDIR)/bin/
|
||
|
+ install dynamips $(DYNAMIPS_CODE)/nvram_export $(DESTDIR)/usr/bin/
|
||
|
rm -f dynamips
|
||
|
- 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 dynamips.1 $(DESTDIR)/usr/share/man/man1
|
||
|
+ install -m644 nvram_export.1 $(DESTDIR)/usr/share/man/man1
|
||
|
+ install -m644 hypervisor_mode.7 $(DESTDIR)/usr/share/man/man7
|
||
|
|
||
|
|
||
|
.PHONY: clean
|
||
|
diff -uNr old-dynamips-0.2.8-RC3//stable/Makefile dynamips-0.2.8-RC3/stable/Makefile
|
||
|
--- old-dynamips-0.2.8-RC3//stable/Makefile 2011-03-30 15:01:30.000000000 +0200
|
||
|
+++ dynamips-0.2.8-RC3/stable/Makefile 2011-04-11 16:33:05.115266219 +0200
|
||
|
@@ -10,9 +10,13 @@
|
||
|
DYNAMIPS_ARCH=x86
|
||
|
endif
|
||
|
|
||
|
-# Do you want to use lib (for 32 bit compiling) or lib64
|
||
|
+ifeq ($(DYNAMIPS_ARCH), amd64)
|
||
|
+DYNAMIPS_LIB?=lib64
|
||
|
+LIBDIR?=/usr/lib64
|
||
|
+else
|
||
|
DYNAMIPS_LIB?=lib
|
||
|
-
|
||
|
+LIBDIR?=/usr/lib
|
||
|
+endif
|
||
|
|
||
|
# Get include files from the current directory and from the common directory
|
||
|
INCLUDE+=-I. -I../common
|
||
|
@@ -38,8 +42,6 @@
|
||
|
VPATH = ../common
|
||
|
|
||
|
# Executable binary extension
|
||
|
-DESTDIR?=/usr
|
||
|
-BIN_EXT?=
|
||
|
|
||
|
CC?=gcc
|
||
|
LD=ld
|
||
|
@@ -51,7 +53,7 @@
|
||
|
PPC32_ARCH_INC_FILE=\"ppc32_$(DYNAMIPS_ARCH)_trans.h\"
|
||
|
OSNAME=unknown
|
||
|
|
||
|
-CFLAGS+= $(INCLUDE) -Wall -O3 -fomit-frame-pointer \
|
||
|
+CFLAGS+= $(INCLUDE) -Wall -fomit-frame-pointer \
|
||
|
-DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" -DJIT_CPU=CPU_$(DYNAMIPS_ARCH) \
|
||
|
-DMIPS64_ARCH_INC_FILE=$(MIPS64_ARCH_INC_FILE) \
|
||
|
-DPPC32_ARCH_INC_FILE=$(PPC32_ARCH_INC_FILE) \
|
||
|
@@ -73,11 +75,11 @@
|
||
|
else
|
||
|
ifeq ($(shell uname), Linux)
|
||
|
PTHREAD_LIBS?=-lpthread
|
||
|
-# PCAP_LIB=-lpcap
|
||
|
+ PCAP_LIB=-lpcap
|
||
|
OSNAME=Linux
|
||
|
CFLAGS+=-I/usr/include -I. $(PTHREAD_CFLAGS)
|
||
|
- LIBS=-L/usr/lib -L. -ldl -luuid /usr/$(DYNAMIPS_LIB)/libelf.a $(PTHREAD_LIBS)
|
||
|
- DESTDIR=/usr
|
||
|
+ LIBS=-L/$(LIBDIR) -L. -ldl -luuid -lelf $(PTHREAD_LIBS)
|
||
|
+# DESTDIR=/usr
|
||
|
else
|
||
|
ifeq ($(shell uname -s), Darwin)
|
||
|
OSNAME=Darwin
|
||
|
@@ -103,7 +105,7 @@
|
||
|
PCAP_LIB=-lpacket -lwpcap
|
||
|
else
|
||
|
CFLAGS+=-I/usr/include/libelf -D_FILE_OFFSET_BITS=64
|
||
|
- LIBS=-L. -ldl /usr/lib/libelf.a -lpthread
|
||
|
+ LIBS=-L. -ldl $(LIBDIR)/libelf.a -lpthread
|
||
|
endif
|
||
|
endif
|
||
|
endif
|
||
|
@@ -247,29 +249,29 @@
|
||
|
$(PROG): mips64_microcode_dump.inc ppc32_microcode_dump.inc \
|
||
|
$(LEX_C) $(C_OBJS) $(A_OBJS)
|
||
|
@echo "Linking $@"
|
||
|
- @$(CC) $(CFLAGS) -o $@ $(C_OBJS) $(A_OBJS) $(LIBS)
|
||
|
+ $(CC) $(CFLAGS) -o $@ $(C_OBJS) $(A_OBJS) $(LIBS)
|
||
|
|
||
|
udp_send$(BIN_EXT): udp_send.c net.c crc.c
|
||
|
@echo "Linking $@"
|
||
|
- @$(CC) -Wall $(CFLAGS) -o $@ udp_send.c net.c crc.c $(LIBS)
|
||
|
+ $(CC) -Wall $(CFLAGS) -o $@ udp_send.c net.c crc.c $(LIBS)
|
||
|
|
||
|
udp_recv$(BIN_EXT): udp_recv.c net.c crc.c
|
||
|
@echo "Linking $@"
|
||
|
- @$(CC) -Wall $(CFLAGS) -o $@ udp_recv.c net.c crc.c $(LIBS)
|
||
|
+ $(CC) -Wall $(CFLAGS) -o $@ udp_recv.c net.c crc.c $(LIBS)
|
||
|
|
||
|
rom2c$(BIN_EXT): rom2c.c
|
||
|
@echo "Linking $@"
|
||
|
- @$(CC) -Wall $(CFLAGS) -o $@ $< $(LIBS)
|
||
|
+ $(CC) -Wall $(CFLAGS) -o $@ $< $(LIBS)
|
||
|
|
||
|
mips64_microcode_dump.inc: rom2c$(BIN_EXT) mips64_microcode
|
||
|
- @./rom2c mips64_microcode mips64_microcode_dump.inc 0xbfc00000
|
||
|
+ ./rom2c mips64_microcode mips64_microcode_dump.inc 0xbfc00000
|
||
|
|
||
|
ppc32_microcode_dump.inc: rom2c$(BIN_EXT) ppc32_microcode
|
||
|
- @./rom2c ppc32_microcode ppc32_microcode_dump.inc 0xfff00000
|
||
|
+ ./rom2c ppc32_microcode ppc32_microcode_dump.inc 0xfff00000
|
||
|
|
||
|
asmdefs$(BIN_EXT): asmdefs.c mips64.h
|
||
|
@echo "Linking $@"
|
||
|
- @$(CC) -Wall $(CFLAGS) -o $@ asmdefs.c
|
||
|
+ $(CC) -Wall $(CFLAGS) -o $@ asmdefs.c
|
||
|
|
||
|
asmdefs.h: asmdefs$(BIN_EXT)
|
||
|
@echo "Building assembly definitions header file"
|
||
|
@@ -281,11 +283,11 @@
|
||
|
|
||
|
install: $(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 -d $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/man/man1 $(DESTDIR)/usr/shareman/man7 $(DESTDIR)/etc
|
||
|
+ install dynamips nvram_export $(DESTDIR)/usr/bin
|
||
|
+ install -m644 dynamips.1 $(DESTDIR)/usr/share/man/man1
|
||
|
+ install -m644 nvram_export.1 $(DESTDIR)/usr/share/man/man1
|
||
|
+ install -m644 hypervisor_mode.7 $(DESTDIR)/usr/share/man/man7
|
||
|
# install -m644 example $(DESTDIR)/etc/dynamips
|
||
|
|
||
|
|
||
|
@@ -312,11 +314,11 @@
|
||
|
|
||
|
.S.o:
|
||
|
@echo "Assembling $<"
|
||
|
- @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $<
|
||
|
+ $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $<
|
||
|
|
||
|
.c.o:
|
||
|
@echo "Compiling $<"
|
||
|
- @$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $<
|
||
|
+ $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $<
|
||
|
|
||
|
.l.c:
|
||
|
$(LEX) -o$*.c $<
|