$NetBSD: patch-aa,v 1.4 2009/09/20 10:03:58 wiz Exp $

--- makefile.orig	2009-08-31 04:45:36.000000000 +0000
+++ makefile
@@ -125,10 +125,10 @@ endif
 # BIGENDIAN = 1
 
 # uncomment next line to build expat as part of MAME build
-BUILD_EXPAT = 1
+# BUILD_EXPAT = 1
 
 # uncomment next line to build zlib as part of MAME build
-BUILD_ZLIB = 1
+# BUILD_ZLIB = 1
 
 # uncomment next line to include the symbols
 # SYMBOLS = 1
@@ -196,9 +196,9 @@ BUILD_EXE = $(EXE)
 endif
 
 # compiler, linker and utilities
-AR = @ar
-CC = @gcc
-LD = @gcc
+#AR = @ar
+#CC = @gcc
+#LD = @gcc
 MD = -mkdir$(EXE)
 RM = @rm -f
 
@@ -227,7 +227,7 @@ NAME = $(TARGET)$(SUBTARGET)
 endif
 
 # fullname is prefix+name+suffix+debugsuffix
-FULLNAME = $(PREFIX)$(NAME)$(CPPSUFFIX)$(SUFFIX)$(DEBUGSUFFIX)
+FULLNAME = $(NAME)$(CPPSUFFIX)$(SUFFIX)$(DEBUGSUFFIX)
 
 # add an EXE suffix to get the final emulator name
 EMULATOR = $(FULLNAME)$(EXE)
@@ -309,11 +309,11 @@ endif
 
 # we compile C-only to C89 standard with GNU extensions
 # we compile C++ code to C++98 standard with GNU extensions
-CONLYFLAGS += -std=gnu89
-CPPONLYFLAGS += -x c++ -std=gnu++98
+#CONLYFLAGS += -std=gnu89
+#CPPONLYFLAGS += -x c++ -std=gnu++98
 
 # this speeds it up a bit by piping between the preprocessor/compiler/assembler
-CCOMFLAGS += -pipe
+#CCOMFLAGS += -pipe
 
 # add -g if we need symbols, and ensure we have frame pointers
 ifdef SYMBOLS
@@ -331,18 +331,18 @@ CCOMFLAGS += -pg
 endif
 
 # add the optimization flag
-CCOMFLAGS += -O$(OPTIMIZE)
+#CCOMFLAGS += -O$(OPTIMIZE)
 
 # if we are optimizing, include optimization options
 # and make all errors into warnings
 ifneq ($(OPTIMIZE),0)
 ifneq ($(TARGETOS),os2)
 ifndef IA64
-CCOMFLAGS += -Werror -fno-strict-aliasing $(ARCHOPTS)
+#CCOMFLAGS += -Werror -fno-strict-aliasing $(ARCHOPTS)
 else
 endif
 else
-CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
+#CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
 endif
 endif
 
@@ -372,7 +372,7 @@ endif
 #-------------------------------------------------
 
 # add core include paths
-CCOMFLAGS += \
+CCOMFLAGS := \
 	-I$(SRC)/$(TARGET) \
 	-I$(SRC)/$(TARGET)/includes \
 	-I$(OBJ)/$(TARGET)/layout \
@@ -382,7 +382,7 @@ CCOMFLAGS += \
 	-I$(SRC)/lib/util \
 	-I$(SRC)/osd \
 	-I$(SRC)/osd/$(OSD) \
-
+	$(CFLAGS)
 
 
 #-------------------------------------------------
@@ -391,11 +391,11 @@ CCOMFLAGS += \
 
 # LDFLAGS are used generally; LDFLAGSEMULATOR are additional
 # flags only used when linking the core emulator
-LDFLAGS =
+#LDFLAGS =
 ifneq ($(TARGETOS),macosx)
 ifneq ($(TARGETOS),os2)
 ifneq ($(TARGETOS),solaris)
-LDFLAGS = -Wl,--warn-common
+#LDFLAGS = -Wl,--warn-common
 endif
 endif
 endif
@@ -410,7 +410,7 @@ endif
 ifndef SYMBOLS
 ifndef PROFILE
 ifneq ($(TARGETOS),macosx)
-LDFLAGS += -s
+#LDFLAGS += -s
 endif
 endif
 endif
@@ -561,7 +561,7 @@ $(VERSIONOBJ): $(DRVLIBS) $(LIBOSD) $(LI
 
 $(EMULATOR): $(VERSIONOBJ) $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBDASM) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(RESFILE)
 	@echo Linking $@...
-	$(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
+	$(CC) $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
 
 endif
 
