application/bc.mak
changeset 40 d766d4c854a2
parent 37 f417fe8685c5
child 43 c98aa29401f7
--- a/application/bc.mak	Sun Mar 08 15:50:52 2015 +0000
+++ b/application/bc.mak	Thu Jun 01 12:23:04 2017 +0100
@@ -12,6 +12,19 @@
 #  this has changed; it is now also possible to build using microsoft visual c
 #    (called via vcmake, by "make.exe -f bc.mak -DUSEVC")
 #
+# Rules found here:
+#   bmake 
+#       - build everything, incl. a self installing exe for deployment
+#   bmake exe
+#       - only build the executable; to be executed and tested here
+#   bmake setup
+#       - make the self installing exe (assuming that the exe is already present)
+#   bmake clean
+#       - remove everything that is not needed to execute
+#   bmake clobber
+#       - remove everything that cannot be reconstructed by bmake
+#
+# For a 64bit build, replace bmake by mingwmake.
 
 TOP=..\..\..\stx       
 INCLUDE_TOP=$(TOP)\..
@@ -42,7 +55,7 @@
 
 #
 APPNAME=libjv_vdb_application
-LIBNAME=dummy
+LIBNAME=libjv_vdb_application
 MODULE_PATH=vdb\application
 STCOPT="+optinline"
 LOCALINCLUDES= -I$(INCLUDE_TOP)\jv\libgdbs -I$(INCLUDE_TOP)\jv\vdb -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2
@@ -59,7 +72,7 @@
 !ifdef USETCC
 RESFILES=
 !else
-RESFILES= applicationWinRC.$(RES)
+RESFILES= jv_vdb_applicationWINrc.$(RES)
 !endif
 
 ALLOBJ= $(ALLOBJFILES) $(OBJS)
@@ -68,14 +81,18 @@
 LIBFILES=$(LIBDIR_LIBRUN)\librun.lib
 ALLLIB=$(LIBFILES) $(APP_IMPORTLIBS) $(APP_RT_LIB)
 
+!if defined(USEMINGW32)
+RT_DLL=libgcc_s_dw2-1.dll
+!endif
+
 REQUIRED_LIBS=librun.dll  \
  libstx_libbasic.dll \
  libstx_goodies_announcements.dll \
- libstx_goodies_refactoryBrowser_parser.dll \
  libstx_libbasic2.dll \
  libstx_libcomp.dll \
+ libstx_goodies_refactoryBrowser_parser.dll \
+ libstx_libbasic3.dll \
  libstx_libview.dll \
- libstx_libbasic3.dll \
  libstx_libui.dll \
  libstx_libview2.dll \
  libstx_goodies_sunit.dll \
@@ -84,7 +101,6 @@
  libstx_libhtml.dll \
  libstx_libwidg2.dll \
  libjv_libgdbs.dll \
- libstx_libwidg3.dll \
  libstx_libtool.dll \
  libstx_libtool2.dll \
  libjv_vdb.dll \
@@ -92,6 +108,9 @@
 
 REQUIRED_FILES=$(RT_DLL) $(X11_DLL) $(XEXT_DLL) symbols.stc $(REQUIRED_LIBS)
 
+SUBPROJECT_LIBS=
+
+
 REQUIRED_SUPPORT_DIRS=RESOURCEFILES
 
 target: ALL postBuildCleanup 
@@ -100,7 +119,7 @@
 ALL:: prereq ALL_NP
 
 # all, but no prereqs
-ALL_NP:: exe $(REQUIRED_SUPPORT_DIRS) postBuildCleanup setup
+ALL_NP:: exe $(REQUIRED_SUPPORT_DIRS) postBuildCleanup subProjects
 
 exe:  newBuildDate $(REQUIRED_LIBS) noConsoleApp consoleApp registerApplication
 
@@ -130,15 +149,35 @@
 
 # build all mandatory prerequisite packages (containing superclasses) for this package
 prereq:
