$OpenBSD: patch-Makefile_target,v 1.9 2006/06/08 14:33:38 todd Exp $
--- Makefile.target.orig	Wed May  3 15:32:58 2006
+++ Makefile.target	Thu May 11 20:49:55 2006
@@ -17,8 +17,9 @@ ifdef CONFIG_USER_ONLY
 VPATH+=:$(SRC_PATH)/linux-user
 DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
 endif
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing
+#CFLAGS=-Wall -O2 -g -fno-strict-aliasing
 #CFLAGS+=-Werror
+CFLAGS+= -ggdb
 LDFLAGS=-g
 LIBS=
 HELPER_CFLAGS=$(CFLAGS)
@@ -132,7 +133,7 @@ LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64
 endif
 
 ifeq ($(ARCH),arm)
-OP_CFLAGS=$(CFLAGS) -mno-sched-prolog -fno-omit-frame-pointer
+OP_CFLAGS=$(CFLAGS) -mno-sched-prolog -fno-omit-frame-pointer -mapcs-frame
 LDFLAGS+=-Wl,-T,$(SRC_PATH)/arm.ld
 endif
 
@@ -141,6 +142,12 @@ OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer
 LDFLAGS+=-Wl,-T,m68k.ld
 endif
 
+# Very important for this 'ifeq' block to be after other
+# OP_CFLAGS= .. constructs above
+ifeq ($(shell uname -s),OpenBSD)
+OP_CFLAGS+= -fno-stack-protector
+endif
+
 ifeq ($(HAVE_GCC3_OPTIONS),yes)
 # very important to generate a return at the end of every operation
 OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
@@ -154,6 +161,7 @@ endif
 #########################################################
 
 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+DEFINES+= #-DDEBUG_GDB -DDEBUG -DDEBUG_KBD -DDEBUG_MOUSE
 LIBS+=-lm
 ifndef CONFIG_USER_ONLY
 LIBS+=-lz
@@ -280,6 +288,9 @@ endif
 
 SOUND_HW = sb16.o es1370.o
 AUDIODRV = audio.o noaudio.o wavaudio.o
+ifdef CONFIG_OSS_LIBRARY
+LIBS += -lossaudio
+endif
 ifdef CONFIG_SDL
 AUDIODRV += sdlaudio.o
 endif
@@ -316,7 +327,7 @@ ifeq ($(TARGET_BASE_ARCH), i386)
 # Hardware support
 VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
-VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o
+VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o pcnet.o
 DEFINES += -DHAS_AUDIO
 endif
 ifeq ($(TARGET_BASE_ARCH), ppc)
@@ -492,7 +503,7 @@ clean:
 
 install: all 
 ifneq ($(PROGS),)
-	$(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
+	$(INSTALL) -m 755 -s $(PROGS) "${PREFIX}/bin/"
 endif
 
 ifneq ($(wildcard .depend),)
