summarylogtreecommitdiffstats
path: root/fix-makefile-v2.1.patch
blob: 4050481b98c6772a242e2c884ce9a51a832ac412 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
--- Makefile	2021-02-14 14:08:54.860536559 +0100
+++ Makefile	2021-02-14 14:19:49.782369663 +0100
@@ -14,9 +14,8 @@
   EXESUFFIX 		?=
 endif
 
-DESTDIR ?= /usr/local
-
-prefix_share = $(DESTDIR)/share/z88dk
+prefix ?= /usr/local
+prefix_share = $(prefix)/share/z88dk
 git_rev ?= $(shell git rev-parse --short HEAD)
 git_count ?= $(shell git rev-list --count HEAD)
 version ?= $(shell date +%Y%m%d)
@@ -59,7 +58,7 @@
 ALL_EXT = bin/zsdcc$(EXESUFFIX)
 
 .PHONY: all
-all: 	$(ALL) $(ALL_EXT)
+all: 	$(ALL)
 
 src/config.h:
 	$(shell if [ "${git_count}" != "" ]; then \
@@ -175,29 +174,30 @@
 	cd libsrc ; $(MAKE) install
 
 install: install-clean
-	install -d $(DESTDIR) $(DESTDIR)/bin $(prefix_share)/lib $(prefix_share)/src
-	$(MAKE) -C src/appmake PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/copt PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/ucpp PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/cpp PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/sccz80 PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/z80asm  PREFIX=$(DESTDIR) PREFIX_SHARE=$(prefix_share) install
-	$(MAKE) -C src/zcc PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/zpragma PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/zx7 PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/z80nm PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/zobjcopy PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/ticks PREFIX=$(DESTDIR) install
-	$(MAKE) -C src/z88dk-lib PREFIX=$(DESTDIR) install
-	$(MAKE) -C support/graphics PREFIX=$(DESTDIR) install
-	$(MAKE) -C support/basck PREFIX=$(DESTDIR) install
-	$(MAKE) -C support/pv1000 PREFIX=$(DESTDIR) install
-	if [ -f bin/zsdcpp$(EXESUFFIX) ]; then cp bin/zsdcpp$(EXESUFFIX) $(DESTDIR)/bin/; fi
-	if [ -f bin/zsdcc$(EXESUFFIX) ]; then cp bin/zsdcc$(EXESUFFIX) $(DESTDIR)/bin/; fi
-	cp -r include $(prefix_share)/
-	cp -r lib $(prefix_share)/
-	cp -r libsrc $(prefix_share)/
-	cp -r src/m4 $(prefix_share)/src/
+	install -d $(DESTDIR)$(prefix) $(DESTDIR)$(prefix)/bin
+	install -d $(DESTDIR)$(prefix_share)/lib $(DESTDIR)$(prefix_share)/src
+	$(MAKE) -C src/appmake PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/copt PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/ucpp PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/cpp PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/sccz80 PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/z80asm  PREFIX=$(DESTDIR)$(prefix) PREFIX_SHARE=$(DESTDIR)$(prefix_share) install
+	$(MAKE) -C src/zcc PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/zpragma PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/zx7 PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/z80nm PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/zobjcopy PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/ticks PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C src/z88dk-lib PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C support/graphics PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C support/basck PREFIX=$(DESTDIR)$(prefix) install
+	$(MAKE) -C support/pv1000 PREFIX=$(DESTDIR)$(prefix) install
+	if [ -f bin/zsdcpp$(EXESUFFIX) ]; then cp bin/zsdcpp$(EXESUFFIX) $(DESTDIR)$(prefix)/bin/; fi
+	if [ -f bin/zsdcc$(EXESUFFIX) ]; then cp bin/zsdcc$(EXESUFFIX) $(DESTDIR)$(prefix)/bin/; fi
+	cp -r include $(DESTDIR)$(prefix_share)/
+	cp -r lib $(DESTDIR)$(prefix_share)/
+	cp -r libsrc $(DESTDIR)$(prefix_share)/
+	cp -r src/m4 $(DESTDIR)$(prefix_share)/src/
 
 
 # BSD install syntax below