diff -ur ../dynamips-0.2.7.orig/Makefile ./Makefile
old
|
new
|
|
20 | 20 | VERSION_DEV=$(VERSION_TRAIN)-$(shell date +%Y%m%d-%H) |
21 | 21 | |
22 | 22 | # Executable binary extension |
23 | | DESTDIR?=/usr |
24 | 23 | BIN_EXT?= |
25 | 24 | |
26 | 25 | CC?=gcc |
… |
… |
|
40 | 39 | -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \ |
41 | 40 | -DHAS_RFC2553=$(HAS_RFC2553) |
42 | 41 | |
43 | | PCAP_LIB=/usr/local/lib/libpcap.a |
| 42 | PCAP_LIB=$(PREFIX)/lib/libpcap.a |
44 | 43 | #PCAP_LIB=-lpcap |
45 | 44 | |
46 | | ifeq ($(shell uname), FreeBSD) |
47 | | PTHREAD_LIBS?=-pthread |
48 | | CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS) \ |
49 | | -D_FILE_OFFSET_BITS=64 |
50 | | LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS) |
51 | | else |
52 | | ifeq ($(shell uname), Linux) |
53 | | PTHREAD_LIBS?=-lpthread |
54 | | # PCAP_LIB=-lpcap |
55 | | CFLAGS+=-I/usr/include -I. $(PTHREAD_CFLAGS) |
56 | | LIBS=-L/usr/lib -L. /usr/lib/libelf.a $(PTHREAD_LIBS) |
57 | | DESTDIR=/usr |
58 | | else |
59 | 45 | ifeq ($(shell uname -s), Darwin) |
60 | | CFLAGS+=-I/usr/local/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64 |
61 | | LIBS=-L/usr/local/lib -L. -lelf -lpthread |
62 | | else |
63 | | ifeq ($(shell uname -s), SunOS) |
64 | | CFLAGS+=-I/usr/local/include -DINADDR_NONE=0xFFFFFFFF \ |
65 | | -I /opt/csw/include -DSUNOS |
66 | | LIBS=-L/usr/local/lib -L. -lelf -lpthread -L/opt/csw/lib \ |
67 | | -lsocket -lnsl -lresolv |
68 | | PCAP_LIB=/opt/csw/lib/libpcap.a |
69 | | else |
70 | | ifeq ($(shell uname -o), Cygwin) |
71 | | CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf -DCYGWIN \ |
72 | | -D_FILE_OFFSET_BITS=64 |
73 | | LIBS=-L/usr/local/lib -L. -lelf -lpthread |
74 | | PCAP_LIB=-lpacket -lwpcap |
| 46 | CFLAGS+=-I$(PREFIX)/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64 |
| 47 | LIBS=-L$(PREFIX)/lib -L. -lelf -lpthread |
75 | 48 | else |
76 | | CFLAGS+=-I/usr/include/libelf -D_FILE_OFFSET_BITS=64 |
77 | | LIBS=-L. /usr/lib/libelf.a -lpthread |
78 | | endif |
79 | | endif |
80 | | endif |
81 | | endif |
| 49 | CFLAGS+=-I$(PREFIX)/include/libelf -D_FILE_OFFSET_BITS=64 |
| 50 | LIBS=-L. $(PREFIX)/lib/libelf.a -lpthread |
82 | 51 | endif |
83 | 52 | |
84 | 53 | PROG=dynamips$(BIN_EXT) |
… |
… |
|
231 | 200 | |
232 | 201 | install: $(PROG) nvram_export |
233 | 202 | @echo "Installing" |
234 | | install -d $(DESTDIR)/bin $(DESTDIR)/man/man1 $(DESTDIR)/man/man7 $(DESTDIR)/etc |
235 | | install dynamips nvram_export $(DESTDIR)/bin |
236 | | install -m644 dynamips.1 $(DESTDIR)/man/man1 |
237 | | install -m644 nvram_export.1 $(DESTDIR)/man/man1 |
238 | | install -m644 hypervisor_mode.7 $(DESTDIR)/man/man7 |
239 | | # install -m644 example $(DESTDIR)/etc/dynamips |
| 203 | install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 $(DESTDIR)$(PREFIX)/share/man/man7 $(DESTDIR)$(PREFIX)/etc |
| 204 | install dynamips nvram_export $(DESTDIR)$(PREFIX)/bin |
| 205 | install -m644 dynamips.1 $(DESTDIR)$(PREFIX)/share/man/man1 |
| 206 | install -m644 nvram_export.1 $(DESTDIR)$(PREFIX)/share/man/man1 |
| 207 | install -m644 hypervisor_mode.7 $(DESTDIR)$(PREFIX)/share/man/man7 |
| 208 | # install -m644 example $(DESTDIR)$(PREFIX)/etc/dynamips |
240 | 209 | |
241 | 210 | |
242 | 211 | .PHONY: clean |