summaryrefslogtreecommitdiffstats
path: root/patches/figlet222/prefix-destdir-crosscompile.diff
blob: 3ce3cb1e5ba12961e1f73ebc20ea473f51c81d17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Improve makefile to allow cross-compilation

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 Makefile |   29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

Index: Makefile
===================================================================
--- Makefile.orig
+++ Makefile
@@ -11,19 +11,20 @@
 # Don't change this even if your shell is different. The only reason
 # for changing this is if sh is not in the same place.
 SHELL = /bin/sh
-CC = gcc
-CFLAGS = -g
+CC ?= gcc
+CFLAGS ?= -g
 
+prefix = /usr/local
 # Where the executables should be put
-DESTDIR = /usr/local/bin
+BINDIR = $(prefix)/bin
 
 # Where the man page should be put
-MANDIR = /usr/local/man/man6
+MANDIR = $(prefix)/man/man6
 
 # Where figlet will search first for fonts (the ".flf" files).
-DEFAULTFONTDIR = /usr/local/share/figlet
+DEFAULTFONTDIR = $(prefix)/share/figlet
 # Use this definition if you can't put things in /usr/local/share/figlet
-DEFAULTFONTDIR = fonts
+#DEFAULTFONTDIR = fonts
 
 # The filename of the font to be used if no other is specified
 #   (standard.flf is recommended, but any other can be used).
@@ -52,11 +53,11 @@ clean:
 	rm -f *.o figlet chkfont
 
 install: figlet chkfont
-	mkdir -p $(DEFAULTFONTDIR)
-	cp figlet $(DESTDIR)
-	cp figlet.6 $(MANDIR)
-	cp chkfont $(DESTDIR)
-	cp figlist $(DESTDIR)
-	cp showfigfonts $(DESTDIR)
-	cp fonts/*.flf $(DEFAULTFONTDIR)
-	cp fonts/*.flc $(DEFAULTFONTDIR)
+	install -m 755 -D figlet $(DESTDIR)$(BINDIR)/figlet
+	install -m 644 -D figlet.6 $(DESTDIR)$(MANDIR)/figlet.6
+	install -m 755 -D chkfont $(DESTDIR)$(BINDIR)/chkfont
+	install -m 755 -D figlist $(DESTDIR)$(BINDIR)/figlist
+	install -m 755 -D showfigfonts $(DESTDIR)$(BINDIR)/showfigfonts
+	for FILE in fonts/*.fl[fc]; do \
+		install -m 644 -D $$FILE $(DESTDIR)$(DEFAULTFONTDIR)/$$FILE; \
+	done