summaryrefslogtreecommitdiff
path: root/emulators/spim/patches/patch-ad
blob: 737766302dd606ec389e0c90c1005a7bab00b9fb (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
$NetBSD: patch-ad,v 1.2 2009/03/22 19:55:42 markd Exp $

--- spim/Makefile.orig	2006-08-29 14:23:19.000000000 +1200
+++ spim/Makefile
@@ -54,13 +54,13 @@ DOC_DIR = ../Documentation
 
 
 # Full path for the directory that will hold the executable files:
-BIN_DIR = /usr/local/bin
+BIN_DIR = $(DESTDIR)$(PREFIX)/bin
 
 # Full path for the directory that will hold the exception handler:
-EXCEPTION_DIR = /usr/local/lib
+EXCEPTION_DIR = $(PREFIX)/share/spim
 
 # Full path for the directory that will hold the man files:
-MAN_DIR = /usr/man/mann
+MAN_DIR = $(DESTDIR)$(PREFIX)/man/man1
 
 
 # If you have flex, use it instead of lex.  If you use flex, define this
@@ -92,7 +92,7 @@ ENDIAN=`cat configuration`
 
 DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_EXCEPTION_HANDLER="\"$(EXCEPTION_DIR)/exceptions.s\"" -DSPIM_VERSION="\"`cat ../VERSION`\""
 
-CC = gcc
+#CC = gcc
 CFLAGS = -I. -I$(CPU_DIR) $(DEFINES) -g -Wall
-YFLAGS = -d --file-prefix=y
+YFLAGS = -d # --file-prefix=y
 YCFLAGS =
@@ -108,6 +108,7 @@ LEXCFLAGS = -O $(CFLAGS)
 OBJS = spim-utils.o run.o mem.o inst.o data.o sym-tbl.o y.tab.o lex.yy.o \
        syscall.o display-utils.o string-stream.o
 
+all: spim
 
 spim:   force
 	make -f Makefile spim2
@@ -174,11 +175,11 @@ clean:
 	rm -f spim spim.exe *.o TAGS test.out lex.yy.c y.tab.c y.tab.h y.output
 
 install: spim
 	install -c -s  spim $(BIN_DIR)
-	install -c -m 0444 $(CPU_DIR)/exceptions.s $(EXCEPTION_DIR)
+	install -c -m 0444 $(CPU_DIR)/exceptions.s $(DESTDIR)$(EXCEPTION_DIR)
 
-install-man:
-	install -c -m 0444 $(DOC_DIR)/spim.man $(MAN_DIR)
+install.man:
+	install -c -m 0444 $(DOC_DIR)/spim.man $(MAN_DIR)/spim.1
 
 very-clean: clean
 	rm -f configuration
@@ -195,8 +196,8 @@ splint: spim

 y.tab.h: y.tab.c

 y.tab.c: $(CPU_DIR)/parser.y
-	bison $(YFLAGS) $(CPU_DIR)/parser.y
+	$(YACC) $(YFLAGS) $(CPUDIR)/parser.y

 y.tab.o: y.tab.c
	$(CC) $(CFLAGS) $(YCFLAGS) -c y.tab.c