-	$(MAKE) -N -f bc.mak $(USE_ARG) FORCE=FORCE_BUILD $(REQUIRED_LIBS)
+	$(MAKE) -N -f bc.mak $(USE_ARG) FORCE=FORCE_BUILD makePrereq
+
+makePrereq: $(REQUIRED_LIBS)
+
+subProjects:
+	$(MAKE) -N -f bc.mak $(USE_ARG) FORCE=FORCE_BUILD makeSubProjects
+
+makeSubProjects: $(SUBPROJECT_LIBS)
+	@echo "sub-projects made"
 
 FORCE_BUILD:
 	@rem Dummy target to force a build
 
 # a nullsoft installable delivery
 # This uses the Nullsoft Installer Package and works in Windows only
+
+!if defined(USEMINGW64)
+
+setup: $(PROJECT) postBuildCleanup application.nsi 
+	$(MAKENSIS) /DOBJ_DIR=objmingw /DSETUP_NAME=Visual_DebuggerSetup64 application.nsi
+        
+
+!else
+
 setup: $(PROJECT) postBuildCleanup application.nsi
-	$(MAKENSIS) application.nsi
+	$(MAKENSIS) /DOBJ_DIR=objbc /DSETUP_NAME=Visual_DebuggerSetup application.nsi
+        
+
+!endif
 
 newBuildDate:
 	del buildDate.h
@@ -184,6 +223,7 @@
 	libtool_RESOURCES  \
 	libtool2_RESOURCES
 
+
 keyboard.rc: $(TOP)\projects\smalltalk\keyboard.rc
 	copy $(TOP)\projects\smalltalk\keyboard.rc *.*
 
@@ -213,7 +253,7 @@
 	-copy $(TOP)\libwidg\bitmaps\*.xpm resources\stx\libwidg\bitmaps\*.*
 
 libbasic_RESOURCES: resources\stx\libbasic\NUL
-	copy $(TOP)\libbasic\resources\*.rs resources\stx\libbasic\*.*
+	-copy $(TOP)\libbasic\resources\*.rs resources\stx\libbasic\*.*
 
 libtool_RESOURCES: resources\stx\libtool\NUL
 	-copy $(TOP)\libtool\resources\*.rs resources\stx\libtool\*.*
@@ -272,115 +312,109 @@
 	copy ..\..\..\stx\libbasic\$(OBJDIR)\libstx_libbasic.dll *.*
 
 ..\..\..\stx\libbasic\$(OBJDIR)\libstx_libbasic.dll: $(FORCE)
-	pushd ..\..\..\stx\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_goodies_announcements.dll: ..\..\..\stx\goodies\announcements\$(OBJDIR)\libstx_goodies_announcements.dll
 	copy ..\..\..\stx\goodies\announcements\$(OBJDIR)\libstx_goodies_announcements.dll *.*
 
 ..\..\..\stx\goodies\announcements\$(OBJDIR)\libstx_goodies_announcements.dll: $(FORCE)
-	pushd ..\..\..\stx\goodies\announcements & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
-
-libstx_goodies_refactoryBrowser_parser.dll: ..\..\..\stx\goodies\refactoryBrowser\parser\$(OBJDIR)\libstx_goodies_refactoryBrowser_parser.dll
-	copy ..\..\..\stx\goodies\refactoryBrowser\parser\$(OBJDIR)\libstx_goodies_refactoryBrowser_parser.dll *.*
-
-..\..\..\stx\goodies\refactoryBrowser\parser\$(OBJDIR)\libstx_goodies_refactoryBrowser_parser.dll: $(FORCE)
-	pushd ..\..\..\stx\goodies\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\goodies\announcements & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libbasic2.dll: ..\..\..\stx\libbasic2\$(OBJDIR)\libstx_libbasic2.dll
 	copy ..\..\..\stx\libbasic2\$(OBJDIR)\libstx_libbasic2.dll *.*
 
 ..\..\..\stx\libbasic2\$(OBJDIR)\libstx_libbasic2.dll: $(FORCE)
-	pushd ..\..\..\stx\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libcomp.dll: ..\..\..\stx\libcomp\$(OBJDIR)\libstx_libcomp.dll
 	copy ..\..\..\stx\libcomp\$(OBJDIR)\libstx_libcomp.dll *.*
 
 ..\..\..\stx\libcomp\$(OBJDIR)\libstx_libcomp.dll: $(FORCE)
