$NetBSD$

--- Makefile.orig	2005-01-20 05:46:33.000000000 +0100
+++ Makefile
@@ -26,11 +26,11 @@ VERSION = 1.3.3
 #
 
 # GCC compiler and linker flags.
-CC	= gcc
+#CC	= gcc
 DEBUG	=
 CEXTRA	=
-CFLAGS	= -O3 -D__NO_STRING_INLINES -fPIC -ansi -D_STRICT_ANSI_ -Wall -W   \
-	  -pedantic -Wshadow -Wpointer-arith -Wstrict-prototypes	   \
+CFLAGS	+= -D__NO_STRING_INLINES -fPIC -ansi -D_STRICT_ANSI_ -Wall -W   \
+	  -pedantic -Wpointer-arith -Wstrict-prototypes	   \
 	  -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls	   \
 	  $(DEBUG) $(CEXTRA)
 LDLIBS	=
@@ -47,15 +47,15 @@ LDFLAGS	= $(DEBUG) $(LDEXTRA)
 #LDFLAGS=
 
 # Glk library selection and library location.
-GLK	= xglk
+#GLK	= xglk
 #GLK	= glkterm
-#GLK	= cheapglk
+GLK	= cheapglk
 #GLK	= winglk
-GLKDIR	=..
+#GLKDIR	=..
 
 # Glk platform selection; normally, the platform's compiler will define
 # one of these automatically, but if not, pick one to suit your system.
-#GLKARCH= -D__unix
+GLKARCH= -D__unix
 #GLKARCH= -D_WIN32
 
 #
@@ -69,9 +69,9 @@ GLKDIR	=..
 # This will of course make GLKLIBS gibberish, but we'll check that later.
 # If your make can't handle sinclude or -include, and you're not building
 # for Glk, comment out the include line.
-GLKPATH	= $(GLKDIR)/$(GLK)
-sinclude $(GLKPATH)/Make.$(GLK)
-GLKLIBS	= -L$(GLKPATH) $(GLKLIB) $(LINKLIBS)
+.include "$(BUILDLINK_DIR)/include/glk/Make.glk"
+GLKLIBS	= -L$(PREFIX)/lib $(GLKLIB) $(LINKLIBS)
+GLKINCS = -I$(PREFIX)/include/glk
 
 # Always use the Bourne shell.
 SHELL	= /bin/sh
@@ -116,14 +116,12 @@ scare: $(ZOBJECTS) $(OBJECTS) os_ansi.o
 		$(LDLIBS)
 
 # Option to build the Glk port of SCARE.
-glkscare: $(ZOBJECTS) $(OBJECTS) os_glk.o
-	@$(TEST) -n "$(GLKLIB)" \
-		|| ( echo "Could not include $(GLKPATH)/Make.$(GLK)"; exit 1 )
-	$(CC) $(LDFLAGS) -o glkscare $(OBJECTS) $(ZOBJECTS) os_glk.o	\
-		$(LDLIBS) $(GLKLIBS)
+glkscare: $(OBJECTS) os_glk.o
+	$(CC) $(LDFLAGS) -o glkscare $(OBJECTS) os_glk.o	\
+		$(LDLIBS) $(GLKLIBS) -lz
 
 os_glk.o: os_glk.c $(HEADERS)
-	$(CC) $(GLKARCH) $(CFLAGS) -c -o $@ $<
+	$(CC) $(GLKARCH) $(CFLAGS) $(GLKINCS) -c -o $@ $<
 
 # Option to build an IFP plugin version of SCARE.
 scare_plugin.c: scare.hdr
