Commit 40a02e5a327d9f0af95f6db31194244828eb60a5

John Arbuckle 2015-04-26T19:49:15

fcode-utils: add Makefile install target Add an install target to the fcode-utils Makefiles for toke, detok and romheaders so that "make install" will work correctly. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/fcode-utils-devel@1335 f158a5a8-5612-0410-a976-696ce0be7e32

diff --git a/detok/Makefile b/detok/Makefile
index 0b730dc..3ba6c30 100644
--- a/detok/Makefile
+++ b/detok/Makefile
@@ -24,6 +24,7 @@
 
 PROGRAM = detok
 
+DESTDIR = /usr/local
 CC      ?= gcc
 STRIP	= strip
 INCLUDES = -I../shared
@@ -63,3 +64,6 @@ clean:
 .c.o:
 	$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@ 
 
+install:
+	mkdir -p $(DESTDIR)/bin
+	cp $(PROGRAM) $(DESTDIR)/bin/$(PROGRAM)
diff --git a/romheaders/Makefile b/romheaders/Makefile
index 7d47a21..a216e7b 100644
--- a/romheaders/Makefile
+++ b/romheaders/Makefile
@@ -22,6 +22,9 @@
 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
 #
 
+PROGRAM = romheaders
+
+DESTDIR  = /usr/local
 CC	 ?= gcc
 STRIP    = strip
 CFLAGS   = -O2 -Wall -Wextra
@@ -39,4 +42,8 @@ romheaders: $(SOURCES)
 
 clean:
 	rm -f *~
-	rm -f romheaders
+	rm -f $(PROGRAM)
+
+install:
+	mkdir -p $(DESTDIR)/bin
+	cp $(PROGRAM) $(DESTDIR)/bin/$(PROGRAM)
diff --git a/toke/Makefile b/toke/Makefile
index a3d81b1..aa75acd 100644
--- a/toke/Makefile
+++ b/toke/Makefile
@@ -24,6 +24,7 @@
 
 PROGRAM = toke
 
+DESTDIR = /usr/local
 CC      ?= gcc
 STRIP	= strip
 INCLUDES = -I../shared
@@ -73,3 +74,6 @@ documentation:: *.c *.h toke.doxygen
 .c.o:
 	$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@ 
 
+install:
+	mkdir -p $(DESTDIR)/bin
+	cp $(PROGRAM) $(DESTDIR)/bin/$(PROGRAM)