-	pushd ..\..\..\stx\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
-libstx_libview.dll: ..\..\..\stx\libview\$(OBJDIR)\libstx_libview.dll
-	copy ..\..\..\stx\libview\$(OBJDIR)\libstx_libview.dll *.*
+libstx_goodies_refactoryBrowser_parser.dll: ..\..\..\stx\goodies\refactoryBrowser\parser\$(OBJDIR)\libstx_goodies_refactoryBrowser_parser.dll
+	copy ..\..\..\stx\goodies\refactoryBrowser\parser\$(OBJDIR)\libstx_goodies_refactoryBrowser_parser.dll *.*
 
-..\..\..\stx\libview\$(OBJDIR)\libstx_libview.dll: $(FORCE)
-	pushd ..\..\..\stx\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+..\..\..\stx\goodies\refactoryBrowser\parser\$(OBJDIR)\libstx_goodies_refactoryBrowser_parser.dll: $(FORCE)
+	pushd ..\..\..\stx\goodies\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libbasic3.dll: ..\..\..\stx\libbasic3\$(OBJDIR)\libstx_libbasic3.dll
 	copy ..\..\..\stx\libbasic3\$(OBJDIR)\libstx_libbasic3.dll *.*
 
 ..\..\..\stx\libbasic3\$(OBJDIR)\libstx_libbasic3.dll: $(FORCE)
-	pushd ..\..\..\stx\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+
+libstx_libview.dll: ..\..\..\stx\libview\$(OBJDIR)\libstx_libview.dll
+	copy ..\..\..\stx\libview\$(OBJDIR)\libstx_libview.dll *.*
+
+..\..\..\stx\libview\$(OBJDIR)\libstx_libview.dll: $(FORCE)
+	pushd ..\..\..\stx\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libui.dll: ..\..\..\stx\libui\$(OBJDIR)\libstx_libui.dll
 	copy ..\..\..\stx\libui\$(OBJDIR)\libstx_libui.dll *.*
 
 ..\..\..\stx\libui\$(OBJDIR)\libstx_libui.dll: $(FORCE)
-	pushd ..\..\..\stx\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libview2.dll: ..\..\..\stx\libview2\$(OBJDIR)\libstx_libview2.dll
 	copy ..\..\..\stx\libview2\$(OBJDIR)\libstx_libview2.dll *.*
 
 ..\..\..\stx\libview2\$(OBJDIR)\libstx_libview2.dll: $(FORCE)
-	pushd ..\..\..\stx\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_goodies_sunit.dll: ..\..\..\stx\goodies\sunit\$(OBJDIR)\libstx_goodies_sunit.dll
 	copy ..\..\..\stx\goodies\sunit\$(OBJDIR)\libstx_goodies_sunit.dll *.*
 
 ..\..\..\stx\goodies\sunit\$(OBJDIR)\libstx_goodies_sunit.dll: $(FORCE)
-	pushd ..\..\..\stx\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libwidg.dll: ..\..\..\stx\libwidg\$(OBJDIR)\libstx_libwidg.dll
 	copy ..\..\..\stx\libwidg\$(OBJDIR)\libstx_libwidg.dll *.*
 
 ..\..\..\stx\libwidg\$(OBJDIR)\libstx_libwidg.dll: $(FORCE)
-	pushd ..\..\..\stx\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_goodies_magritte.dll: ..\..\..\stx\goodies\magritte\$(OBJDIR)\libstx_goodies_magritte.dll
 	copy ..\..\..\stx\goodies\magritte\$(OBJDIR)\libstx_goodies_magritte.dll *.*
 
 ..\..\..\stx\goodies\magritte\$(OBJDIR)\libstx_goodies_magritte.dll: $(FORCE)
-	pushd ..\..\..\stx\goodies\magritte & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\goodies\magritte & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libhtml.dll: ..\..\..\stx\libhtml\$(OBJDIR)\libstx_libhtml.dll
 	copy ..\..\..\stx\libhtml\$(OBJDIR)\libstx_libhtml.dll *.*
 
 ..\..\..\stx\libhtml\$(OBJDIR)\libstx_libhtml.dll: $(FORCE)
-	pushd ..\..\..\stx\libhtml & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libhtml & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libwidg2.dll: ..\..\..\stx\libwidg2\$(OBJDIR)\libstx_libwidg2.dll
 	copy ..\..\..\stx\libwidg2\$(OBJDIR)\libstx_libwidg2.dll *.*
 
 ..\..\..\stx\libwidg2\$(OBJDIR)\libstx_libwidg2.dll: $(FORCE)
