This patch changes the build logic of the package by generating a top-level
Makefile and introducing alternate variables for Makefile setup.
Index: spim/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ spim/Makefile	2010-04-09 15:11:35.000000000 +0200
@@ -0,0 +1,9 @@
+MAKE += CC="$(CC) -Wl,--as-needed" CDEBFLAGS="$(CFLAGS)" EXCEPTION_DIR=/usr/lib/spim
+build:
+	cd spim && $(MAKE) spim
+	cd xspim && xmkmf && $(MAKE) xspim
+clean:
+	cd spim && $(MAKE) very-clean
+	cd xspim && { [ ! -f Makefile ] || $(MAKE) distclean; }
+	rm -f Tests/tt.endian.s Tests/tt.s
+.PHONY: build clean
Index: spim/spim/Makefile
===================================================================
--- spim.orig/spim/Makefile	2010-01-09 06:22:57.000000000 +0100
+++ spim/spim/Makefile	2010-04-09 15:12:02.000000000 +0200
@@ -105,7 +105,7 @@
 DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_EXCEPTION_HANDLER="\"$(EXCEPTION_DIR)/exceptions.s\"" -DSPIM_VERSION="\"`cat ../VERSION`\""
 
 CC = gcc
-CFLAGS = -I. -I$(CPU_DIR) $(DEFINES) -g -Wall
+CFLAGS = -I. -I$(CPU_DIR) $(DEFINES) $(CDEBFLAGS)
 YFLAGS = -d --file-prefix=y
 YCFLAGS =
 LDFLAGS = -lm
