Ticket #12606: Makefile.diff

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

General modifications to Makefile

  • Makefile

    diff -ur ../dynamips-0.2.7.orig/Makefile ./Makefile
    old new  
    2020VERSION_DEV=$(VERSION_TRAIN)-$(shell date +%Y%m%d-%H)
    2121
    2222# Executable binary extension
    23 DESTDIR?=/usr
    2423BIN_EXT?=
    2524
    2625CC?=gcc
     
    4039        -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
    4140        -DHAS_RFC2553=$(HAS_RFC2553)
    4241
    43 PCAP_LIB=/usr/local/lib/libpcap.a
     42PCAP_LIB=$(PREFIX)/lib/libpcap.a
    4443#PCAP_LIB=-lpcap
    4544
    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
    5945ifeq ($(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
    7548else
    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
    8251endif
    8352
    8453PROG=dynamips$(BIN_EXT)
     
    231200
    232201install: $(PROG) nvram_export
    233202        @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
    240209
    241210
    242211.PHONY: clean