-	pushd ..\..\..\stx\libwidg2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libwidg2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libjv_libgdbs.dll: ..\..\libgdbs\$(OBJDIR)\libjv_libgdbs.dll
 	copy ..\..\libgdbs\$(OBJDIR)\libjv_libgdbs.dll *.*
 
 ..\..\libgdbs\$(OBJDIR)\libjv_libgdbs.dll: $(FORCE)
-	pushd ..\..\libgdbs & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
-
-libstx_libwidg3.dll: ..\..\..\stx\libwidg3\$(OBJDIR)\libstx_libwidg3.dll
-	copy ..\..\..\stx\libwidg3\$(OBJDIR)\libstx_libwidg3.dll *.*
-
-..\..\..\stx\libwidg3\$(OBJDIR)\libstx_libwidg3.dll: $(FORCE)
-	pushd ..\..\..\stx\libwidg3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\libgdbs & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libtool.dll: ..\..\..\stx\libtool\$(OBJDIR)\libstx_libtool.dll
 	copy ..\..\..\stx\libtool\$(OBJDIR)\libstx_libtool.dll *.*
 
 ..\..\..\stx\libtool\$(OBJDIR)\libstx_libtool.dll: $(FORCE)
-	pushd ..\..\..\stx\libtool & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libtool & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libstx_libtool2.dll: ..\..\..\stx\libtool2\$(OBJDIR)\libstx_libtool2.dll
 	copy ..\..\..\stx\libtool2\$(OBJDIR)\libstx_libtool2.dll *.*
 
 ..\..\..\stx\libtool2\$(OBJDIR)\libstx_libtool2.dll: $(FORCE)
-	pushd ..\..\..\stx\libtool2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd ..\..\..\stx\libtool2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 libjv_vdb.dll: ..\$(OBJDIR)\libjv_vdb.dll
 	copy ..\$(OBJDIR)\libjv_vdb.dll *.*
 
 ..\$(OBJDIR)\libjv_vdb.dll: $(FORCE)
-	pushd .. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	pushd .. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
       
 
@@ -474,6 +508,7 @@
 librun.dll: $(TOP)\librun\$(OBJDIR_LIBRUN)\librun.dll
 	copy $(TOP)\librun\$(OBJDIR_LIBRUN)\librun.dll librun.dll
 
+!ifdef USEBC 
 #cs3245.dll
 $(RT_DLL): $(TOP)\support\win32\borland\$(RT_DLL)
 	copy $(TOP)\support\win32\borland\$(RT_DLL) $(RT_DLL)
@@ -483,6 +518,13 @@
 
 Xext.dll: $(TOP)\support\win32\Xext.dll
 	copy $(TOP)\support\win32\Xext.dll Xext.dll
+!endif
+
+!if defined(USEMINGW32)
+$(RT_DLL): $(MINGW_DIR)\bin\$(RT_DLL)
+	-copy $(MINGW_DIR)\bin\$(RT_DLL) $(RT_DLL)
+	-copy $(MINGW_DIR)\bin\libwinpthread-1.dll libwinpthread-1.dll
+!endif
 
 symbols.stc: $(TOP)\include\symbols.stc
 	copy $(TOP)\include\symbols.stc symbols.stc
@@ -515,8 +557,8 @@
 	@rem  stupid win-make does not allow empty
 
 # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
-$(OUTDIR)VDBStartup.$(O) VDBStartup.$(H): VDBStartup.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\StandaloneStartup.$(H) $(STCHDR)
-$(OUTDIR)jv_vdb_application.$(O) jv_vdb_application.$(H): jv_vdb_application.st $(INCLUDE_TOP)\stx\libbasic\ApplicationDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
+$(OUTDIR)VDBStartup.$(O) VDBStartup.$(C) VDBStartup.$(H): VDBStartup.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\StandaloneStartup.$(H) $(STCHDR)
+$(OUTDIR)jv_vdb_application.$(O) jv_vdb_application.$(C) jv_vdb_application.$(H): jv_vdb_application.st $(INCLUDE_TOP)\stx\libbasic\ApplicationDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line