File: Makefile

package info (click to toggle)
vectoroids 1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 676 kB
  • sloc: ansic: 2,308; makefile: 83; sh: 51
file content (32 lines) | stat: -rw-r--r-- 988 bytes parent folder | download
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
Description: enable hardening
 enable hardening with the -g flag and LDFLAGS (CPPFLAGS?)
Author: Christian T. Steigies <cts@debian.org>
Last-Update: 2025-03-02
Index: vectoroids/Makefile
===================================================================
--- vectoroids.orig/Makefile
+++ vectoroids/Makefile
@@ -20,10 +20,13 @@ SDL_LIB=$(shell sdl2-config --libs) $(MI
 NOSOUNDFLAG=__SOUND
 MIXER=-lSDL2_mixer
 
+# Debian hardening
+CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
 CFLAGS=-Wall -Wno-long-long -pedantic -std=c99 -O2 \
 	$(shell sdl2-config --cflags) -D$(NOSOUNDFLAG) \
+	$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS) \
 	-DDATA_PREFIX=\"$(DATA_PREFIX)\" -DJOY_$(JOY) -D$(TARGET_DEF)
-
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 
 all:	vectoroids
 
@@ -58,7 +61,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