From: Santiago Vila <sanvila@debian.org>
Subject: Changes to support dpkg-buildflags
Last-Update: 2025-01-10

--- a/Makefile.in
+++ b/Makefile.in
@@ -1,23 +1,22 @@
 all: gld
 
 gld: cnf.o server.o sql.o sockets.o greylist.o gld.h
-	@CC@ -O2 @DEFS@ -Wall server.o sql.o sockets.o cnf.o greylist.o @LIBS@ @SQL_LIBS@ -o gld
-	strip gld
+	@CC@ $(LDFLAGS) @DEFS@ server.o sql.o sockets.o cnf.o greylist.o @LIBS@ @SQL_LIBS@ -o gld
 
 sockets.o: sockets.c sockets.h
-	@CC@ -O2 @DEFS@ -Wall -c sockets.c
+	@CC@ $(CFLAGS) $(CPPFLAGS) @DEFS@ -c sockets.c
 
 cnf.o: cnf.c gld.h
-	@CC@ -O2 @DEFS@ -Wall -c cnf.c
+	@CC@ $(CFLAGS) $(CPPFLAGS) @DEFS@ -c cnf.c
 
 greylist.o: greylist.c gld.h
-	@CC@ -O2 @DEFS@ -Wall -c greylist.c
+	@CC@ $(CFLAGS) $(CPPFLAGS) @DEFS@ -c greylist.c
 
 server.o: server.c gld.h
-	@CC@ -O2 @DEFS@ -Wall -c server.c
+	@CC@ $(CFLAGS) $(CPPFLAGS) @DEFS@ -c server.c
 
 sql.o: sql.c
-	@CC@ -O2 @DEFS@ @SQL_CFLAGS@ -Wall -c sql.c
+	@CC@ $(CFLAGS) $(CPPFLAGS) @DEFS@ @SQL_CFLAGS@ -c sql.c
 
 clean:
 	rm -f  gld *.o
