1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
Description: enable hardening
enable hardening with the -g flag and LDFLAGS (CPPFLAGS?)
Author: Christian T. Steigies <cts@debian.org>
Last-Update: 2019-09-05
Index: vectoroids/Makefile
===================================================================
--- vectoroids.orig/Makefile
+++ vectoroids/Makefile
@@ -20,11 +20,16 @@ SDL_LIB=$(shell sdl-config --libs) $(MIX
NOSOUNDFLAG=__SOUND
MIXER=-lSDL_mixer
-CFLAGS=-Wall -Wno-long-long -pedantic -ansi -O2 \
+# Debian hardening
+CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
+CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+
+CFLAGS+=-Wall -Wno-long-long -pedantic -ansi \
$(shell sdl-config --cflags) -D$(NOSOUNDFLAG) \
-DDATA_PREFIX=\"$(DATA_PREFIX)\" -DJOY_$(JOY) -D$(TARGET_DEF)
-
all: vectoroids
embedded:
@@ -58,7 +63,7 @@ clean:
vectoroids: vectoroids.o
- $(CC) $(CFLAGS) vectoroids.o -o vectoroids $(SDL_LIB)
+ $(CC) $(CFLAGS) vectoroids.o -o vectoroids $(SDL_LIB) $(LDFLAGS)
vectoroids.o: vectoroids.c
|