summaryrefslogtreecommitdiff
blob: 3be4bb09eafa7f65f0ec309a717bb548e00c1e71 (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
Fixes makefile.in to respect DESTDIR during install
Fixes makefile.in to use $MAKE instead of 'make'
Fixes makefile.in to respect AR during libbas build

Patch by Kevin McCarthy <signals42@gmail.com>

--- Makefile.in
+++ Makefile.in
@@ -27,7 +27,7 @@
 libbas.a:	auto.o bas.o fs.o global.o token.o program.o \
 		str.o value.o var.o
 		rm -f $@
-		ar cq $@ auto.o bas.o fs.o global.o token.o program.o \
+		$(AR) cq $@ auto.o bas.o fs.o global.o token.o program.o \
 		str.o value.o var.o
 		@RANLIB@ libbas.a
 
@@ -35,7 +35,7 @@
 install-po-no:
 install-po-yes:	$(CATALOGS)
 		for cat in $(CATALOGS); do \
-		  dir=$(localedir)/`basename $$cat .mo`/LC_MESSAGES; \
+		  dir=$(DESTDIR)/$(localedir)/`basename $$cat .mo`/LC_MESSAGES; \
 		  [ -d $$dir ] || @INSTALL@ -m 755 -d $$dir; \
 		  @INSTALL@ -m 644 $$cat $$dir/bas.mo; \
 		done
@@ -44,14 +44,14 @@
 		for i in test/test*; do ./$$i || break; done
 
 install:	all
-		@INSTALL@ -m 755 -d @bindir@
-		@INSTALL@ bas @bindir@/bas
-		@INSTALL@ -m 755 -d @libdir@
-		@INSTALL@ -m 644 libbas.a @libdir@/libbas.a
-		@RANLIB@ @libdir@/libbas.a
-		@INSTALL@ -m 755 -d @mandir@/man1
-		@INSTALL@ -m 644 bas.1 @mandir@/man1/bas.1
-		make install-po
+		@INSTALL@ -m 755 -d $(DESTDIR)/@bindir@
+		@INSTALL@ bas $(DESTDIR)/@bindir@/bas
+		@INSTALL@ -m 755 -d $(DESTDIR)/@libdir@
+		@INSTALL@ -m 644 libbas.a $(DESTDIR)/@libdir@/libbas.a
+		@RANLIB@ $(DESTDIR)/@libdir@/libbas.a
+		@INSTALL@ -m 755 -d $(DESTDIR)/@mandir@/man1
+		@INSTALL@ -m 644 bas.1 $(DESTDIR)/@mandir@/man1/bas.1
+		$(MAKE) install-po
 
 .c.o:
 		$(CC) -c $(CPPFLAGS) $(CFLAGS) $<