Commit bef13df34944cfcea3cee86bca9f3ecbe80accbb

Stefan Reinauer 2009-11-29T13:49:47

slightly rework fcode-utils makefiles: - honor $(MAKE) for those invoking with gmake instead of make - wipe overzealous make distclean - drop -s from strip arguments Signed-off-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/openbios/trunk/fcode-utils-devel@636 f158a5a8-5612-0410-a976-696ce0be7e32

diff --git a/Makefile b/Makefile
index c9d4c41..bd97123 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
 #  This program is part of a free implementation of the IEEE 1275-1994
 #  Standard for Boot (Initialization Configuration) Firmware.
 #
-#  Copyright (C) 2006 coresystems GmbH <info@coresystems.de>
+#  Copyright (C) 2006-2009 coresystems GmbH <info@coresystems.de>
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -24,26 +24,26 @@
 VERSION:=$(shell grep ^\#.*TOKE_VERSION < toke/toke.c |cut -f2 -d\" )
 
 all:
-	make -C toke
-	make -C detok
-	make -C romheaders
+	$(MAKE) -C toke
+	$(MAKE) -C detok
+	$(MAKE) -C romheaders
 
 install:
-	make -C toke install
-	make -C detok install
-	make -C romheaders install
+	$(MAKE) -C toke install
+	$(MAKE) -C detok install
+	$(MAKE) -C romheaders install
 
 clean:	
-	make -C toke clean
-	make -C detok clean
-	make -C romheaders clean
-	make -C testsuite clean
+	$(MAKE) -C toke clean
+	$(MAKE) -C detok clean
+	$(MAKE) -C romheaders clean
+	$(MAKE) -C testsuite clean
 
 distclean: clean
-	make -C toke distclean
-	make -C detok distclean
-	make -C romheaders distclean
-	make -C testsuite distclean
+	$(MAKE) -C toke distclean
+	$(MAKE) -C detok distclean
+	$(MAKE) -C romheaders distclean
+	$(MAKE) -C testsuite distclean
 	find . -name "*.gcda" -exec rm -f \{\} \;
 	find . -name "*.gcno" -exec rm -f \{\} \;
 
@@ -51,8 +51,8 @@ tests: all
 	cp toke/toke testsuite
 	cp detok/detok testsuite
 	cp romheaders/romheaders testsuite
-	make -C testsuite all CygTestLogs=`pwd`/testlogs/testlogs-ppc-linux
-	#make -C testsuite all CygTestLogs=`pwd`/testlogs/testlogs-x86-cygwin
+	$(MAKE) -C testsuite all CygTestLogs=`pwd`/testlogs/testlogs-ppc-linux
+	#$(MAKE) -C testsuite all CygTestLogs=`pwd`/testlogs/testlogs-x86-cygwin
 
 # lcov required for html reports
 coverage:
diff --git a/detok/Makefile b/detok/Makefile
index e7c7c04..897e0eb 100644
--- a/detok/Makefile
+++ b/detok/Makefile
@@ -6,7 +6,7 @@
 #  Standard for Boot (Initialization Configuration) Firmware.
 #
 #  Copyright (C) 2001-2006  Stefan Reinauer <stepan@openbios.org>
-#  Copyright (C) 2006 coresystems GmbH <info@coresystems.de>
+#  Copyright (C) 2006-2009 coresystems GmbH <info@coresystems.de>
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -24,12 +24,12 @@
 
 PROGRAM = detok
 
-CC      = gcc
+CC      ?= gcc
 STRIP	= strip
 INCLUDES = -I../shared
 
 # Normal Flags:
-CFLAGS  = -O2 -Wall -Wno-pointer-sign 
+CFLAGS  = -O2 -Wall -Wextra
 LDFLAGS = 
 
 # Coverage:
@@ -47,12 +47,10 @@ all: .dependencies $(PROGRAM)
 
 $(PROGRAM): $(OBJS)
 	$(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
-	$(STRIP) -s $(PROGRAM)
+	$(STRIP) $(PROGRAM)
 
 clean:
 	rm -f $(OBJS) *~
-
-distclean: clean
 	rm -f $(PROGRAM) .dependencies
 	
 .dependencies: *.c 
diff --git a/romheaders/Makefile b/romheaders/Makefile
index 3794aeb..0ab3332 100644
--- a/romheaders/Makefile
+++ b/romheaders/Makefile
@@ -5,7 +5,8 @@
 #  This program is part of a free implementation of the IEEE 1275-1994 
 #  Standard for Boot (Initialization Configuration) Firmware.
 #
-#  Copyright (C) 2002  Stefan Reinauer, <stepan@openbios.net>
+#  Copyright (C) 2002 Stefan Reinauer, <stepan@openbios.org>
+#  Copyright (C) 2009 coresystems GmbH <info@coresystems.de>
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -21,8 +22,9 @@
 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
 #
 
-CC  = gcc
-CFLAGS= -O2 -Wall -W -ansi -I../shared
+CC	?= gcc
+STRIP	= strip
+CFLAGS	= -O2 -Wall -W -ansi -I../shared
 
 SOURCES = romheaders.c ../shared/classcodes.c
 
@@ -32,10 +34,9 @@ all: romheaders
 
 romheaders: $(SOURCES)
 	$(CC) $(CFLAGS) $(SOURCES) -o $@
-	strip romheaders
+	$(STRIP) romheaders
 	
 clean:
 	rm -f *~
-
-distclean: clean
 	rm -f romheaders
+
diff --git a/toke/Makefile b/toke/Makefile
index 14ae095..82e7ab2 100644
--- a/toke/Makefile
+++ b/toke/Makefile
@@ -6,7 +6,7 @@
 #  Standard for Boot (Initialization Configuration) Firmware.
 #
 #  Copyright (C) 2001-2006  Stefan Reinauer <stepan@openbios.org>
-#  Copyright (C) 2006 coresystems GmbH <info@coresystems.de>
+#  Copyright (C) 2006-2009 coresystems GmbH <info@coresystems.de>
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -24,12 +24,12 @@
 
 PROGRAM = toke
 
-CC      = gcc
+CC      ?= gcc
 STRIP	= strip
 INCLUDES = -I../shared
 
 # Normal flags
-CFLAGS  = -O2 -Wall -Wno-pointer-sign -fno-strict-aliasing 
+CFLAGS  = -O2 -Wall -Wextra 
 LDFLAGS =
 
 # Coverage:
@@ -48,14 +48,12 @@ all: .dependencies $(PROGRAM)
 
 $(PROGRAM): $(OBJS)
 	$(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
-	$(STRIP) -s $(PROGRAM)
+	$(STRIP) $(PROGRAM)
 
 clean:
 	rm -f $(OBJS) *~
-
-distclean: clean
 	rm -f $(PROGRAM) .dependencies
-	
+
 .dependencies: *.c 
 	@$(CC) $(CFLAGS) $(INCLUDES) -MM *.c > .dependencies