$NetBSD: patch-Makefile,v 1.3 2021/06/19 07:23:31 nia Exp $

Avoid overriding build settings.
Fix build problems with newer compilers.

--- Makefile.orig	2021-06-19 06:48:42.800581466 +0000
+++ Makefile
@@ -57,14 +57,9 @@ LIBS = 
 #-------------------------------------------------
 
 # start with empties for everything
-CCOMFLAGS = -DDISABLE_MIDI
-CONLYFLAGS =
-COBJFLAGS =
-CPPONLYFLAGS =
+CCOMFLAGS += -DDISABLE_MIDI
 # LDFLAGS are used generally; LDFLAGSEMULATOR are additional
 # flags only used when linking the core emulator
-LDFLAGS =
-LDFLAGSEMULATOR =
 
 GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
 ifneq ($(GIT_VERSION)," unknown")
@@ -145,15 +140,6 @@ ifeq ($(VRENDER),opengl)  
    LIBS += -lGL
 endif
 LDFLAGS += $(SHARED)
-   NATIVELD = g++
-   NATIVELDFLAGS = -Wl,--warn-common -lstdc++
-   NATIVECC = g++
-   NATIVECFLAGS = -std=gnu99
-   CC_AS = gcc 
-   CC = g++
-   AR = @ar
-   LD = g++ 
-   CCOMFLAGS += $(PLATCFLAGS) -ffast-math  
    LIBS += -lstdc++ -lpthread 
 
 # Android
@@ -656,7 +642,7 @@ DEFS += -DFLAC__NO_DLL
 
 # CFLAGS is defined based on C or C++ targets
 # (remember, expansion only happens when used, so doing it here is ok)
-CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS)
+CFLAGS += $(CCOMFLAGS) $(CPPONLYFLAGS)
 
 # we compile C-only to C89 standard with GNU extensions
 # we compile C++ code to C++98 standard with GNU extensions
@@ -666,7 +652,7 @@ CONLYFLAGS += -ansi
 else
 CONLYFLAGS += -std=gnu89
 endif
-CPPONLYFLAGS += -x c++ -std=gnu++98
+CPPONLYFLAGS += -x c++ -std=gnu++11 -Wno-narrowing
 COBJFLAGS += -x objective-c++
 
 # this speeds it up a bit by piping between the preprocessor/compiler/assembler
@@ -676,7 +662,6 @@ ifeq ($(MDEBUG),1)
 CCOMFLAGS +=  -O0 -g
 else
 # add the optimization flag
-CCOMFLAGS += -O$(OPTIMIZE)
 endif
 
 # add the error warning flag
