Description: Support build flags injection Proper support of LDFLAGS / CFLAGS / CPPFLAGS is required so that dpkg-buildflags can inject supplementary build options. Author: Raphaƫl Hertzog Origin: vendor Last-Update: 2015-07-28 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ Index: memdump/Makefile =================================================================== --- memdump.orig/Makefile +++ memdump/Makefile @@ -1,9 +1,13 @@ SHELL = /bin/sh -CC = gcc -Wformat -Wunused +CC = gcc OPT = -O DEBUG = -g PROGS = memdump -CFLAGS = $(OPT) $(DEBUG) -I. $(XFLAGS) $(DEFS) +ifneq ($(DEFS),) +# Only complete variables once when we're called with make DEFS="something" +CPPFLAGS += -I. $(DEFS) +CFLAGS += -Wall -Wno-comment +endif OBJS = memdump.o convert_size.o error.o mymalloc.o PROGS = memdump MAN = memdump.1 @@ -16,7 +20,7 @@ all: $(PROGS) manpages: $(MAN) memdump: $(OBJS) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(SYSLIBS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(SYSLIBS) memdump.1: memdump.c srctoman $? >$@ Index: memdump/makedefs =================================================================== --- memdump.orig/makedefs +++ memdump/makedefs @@ -40,5 +40,5 @@ esac unset MAKELEVEL # shut up chatty GNU make -make DEFS="$DEFS" CC="${CC-gcc -Wunused}" RANLIB="${RANLIB-ranlib}" \ +make DEFS="$DEFS" CC="${CC-gcc}" RANLIB="${RANLIB-ranlib}" \ AR="${AR-ar rv}" SYSLIBS="$SYSLIBS" all