From: Nicolas Boulenguez <nicolas@debian.org>
Date: Sun, 22 Jan 2023 20:52:34 +0100
Subject: let Make use CPPFLAGS and LDFLAGS if set

They are detected in the environment and on the command line.
---
 contrib/norman/numarkup/Makefile |  2 +-
 src/c/Makefile                   | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/contrib/norman/numarkup/Makefile b/contrib/norman/numarkup/Makefile
index 9165670..f45364a 100644
--- a/contrib/norman/numarkup/Makefile
+++ b/contrib/norman/numarkup/Makefile
@@ -27,7 +27,7 @@ clean:
 $(OBJS): global.h
 
 $(TARGET): $(OBJS)
-	$(CC) -o $(TARGET) $(OBJS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o $(TARGET) $(LDFLAGS) $(OBJS)
 
 numarkup.html: numarkup.nw
 	noweave -filter l2h -html -index numarkup.nw > numarkup.html
diff --git a/src/c/Makefile b/src/c/Makefile
index 52bf4e2..03a867c 100644
--- a/src/c/Makefile
+++ b/src/c/Makefile
@@ -35,25 +35,25 @@ CPIF=>
 .nw.tex: ;	noweave $*.nw >$*.tex
 .nw.c: ;	$(NOTANGLE) -L $*.nw >$*.c
 .nw.o: ;	$(NOTANGLE) -L $*.nw >$*.c
-		$(CC) $(CFLAGS) -c $*.c
+		$(CC) $(CPPFLAGS) $(CFLAGS) -c $*.c
 .nw.h: ;	$(NOTANGLE) -Rheader $*.nw $(CPIF) $*.h
 
 all:	nt markup mnt finduses nwmktemp
 
 nt:	$(TANGLEOBJS)
-	$(CC) $(CFLAGS) -o nt $(TANGLEOBJS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o nt $(LDFLAGS) $(TANGLEOBJS)
 
 nwmktemp: nwmktemp.o
-	$(CC) $(CFLAGS) -o nwmktemp nwmktemp.o
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o nwmktemp nwmktemp.o $(LDFLAGS)
 
 finduses:	$(FINDUSESOBJS)
-	$(CC) $(CFLAGS) -o finduses $(FINDUSESOBJS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o finduses $(LDFLAGS) $(FINDUSESOBJS)
 
 markup:	$(MARKUPOBJS)
-	$(CC) $(CFLAGS) -o markup $(MARKUPOBJS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o markup $(LDFLAGS) $(MARKUPOBJS)
 
 mnt:	$(MNTOBJS)
-	$(CC) $(CFLAGS) -o mnt $(MNTOBJS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o mnt $(LDFLAGS) $(MNTOBJS)
 
 source:	$(SRCS)
 touch: $(SRCS)
@@ -91,7 +91,7 @@ FPOBJS=fakepretty.o pretty.o errors.o getline.o match.o strsave.o columns.o
 fakepretty.o: pretty.h
 
 fakepretty: $(FPOBJS)
-	$(CC) $(CFLAGS) -o fakepretty $(FPOBJS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o fakepretty $(LDFLAGS) $(FPOBJS)
 
 
 columns.o:       columns.h 
