Ticket #15215: Makefile.diff

File Makefile.diff, 2.8 KB (added by xunil@…, 17 years ago)

Replacement for original Makefile.diff

  • Makefile

    old new  
    2323VERSION_DEV=$(VERSION_TRAIN)-$(shell date +%Y%m%d-%H)
    2424
    2525# Executable binary extension
    26 DESTDIR?=/usr
    2726BIN_EXT?=
    2827
    2928CC?=gcc
     
    4443        -DHAS_RFC2553=$(HAS_RFC2553) \
    4544        -DHAS_POSIX_MEMALIGN=$(HAS_POSIX_MEMALIGN)
    4645
    47 #PCAP_LIB=/usr/local/lib/libpcap.a
    48 PCAP_LIB=-lpcap
     46PCAP_LIB=$(PREFIX)/lib/libpcap.a
     47#PCAP_LIB=-lpcap
     48
    4949
    50 ifeq ($(shell uname), FreeBSD)
    51    PTHREAD_LIBS?=-pthread
    52    LOCALBASE?=/usr/local
    53    CFLAGS+=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/libelf \
    54         $(PTHREAD_CFLAGS) -D_FILE_OFFSET_BITS=64
    55    LIBS=-L$(LOCALBASE)/lib -L. -ldl -lelf $(PTHREAD_LIBS) $(LDFLAGS)
    56 else
    57 ifeq ($(shell uname), Linux)
    58    PTHREAD_LIBS?=-lpthread
    59 #   PCAP_LIB=-lpcap
    60    CFLAGS+=-I/usr/include -I. $(PTHREAD_CFLAGS)
    61    LIBS=-L/usr/lib -L. -ldl /usr/lib/libelf.a $(PTHREAD_LIBS)
    62    DESTDIR=/usr
    63 else
    6450ifeq ($(shell uname -s), Darwin)
    65    CFLAGS+=-I/usr/local/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64
    66    LIBS=-L/usr/local/lib -L. -ldl -lelf -lpthread
    67 else
    68 ifeq ($(shell uname -s), SunOS)
    69    CFLAGS+=-I/usr/local/include -DINADDR_NONE=0xFFFFFFFF \
    70         -I /opt/csw/include -DSUNOS
    71    LIBS=-L/usr/local/lib -L. -ldl -lelf -lpthread -L/opt/csw/lib \
    72         -lsocket -lnsl -lresolv
    73    PCAP_LIB=/opt/csw/lib/libpcap.a
     51   CFLAGS+=-I$(PREFIX)/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64
     52   LIBS=-L$(PREFIX)/lib -L. -lelf -lpthread
    7453else
    75 ifeq ($(shell uname -o), Cygwin)
    76    CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf -DCYGWIN \
    77         -D_FILE_OFFSET_BITS=64
    78    LIBS=-L/usr/local/lib -L. -lelf -lpthread
    79    PCAP_LIB=-lpacket -lwpcap
    80 else
    81    CFLAGS+=-I/usr/include/libelf -D_FILE_OFFSET_BITS=64
    82    LIBS=-L. -ldl /usr/lib/libelf.a -lpthread
    83 endif
    84 endif
    85 endif
    86 endif
     54   CFLAGS+=-I$(PREFIX)/include/libelf -D_FILE_OFFSET_BITS=64
     55   LIBS=-L. -ldl $(PREFIX)/lib/libelf.a -lpthread
    8756endif
    8857
    8958PROG=dynamips$(BIN_EXT)
     
    252221
    253222install: $(PROG) nvram_export
    254223        @echo "Installing"
    255         install -d $(DESTDIR)/bin $(DESTDIR)/man/man1 $(DESTDIR)/man/man7 $(DESTDIR)/etc
    256         install dynamips nvram_export   $(DESTDIR)/bin
    257         install -m644 dynamips.1        $(DESTDIR)/man/man1
    258         install -m644 nvram_export.1    $(DESTDIR)/man/man1
    259         install -m644 hypervisor_mode.7 $(DESTDIR)/man/man7
    260 # install -m644 example         $(DESTDIR)/etc/dynamips
     224        install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 $(DESTDIR)$(PREFIX)/share/man/man7 $(DESTDIR)$(PREFIX)/etc
     225        install dynamips nvram_export   $(DESTDIR)$(PREFIX)/bin
     226        install -m644 dynamips.1        $(DESTDIR)$(PREFIX)/share/man/man1
     227        install -m644 nvram_export.1    $(DESTDIR)$(PREFIX)/share/man/man1
     228        install -m644 hypervisor_mode.7 $(DESTDIR)$(PREFIX)/share/man/man7
     229# install -m644 example         $(DESTDIR)$(PREFIX)/etc/dynamips
    261230
    262231
    263232.PHONY: clean