From 7fa0d31ec5c0be9dca84a03851b2d44f61527ec8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
Date: Sun, 4 Dec 2011 16:01:04 +0100
Subject: [PATCH] GNUmakefile: add possibility to override variables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

this is useful for cross compilation

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
Upstream-Status: Inappropriate [embedded specific]
 src/libbsd/GNUmakefile |   10 +++++-----
 src/libmy/GNUmakefile  |   26 +++++++++++++-------------
 src/nhttpd/GNUmakefile |   12 ++++++------
 src/tools/GNUmakefile  |    8 ++++----
 4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/libbsd/GNUmakefile b/src/libbsd/GNUmakefile
index e2d01a3..b034bc6 100644
--- a/src/libbsd/GNUmakefile
+++ b/src/libbsd/GNUmakefile
@@ -1,12 +1,12 @@
-CCFLAGS = -O2 -pipe -Wall -Werror -Wstrict-prototypes -c
+CFLAGS := -O2 -pipe -Wall -Werror -Wstrict-prototypes -c
 
 libbsd.a:	strlcpy.o strlcat.o
-		ar -r libbsd.a strlcpy.o strlcat.o
-		ranlib libbsd.a
+		$(AR) -r libbsd.a strlcpy.o strlcat.o
+		$(RANLIB) libbsd.a
 
 strlcpy.o:	strlcpy.c
-		cc ${CCFLAGS} strlcpy.c
+		$(CC) $(CFLAGS) strlcpy.c
 strlcat.o:	strlcat.c
-		cc ${CCFLAGS} strlcat.c
+		$(CC) $(CFLAGS) strlcat.c
 clean:
 		rm -f libbsd.a *.o
diff --git a/src/libmy/GNUmakefile b/src/libmy/GNUmakefile
index ce90dd9..891ffea 100644
--- a/src/libmy/GNUmakefile
+++ b/src/libmy/GNUmakefile
@@ -1,30 +1,30 @@
-CCFLAGS = -O2 -Wall -Werror -Wstrict-prototypes -c
+CFLAGS := -O2 -Wall -Werror -Wstrict-prototypes -c
 
 libmy.a:	strcutl.o strcutw.o strcuts.o strcuti.o strcutf.o flog.o flogd.o fparse.o strlower.o strb64d.o
-		ar -r libmy.a strcutl.o strcutw.o strcuts.o strcuti.o strcutf.o flog.o flogd.o fparse.o strlower.o strb64d.o
-		ranlib libmy.a
+		$(AR) -r libmy.a strcutl.o strcutw.o strcuts.o strcuti.o strcutf.o flog.o flogd.o fparse.o strlower.o strb64d.o
+		$(RANLIB) libmy.a
 
 strcutl.o:	strcutl.c
-		cc ${CCFLAGS} strcutl.c
+		$(CC) $(CFLAGS) strcutl.c
 strcutw.o:	strcutw.c
-		cc ${CCFLAGS} strcutw.c
+		$(CC) $(CFLAGS) strcutw.c
 strcuts.o:	strcuts.c
-		cc ${CCFLAGS} strcuts.c
+		$(CC) $(CFLAGS) strcuts.c
 strcuti.o:	strcuti.c
-		cc ${CCFLAGS} strcuti.c
+		$(CC) $(CFLAGS) strcuti.c
 strcutf.o:	strcutf.c
-		cc ${CCFLAGS} strcutf.c
+		$(CC) $(CFLAGS) strcutf.c
 strlower.o:	strlower.c
-		cc ${CCFLAGS} strlower.c
+		$(CC) $(CFLAGS) strlower.c
 strb64d.o:	strb64d.c
-		cc ${CCFLAGS} strb64d.c
+		$(CC) $(CFLAGS) strb64d.c
 
 flog.o:		flog.c
-		cc ${CCFLAGS} flog.c
+		$(CC) $(CFLAGS) flog.c
 flogd.o:	flogd.c
-		cc ${CCFLAGS} flogd.c
+		$(CC) $(CFLAGS) flogd.c
 fparse.o:	fparse.c
-		cc ${CCFLAGS} fparse.c
+		$(CC) $(CFLAGS) fparse.c
 
 clean:
 		rm -f libmy.a *.o
diff --git a/src/nhttpd/GNUmakefile b/src/nhttpd/GNUmakefile
index f6d12de..9524911 100644
--- a/src/nhttpd/GNUmakefile
+++ b/src/nhttpd/GNUmakefile
@@ -1,20 +1,20 @@
 #	$nostromo: GNUmakefile,v 1.6 2016/04/12 19:02:06 hacki Exp $
 
-CCFLAGS = -O2 -pipe -Wall -Wstrict-prototypes -c
+CFLAGS := -O2 -pipe -Wall -Wstrict-prototypes -c
 
 nhttpd:	main.o http.o sys.o
-	cc -L../libmy -L../libbsd -o nhttpd main.o http.o sys.o -lmy -lbsd -lssl -lcrypt
-	strip nhttpd
+	$(CC) -L../libmy -L../libbsd -o nhttpd main.o http.o sys.o -lmy -lbsd -lssl -lcrypt
+#	$(STRIP) nhttpd
 	nroff -Tascii -c -mandoc nhttpd.8 > nhttpd.cat8
 
 main.o:	main.c
-	cc ${CCFLAGS} main.c
+	$(CC) $(CFLAGS) main.c
 
 http.o:	http.c
-	cc ${CCFLAGS} http.c
+	$(CC) $(CFLAGS) http.c
 
 sys.o:	sys.c
-	cc ${CCFLAGS} sys.c
+	$(CC) $(CFLAGS) sys.c
 
 clean:
 	rm -f nhttpd nhttpd.cat8 *.o
diff --git a/src/tools/GNUmakefile b/src/tools/GNUmakefile
index 15bea61..663ddb5 100644
--- a/src/tools/GNUmakefile
+++ b/src/tools/GNUmakefile
@@ -1,13 +1,13 @@
 #	$nostromo: GNUmakefile,v 1.3 2016/04/12 19:02:58 hacki Exp $
 
-CCFLAGS = -O2 -pipe -Wall -Werror -Wstrict-prototypes -c
+CFLAGS = -O2 -pipe -Wall -Werror -Wstrict-prototypes
 
 crypt:		crypt.o
-		cc -L../libbsd -o crypt crypt.o -lcrypt -lbsd
-		strip crypt
+		$(CC) $(CFLAGS) -L../libbsd -o crypt crypt.o -lcrypt -lbsd
+#		$(STRIP) crypt
 
 crypt.o:	crypt.c
-		cc ${CCFLAGS} crypt.c
+		$(CC) $(CFLAGS) -c crypt.c
 
 clean:
 		rm -f crypt *.o
-- 
1.7.6.4

