Package: princeprocessor / 0.22-1

sanitize-makefile.patch Patch series | 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Description: sanitize Makefile
 This patch allows the addition of hardening flags and also removes the
 artificial distinction between 32bit and 64bit binaries.
Author: Sascha Steinbiss <satta@debian.org>
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,33 +2,30 @@
 ##  Makefile for pp
 ##
 
-CFLAGS = -W -Wall -std=c99 -O2 -s
+CFLAGS += -W -Wall -std=c99 -O2 -s
 #CFLAGS = -W -Wall -std=c99 -g
 
-CC_LINUX32        = gcc
-CC_LINUX64        = gcc
+CC_LINUX32        = $(CC)
+CC_LINUX64        = $(CC)
 CC_WINDOWS32      = /usr/bin/i686-w64-mingw32-gcc
 CC_WINDOWS64      = /usr/bin/x86_64-w64-mingw32-gcc
 CC_OSX32          = /usr/bin/i686-apple-darwin10-gcc
 CC_OSX64          = /usr/bin/i686-apple-darwin10-gcc
 
-CFLAGS_LINUX32    = $(CFLAGS) -m32 -DLINUX
-CFLAGS_LINUX64    = $(CFLAGS) -m64 -DLINUX
+CFLAGS_LINUX32    = $(CFLAGS) -DLINUX
+CFLAGS_LINUX64    = $(CFLAGS) -DLINUX
 CFLAGS_WINDOWS32  = $(CFLAGS) -m32 -DWINDOWS
 CFLAGS_WINDOWS64  = $(CFLAGS) -m64 -DWINDOWS
 CFLAGS_OSX32      = $(CFLAGS) -m32 -DOSX
 CFLAGS_OSX64      = $(CFLAGS) -m64 -DOSX
 
-all: pp64.bin
-
-pp32: pp32.bin pp32.exe pp32.app
-pp64: pp64.bin pp64.exe pp64.app
+all: princeprocessor
 
 clean:
-	rm -f pp32.bin pp64.bin pp32.exe pp64.exe pp32.app pp64.app
+	rm -f princeprocessor pp32.bin pp64.bin pp32.exe pp64.exe pp32.app pp64.app
 
-pp32.bin: pp.c mpz_int128.h
-	$(CC_LINUX32)   $(CFLAGS_LINUX32)   -o $@ $^
+princeprocessor: pp.c mpz_int128.h
+	$(CC_LINUX32) $(CPPFLAGS) $(CFLAGS_LINUX32) -o $@ $^ $(LDFLAGS)
 
 pp64.bin: pp.c mpz_int128.h
 	$(CC_LINUX64)   $(CFLAGS_LINUX64)   -o $@ $^