Package: simtools / 0~git20171013+dfsg-1

build-flags 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
Description: Make sure CFLAGS and CPPFLAGS are respected in build
Author: Andreas Bombe <aeb@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # all of these can be over-ridden on the "make" command line if they don't suit your environment.
 
-CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow
-BIN=/usr/local/bin
+CFLAGS := -O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow $(CFLAGS)
+BIN=$(DESTDIR)/usr/bin
 INSTALL=install
 CC=gcc
 
--- a/extracters/rstsflx/Makefile
+++ b/extracters/rstsflx/Makefile
@@ -55,18 +55,18 @@
 #	coff2exe -s /djgpp/bin/go32.exe flx
 
 flx: $(OBJS)
-	$(CC) $(LDFLAGS) -o flx $(OBJS) $(EXTRAOBJS) -lreadline -lncurses $(EXTRAFLAGS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o flx $(OBJS) $(EXTRAOBJS) -lreadline -lncurses $(EXTRAFLAGS)
 
 # *** the rule below builds absio.o.  You need to use as source file
 # *** an appropriate file; in Unix that's probably unxabsio.c but check
 # *** the source file to be sure.
 
 absio.o: unxabsio.c
-	$(CC) -c -o absio.o $(CFLAGS) $<
+	$(CC) -c -o absio.o $(CPPFLAGS) $(CFLAGS) $<
 
 # general build rule for all other object files:
 .c.o:
-	$(CC) -c $(CFLAGS) $<
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
 
 kit:
 	rm -f *~