From fc973ace22e803c177b3f28daca387190a722508 Mon Sep 17 00:00:00 2001
From: Bin Meng <bmeng.cn@gmail.com>
Date: Wed, 6 Apr 2022 21:50:12 +0800
Subject: [PATCH 2/6] makefile: Switch to building shared executables for
 mingw* builds

Other platform builds generate shared executables except mingw* builds.
Switch to building shared executables for mingw* builds for consistency.

With such change, $(CXXFLAGS) is no longer needed in the build rule too.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---
 Makefile.mingw64 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile.mingw64 b/Makefile.mingw64
index 4cd1be9..615b43b 100644
--- a/Makefile.mingw64
+++ b/Makefile.mingw64
@@ -2,7 +2,7 @@ CC=/usr/bin/x86_64-w64-mingw32-gcc
 CXX=/usr/bin/x86_64-w64-mingw32-g++
 STRIP=/usr/bin/x86_64-w64-mingw32-strip
 CFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++  -D_FILE_OFFSET_BITS=64 -g
-CXXFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64
+CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64
 #CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include -I/opt/local/include -g
 LIB_NAMES=guid gptpart bsd parttypes attributes crc32 mbrpart basicmbr mbr gpt support diskio diskio-windows
 MBR_LIBS=support diskio diskio-windows basicmbr mbrpart
@@ -15,13 +15,13 @@ DEPEND= makedepend $(CFLAGS)
 all:	gdisk fixparts
 
 gdisk:	$(LIB_OBJS) gdisk.o gpttext.o
-	$(CXX) $(CXXFLAGS) $(LIB_OBJS) gdisk.o gpttext.o -lrpcrt4 -static-libgcc -o gdisk64.exe
+	$(CXX) $(LIB_OBJS) gdisk.o gpttext.o -lrpcrt4 -o gdisk64.exe
 
 sgdisk: $(LIB_OBJS) sgdisk.o
-	$(CXX) $(CXXFLAGS) $(LIB_OBJS) sgdisk.o -lpopt -static-libgcc -o sgdisk64.exe
+	$(CXX) $(LIB_OBJS) sgdisk.o -lpopt -o sgdisk64.exe
 
 fixparts: $(MBR_LIB_OBJS) fixparts.o
-	$(CXX) $(CXXFLAGS) $(MBR_LIB_OBJS) fixparts.o $(LDFLAGS) -static-libgcc -o fixparts64.exe
+	$(CXX) $(MBR_LIB_OBJS) fixparts.o $(LDFLAGS) -o fixparts64.exe
 
 lint:	#no pre-reqs
 	lint $(SRCS)
-- 
2.35.1

