summaryrefslogtreecommitdiff
path: root/emulators/cpmemu/files/patch-ab
blob: 59c238229f1b34a3933eb90952a6c82d80e8f2f3 (plain) (blame)
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
--- Makefile.orig	Mon Nov 15 06:49:52 1999
+++ Makefile	Mon Nov 15 06:54:21 1999
@@ -2,26 +2,26 @@
 
 
 # basic prefix for installation
-PREFIX = /usr/local
+PREFIX ?= /usr/local
 
 # where to install `cpm' executable.
 BINDIR = $(PREFIX)/bin
 
 # where `cpm' looks for its files (cpm.sys and .com files).
-CPMLIBDIR = $(PREFIX)/lib/cpm
+CPMLIBDIR = $(PREFIX)/share/cpm
 
 
 # You shouldn't need to edit below this line.
 
-CC = gcc
+CC ?= gcc
 
-CFLAGS = -O2 -pipe -ansi -Wall \
+CFLAGS += -ansi -Wall \
 	-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
 	-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \
 	-Wnested-externs -Wwrite-strings \
 	-DCPMLIBDIR=\"$(CPMLIBDIR)\"
 
-LDFLAGS = -s
+LDFLAGS += -s
 
 OBJS = single.o z80emu.o em.o io.o bios.o \
 	commands.o running.o main.o disneu.o disz80.o low.o
@@ -42,11 +42,14 @@
 cpm: $(OBJS)
 	$(CC) $(LDFLAGS) -o cpm $(OBJS)
 
+format: format.o
+	$(CC) $(LDFLAGS) -o format format.o
+
 clean:
 	rm -f *~ loads.s makeloads *.o $(TARGETS)
 
 install: all
-	install -m 511 cpm $(BINDIR)
+	${BSD_INSTALL_PROGRAM} cpm $(BINDIR)/cpmemu
+	${BSD_INSTALL_PROGRAM} format $(BINDIR)/cpmformat
 	-mkdir $(CPMLIBDIR)
-	chmod 755 $(CPMLIBDIR)
-	install -m 444 z80-binaries/* $(CPMLIBDIR)
+	${BSD_INSTALL_DATA} z80-binaries/* $(CPMLIBDIR)