From 8542d83e917ad42ed38403fa8204da27e170e189 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Wed, 10 Oct 2012 09:31:49 -0600 Subject: [PATCH] modify upstream makefile to allow hardening build flags to apply --- Makefile | 7 +++--- debian/patches/makefile-support-hardening | 29 +++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 debian/patches/makefile-support-hardening create mode 100644 debian/patches/series diff --git a/Makefile b/Makefile index 5e0fddb..301fd02 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ -OPTIMIZE = -O2 CC = gcc MATHLIB = -lm @@ -13,16 +12,16 @@ INCLUDES = block.h blocke.h config.h core.h coree.h defaults.h double.h \ string.h tools.h toolse.h udio.h ver.h ycore.h yforth.h yforth: div.h $(OBJECTS) - $(CC) -o yforth $(OBJECTS) $(MATHLIB) + $(CC) -o yforth $(LDFLAGS) $(OBJECTS) $(MATHLIB) div.h: div ./div div: division.c - $(CC) -o div division.c + $(CC) -o div $(CFLAGS) division.c .c.o: - $(CC) -c -o $@ $(OPTIMIZE) $< + $(CC) -c -o $@ $(CFLAGS) $< clean: rm -f *.o yforth div.h div diff --git a/debian/patches/makefile-support-hardening b/debian/patches/makefile-support-hardening new file mode 100644 index 0000000..9b0cc5b --- /dev/null +++ b/debian/patches/makefile-support-hardening @@ -0,0 +1,29 @@ +diff --git a/Makefile b/Makefile +index 5e0fddb..301fd02 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,4 +1,3 @@ +-OPTIMIZE = -O2 + CC = gcc + MATHLIB = -lm + +@@ -13,16 +12,16 @@ INCLUDES = block.h blocke.h config.h core.h coree.h defaults.h double.h \ + string.h tools.h toolse.h udio.h ver.h ycore.h yforth.h + + yforth: div.h $(OBJECTS) +- $(CC) -o yforth $(OBJECTS) $(MATHLIB) ++ $(CC) -o yforth $(LDFLAGS) $(OBJECTS) $(MATHLIB) + + div.h: div + ./div + + div: division.c +- $(CC) -o div division.c ++ $(CC) -o div $(CFLAGS) division.c + + .c.o: +- $(CC) -c -o $@ $(OPTIMIZE) $< ++ $(CC) -c -o $@ $(CFLAGS) $< + + clean: + rm -f *.o yforth div.h div diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..2527093 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +makefile-support-hardening -- 2.30.2