Ticket #64083: 1001-makefile.patch

File 1001-makefile.patch, 1.0 KB (added by RobK88, 3 years ago)

First Patch

  • Makefile

    Description: Handle DESTDIR variable to properly install stuff.
    Author: Alessio Treglia <alessio@debian.org>
    Last-Update: 2014-07-11
    old new  
    11PREFIX    ?= /usr/local
    22CC         = gcc
    3 CFLAGS    ?= -O2 -g -funroll-loops -frename-registers
     3CFLAGS    += -funroll-loops -frename-registers
    44CFLAGS    += -D_LARGEFILE_SOURCE -DLARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_REENTRANT
    55CFLAGS    += -Wall
    66OBJECTS    = main.o
    M2VRequantiser : $(OBJECTS) 
    1414        $(CC) $(CFLAGS) $(OBJECTS) $(LDFLAGS) $(LOADLIBES) -o M2VRequantiser
    1515
    1616%.o : %.c
    17         $(CC) $(CFLAGS) -c $<
     17        $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
    1818
    1919install:        all
    20         $(INSTALL) -d $(PREFIX)/bin
    21         $(INSTALL) -m 755 M2VRequantiser $(PREFIX)/bin
     20        $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
     21        $(INSTALL) -m 755 M2VRequantiser $(DESTDIR)$(PREFIX)/bin
    2222       
    2323uninstall:
    24         rm -f $(PREFIX)/bin/M2VRequantiser
     24        rm -f $(DESTDIR)$(PREFIX)/bin/M2VRequantiser
    2525
    2626clean:
    2727        rm -f M2VRequantiser *.o *~ core