diff makefile.vc @ 2864:939fbceec13f

Win: Add support for building the C++ dwtestoo with Visual C. Need to use dwmain() macro instead of standard main() entrypoint for Windows. Had to move the _dw_convertargs() definition outside of the dwmain() macro. The macro can be called from C++ code changing the function definition.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 17 Dec 2022 01:50:26 +0000
parents 1660b4ecb92f
children e62fc9b3b09c
line wrap: on
line diff
--- a/makefile.vc	Fri Dec 16 13:33:29 2022 +0000
+++ b/makefile.vc	Sat Dec 17 01:50:26 2022 +0000
@@ -125,7 +125,7 @@
 
 OBJS2 = dwcompat.obj dirent.obj
 
-all: dw dwcompat dwtest
+all: dw dwcompat dwtest dwtestoo
 
 clean:
 	-erase *.dll
@@ -205,7 +205,7 @@
 dwcompat.obj: $(SRCDIR)\dwcompat.c
 	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\dwcompat.c
 
-dwtest.obj: $(SRCDIR)\dwtest.c
+dwtest.obj: $(SRCDIR)\dwtest.c $(SRCDIR)\dw.h
 	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\dwtest.c
 
 dwtest: dwtest.exe
@@ -215,6 +215,16 @@
 	mt.exe /manifest dwtest.exe.manifest $(SRCDIR)\win\dwtest.exe.$(TARGET_CPU).manifest /outputresource:dwtest.exe;1
 	-erase dwtest.exe.manifest
 
+dwtestoo.obj: $(SRCDIR)\dwtestoo.cpp $(SRCDIR)\dw.h
+	$(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\dwtestoo.cpp
+
+dwtestoo: dwtestoo.exe
+
+dwtestoo.exe: dwtestoo.obj
+	$(LINK) $(LINKFLAGS) /out:dwtestoo.exe dwtestoo.obj /subsystem:windows $(DWLIBDIR)\dwcompat.lib $(DWLIBDIR)\dw.lib $(LIBS)
+	mt.exe /manifest dwtestoo.exe.manifest $(SRCDIR)\win\dwtest.exe.$(TARGET_CPU).manifest /outputresource:dwtestoo.exe;1
+	-erase dwtestoo.exe.manifest
+
 zip: dw.dll
 	copy win\readme-win.txt .
 	zip dwindows-win-$(VERDOT).zip readme-win.txt readme.txt x64\dw.dll x64\dwcompat.dll x64\dw.lib x64\dwcompat.lib x86\dw.dll x86\dwcompat.dll x86\dw.lib x86\dwcompat.lib dw.h dwcompat.h