Commit 5a5d8eb4 authored by Chun-wei Fan's avatar Chun-wei Fan

Visual Studio builds: Refine things a bit

Use separate output directories for different Visual Studio versions,
and ensure that we do indeed wipe out the vcxxx.pdb files and the object
directories upon clean.  Make the compiler generate vcxxx.pdb files
under the respective intermediate object directories as far as possible.

Also avoid polluting the source tree during the build by copying
config.h.win32 to libgjs' intermediate directory and also create
generate the filelist for introspection in libgjs' intermediate
directory.
parent e3492ffd
......@@ -13,63 +13,63 @@
# $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<<
# $<
# <<
{..\modules\}.cpp{$(CFG)\$(PLAT)\module-console\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\module-console\ /c @<<
{..\modules\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\module-console\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\module-console\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\module-console\ /c @<<
$<
<<
{..\modules\}.cpp{$(CFG)\$(PLAT)\module-system\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\module-system\ /c @<<
{..\modules\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\module-system\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\module-system\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\module-system\ /c @<<
$<
<<
{..\modules\}.cpp{$(CFG)\$(PLAT)\module-cairo\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\module-cairo\ /c @<<
{..\modules\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\module-cairo\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\module-cairo\ /c @<<
$<
<<
{..\gi\}.cpp{$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\libgjs\ /c @<<
{..\gi\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /c @<<
$<
<<
{..\gjs\}.cpp{$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\libgjs\ /c @<<
{..\gjs\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /c @<<
$<
<<
{..\libgjs-private\}.cpp{$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\libgjs\ /c @<<
{..\libgjs-private\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /c @<<
$<
<<
{..\libgjs-private\}.c{$(CFG)\$(PLAT)\libgjs\}.obj::
$(CC) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\libgjs\ /c @<<
{..\libgjs-private\}.c{vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\}.obj::
$(CC) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /c @<<
$<
<<
{..\modules\}.cpp{$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\libgjs\ /c @<<
{..\modules\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /c @<<
$<
<<
{..\util\}.cpp{$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\libgjs\ /c @<<
{..\util\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\}.obj::
$(CXX) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /c @<<
$<
<<
{$(CFG)\$(PLAT)\module-resources\}.c{$(CFG)\$(PLAT)\libgjs\}.obj::
$(CC) $(CFLAGS) $(LIBGJS_CFLAGS) /Fo$(CFG)\$(PLAT)\libgjs\ /c @<<
{vs$(VSVER)\$(CFG)\$(PLAT)\module-resources\}.c{vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\}.obj::
$(CC) $(CFLAGS) $(LIBGJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\libgjs\ /c @<<
$<
<<
{..\gjs\}.cpp{$(CFG)\$(PLAT)\gjs-console\}.obj::
$(CXX) $(CFLAGS) $(GJS_CFLAGS) /Fo$(CFG)\$(PLAT)\gjs-console\ /c @<<
{..\gjs\}.cpp{vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console\}.obj::
$(CXX) $(CFLAGS) $(GJS_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\gjs-console\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\gjs-console\ /c @<<
$<
<<
# Rules for building .lib files
$(CFG)\$(PLAT)\gjs.lib: $(LIBGJS_DLL_FILENAME).dll
vs$(VSVER)\$(CFG)\$(PLAT)\gjs.lib: $(LIBGJS_DLL_FILENAME).dll
# Rules for linking DLLs
# Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
......@@ -80,28 +80,28 @@ $(CFG)\$(PLAT)\gjs.lib: $(LIBGJS_DLL_FILENAME).dll
# @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
$(LIBGJS_DLL_FILENAME).dll: \
$(GJS_INCLUDED_MODULES) \
$(CFG)\$(PLAT)\module-resources \
$(CFG)\$(PLAT)\libgjs \
vs$(VSVER)\$(CFG)\$(PLAT)\module-resources \
vs$(VSVER)\$(CFG)\$(PLAT)\libgjs \
$(module_resources_generated_srcs) \
$(libgjs_dll_OBJS)
link /DLL $(LDFLAGS) $(GJS_INCLUDED_MODULES) \
$(LIBGJS_DEP_LIBS) /implib:$(CFG)\$(PLAT)\gjs.lib \
$(LIBGJS_DEP_LIBS) /implib:vs$(VSVER)\$(CFG)\$(PLAT)\gjs.lib \
-out:$@ @<<
$(libgjs_dll_OBJS)
<<
@-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
$(CFG)\$(PLAT)\module-console.lib: ..\config.h $(CFG)\$(PLAT)\module-console $(module_console_OBJS)
vs$(VSVER)\$(CFG)\$(PLAT)\module-console.lib: vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\config.h vs$(VSVER)\$(CFG)\$(PLAT)\module-console $(module_console_OBJS)
lib $(ARFLAGS) -out:$@ @<<
$(module_console_OBJS)
<<
$(CFG)\$(PLAT)\module-system.lib: ..\config.h $(CFG)\$(PLAT)\module-system $(module_system_OBJS)
vs$(VSVER)\$(CFG)\$(PLAT)\module-system.lib: vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\config.h vs$(VSVER)\$(CFG)\$(PLAT)\module-system $(module_system_OBJS)
lib $(ARFLAGS) -out:$@ @<<
$(module_system_OBJS)
<<
$(CFG)\$(PLAT)\module-cairo.lib: ..\config.h $(CFG)\$(PLAT)\module-cairo $(module_cairo_OBJS)
vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo.lib: vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\config.h vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo $(module_cairo_OBJS)
lib $(ARFLAGS) -out:$@ @<<
$(module_cairo_OBJS)
<<
......@@ -114,27 +114,36 @@ $(module_cairo_OBJS)
# <<
# @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
$(CFG)\$(PLAT)\gjs-console.exe: $(CFG)\$(PLAT)\gjs.lib $(CFG)\$(PLAT)\gjs-console $(gjs_OBJS)
link $(LDFLAGS) $(CFG)\$(PLAT)\gjs.lib $(GJS_BASE_LIBS) -out:$@ $(gjs_OBJS)
vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console.exe: vs$(VSVER)\$(CFG)\$(PLAT)\gjs.lib vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console $(gjs_OBJS)
link $(LDFLAGS) vs$(VSVER)\$(CFG)\$(PLAT)\gjs.lib $(GJS_BASE_LIBS) -out:$@ $(gjs_OBJS)
@-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
clean:
@-if exist $(CFG)\$(PLAT)\GjsPrivate-1.0.typelib del /f /q $(CFG)\$(PLAT)\GjsPrivate-1.0.typelib
@-if exist $(CFG)\$(PLAT)\GjsPrivate-1.0.gir del /f /q $(CFG)\$(PLAT)\GjsPrivate-1.0.gir
@-if exist $(CFG)\$(PLAT)\gjs_private_list del /f /q $(CFG)\$(PLAT)\gjs_private_list
@-del /f /q $(CFG)\$(PLAT)\*.pdb
@-if exist $(CFG)\$(PLAT)\gjs-console.exe.manifest del /f /q $(CFG)\$(PLAT)\gjs-console.exe.manifest
@-if exist $(CFG)\$(PLAT)\gjs-console.exe del /f /q $(CFG)\$(PLAT)\gjs-console.exe
@-del /f /q $(CFG)\$(PLAT)\*.dll.manifest
@-del /f /q $(CFG)\$(PLAT)\*.dll
@-del /f /q $(CFG)\$(PLAT)\*.ilk
@-del /f /q $(CFG)\$(PLAT)\*.exp
@-del /f /q $(CFG)\$(PLAT)\*.lib
@-if exist $(CFG)\$(PLAT)\module-cairo.lib del /f /q $(CFG)\$(PLAT)\module-cairo\*.obj
@-del /f /q $(CFG)\$(PLAT)\module-system\*.obj
@-del /f /q $(CFG)\$(PLAT)\module-console\*.obj
@-del /f /q $(CFG)\$(PLAT)\libgjs\*.obj
@-del /f /q $(CFG)\$(PLAT)\gjs-console\*.obj
@-if exist vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.typelib del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.typelib
@-if exist vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.gir del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.gir
@-if exist vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\gjs_private_list del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\gjs_private_list
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.dll
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.pdb
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.ilk
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exp
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.lib
@-if exist vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo\ del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo\vc$(PDBVER)0.pdb
@-if exist vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo\ del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo\*.obj
@-if exist vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo\ rd vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console\vc$(PDBVER)0.pdb
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console\*.obj
@-rd vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\vc$(PDBVER)0.pdb
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\*.obj
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\module-system\vc$(PDBVER)0.pdb
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\module-system\*.obj
@-rd vs$(VSVER)\$(CFG)\$(PLAT)\module-system
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\module-console\vc$(PDBVER)0.pdb
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\module-console\*.obj
@-rd vs$(VSVER)\$(CFG)\$(PLAT)\module-console
@-del /f /q $(module_resources_generated_srcs)
@-del vc$(VSVER)0.pdb
@-del ..\config.h
@-rd vs$(VSVER)\$(CFG)\$(PLAT)\module-resources
@-del vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\config.h
@-rd vs$(VSVER)\$(CFG)\$(PLAT)\libgjs
@-del /f /q vc$(PDBVER)0.pdb
......@@ -46,22 +46,24 @@ GTK_LIBS = gtk-3.0.lib gdk-3.0.lib
# so that we don't have to worry about the Visual Studio linker dropping items during
# optimization
GJS_DEFINES =
GJS_INCLUDED_MODULES = \
$(CFG)\$(PLAT)\module-console.lib \
$(CFG)\$(PLAT)\module-system.lib
GJS_INCLUDED_MODULES = \
vs$(VSVER)\$(CFG)\$(PLAT)\module-console.lib \
vs$(VSVER)\$(CFG)\$(PLAT)\module-system.lib
GJS_BASE_CFLAGS = \
/I.. \
/Ivs$(VSVER)\$(CFG)\$(PLAT)\libgjs \
/FImsvc_recommended_pragmas.h \
/FIjs\RequiredDefines.h \
/Dssize_t=gssize \
/DG_LOG_DOMAIN=\"Gjs\" \
/wd4530 \
/wd4099 \
/wd4251 \
/wd4800 \
/Zc:externConstexpr
GJS_CFLAGS_WITH_LOG = /DG_LOG_DOMAIN=\"Gjs\"
LIBGJS_DEP_INCLUDES = $(BASE_INCLUDES)
LIBGJS_DEP_LIBS = $(LIBGJS_BASE_DEP_LIBS)
......@@ -69,9 +71,9 @@ LIBGJS_PRIVATE_SOURCES = $(gjs_private_srcs)
LIBGJS_HEADERS = $(gjs_public_headers:/=\)
# We build libgjs and gjs-console at least
GJS_LIBS = $(CFG)\$(PLAT)\gjs.lib
GJS_LIBS = vs$(VSVER)\$(CFG)\$(PLAT)\gjs.lib
GJS_UTILS = $(CFG)\$(PLAT)\gjs-console.exe
GJS_UTILS = vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console.exe
GJS_TESTS =
# Enable Cairo
......@@ -79,7 +81,7 @@ GJS_TESTS =
GJS_DEFINES = $(GJS_DEFINES) /DENABLE_CAIRO
GJS_INCLUDED_MODULES = \
$(GJS_INCLUDED_MODULES) \
$(CFG)\$(PLAT)\module-cairo.lib
vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo.lib
LIBGJS_DEP_LIBS = $(CAIRO_LIBS) $(LIBGJS_DEP_LIBS)
!endif
......@@ -102,9 +104,9 @@ LIBGJS_SOURCES = $(gjs_srcs) $(LIBGJS_PRIVATE_SOURCES)
# Use libtool-style DLL names, if desired
!if "$(LIBTOOL_DLL_NAME)" == "1"
LIBGJS_DLL_FILENAME = $(CFG)\$(PLAT)\libgjs-0
LIBGJS_DLL_FILENAME = vs$(VSVER)\$(CFG)\$(PLAT)\libgjs-0
!else
LIBGJS_DLL_FILENAME = $(CFG)\$(PLAT)\gjs-vs$(VSVER)
LIBGJS_DLL_FILENAME = vs$(VSVER)\$(CFG)\$(PLAT)\gjs-vs$(VSVER)
!endif
TEST_PROGRAMS =
......@@ -112,13 +114,13 @@ TEST_PROGRAMS =
# Enable Introspection
!if "$(INTROSPECTION)" == "1"
CHECK_PACKAGE = $(GJS_INTROSPECTION_CHECK_PACKAGE)
EXTRA_TARGETS = $(CFG)\$(PLAT)\GjsPrivate-1.0.gir $(CFG)\$(PLAT)\GjsPrivate-1.0.typelib
EXTRA_TARGETS = vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.gir vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.typelib
!else
EXTRA_TARGETS =
!endif
# Put together the CFLAGS
LIBGJS_CFLAGS = \
LIBGJS_CFLAGS_BASE = \
$(GJS_DEFINES) \
$(MOZ_BUG_WORKAROUND_CFLAG) \
/DGJS_COMPILATION \
......@@ -127,8 +129,11 @@ LIBGJS_CFLAGS = \
$(GJS_BASE_CFLAGS) \
$(LIBGJS_DEP_INCLUDES)
LIBGJS_CFLAGS = $(LIBGJS_CFLAGS_BASE) $(GJS_CFLAGS_WITH_LOG)
GJS_CFLAGS = \
$(GJS_DEFINES) \
$(MOZ_BUG_WORKAROUND_CFLAG) \
$(GJS_BASE_CFLAGS) \
$(GJS_CFLAGS_WITH_LOG) \
$(BASE_INCLUDES)
......@@ -38,13 +38,13 @@ NULL=
!if [call create-lists.bat header gjs_objs.mak libgjs_dll_OBJS]
!endif
!if [for %c in ($(LIBGJS_SOURCES)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_objs.mak ^$(CFG)\^$(PLAT)\libgjs\%~nc.obj]
!if [for %c in ($(LIBGJS_SOURCES)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_objs.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\libgjs\%~nc.obj]
!endif
!if [for %c in ($(LIBGJS_SOURCES)) do @if "%~xc" == ".c" @call create-lists.bat file gjs_objs.mak ^$(CFG)\^$(PLAT)\libgjs\%~nc.obj]
!if [for %c in ($(LIBGJS_SOURCES)) do @if "%~xc" == ".c" @call create-lists.bat file gjs_objs.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\libgjs\%~nc.obj]
!endif
!if [for %c in ($(module_resource_srcs)) do @if "%~xc" == ".c" @call create-lists.bat file gjs_objs.mak ^$(CFG)\^$(PLAT)\libgjs\%~nc.obj]
!if [for %c in ($(module_resource_srcs)) do @if "%~xc" == ".c" @call create-lists.bat file gjs_objs.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\libgjs\%~nc.obj]
!endif
!if [call create-lists.bat footer gjs_objs.mak]
......@@ -53,7 +53,7 @@ NULL=
!if [call create-lists.bat header gjs_objs.mak gjs_OBJS]
!endif
!if [for %c in ($(gjs_console_srcs)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_objs.mak ^$(CFG)\^$(PLAT)\gjs-console\%~nc.obj]
!if [for %c in ($(gjs_console_srcs)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_objs.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\gjs-console\%~nc.obj]
!endif
!if [call create-lists.bat footer gjs_objs.mak]
......@@ -68,7 +68,7 @@ NULL=
!if [call create-lists.bat header gjs_modules_objs.mak module_resources_generated_srcs]
!endif
!if [for %c in ($(module_resource_srcs)) do @call create-lists.bat file gjs_modules_objs.mak ^$(CFG)\^$(PLAT)\module-resources\%c]
!if [for %c in ($(module_resource_srcs)) do @call create-lists.bat file gjs_modules_objs.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\module-resources\%c]
!endif
!if [call create-lists.bat footer gjs_modules_objs.mak]
......@@ -77,7 +77,7 @@ NULL=
!if [call create-lists.bat header gjs_modules_objs.mak module_system_OBJS]
!endif
!if [for %c in ($(module_system_srcs)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_modules_objs.mak ^$(CFG)\^$(PLAT)\module-system\%~nc.obj]
!if [for %c in ($(module_system_srcs)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_modules_objs.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\module-system\%~nc.obj]
!endif
!if [call create-lists.bat footer gjs_modules_objs.mak]
......@@ -86,7 +86,7 @@ NULL=
!if [call create-lists.bat header gjs_modules_objs.mak module_console_OBJS]
!endif
!if [for %c in ($(module_console_srcs)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_modules_objs.mak ^$(CFG)\^$(PLAT)\module-console\%~nc.obj]
!if [for %c in ($(module_console_srcs)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_modules_objs.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\module-console\%~nc.obj]
!endif
!if [call create-lists.bat footer gjs_modules_objs.mak]
......@@ -95,7 +95,7 @@ NULL=
!if [call create-lists.bat header gjs_modules_objs.mak module_cairo_OBJS]
!endif
!if [for %c in ($(module_cairo_srcs)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_modules_objs.mak ^$(CFG)\^$(PLAT)\module-cairo\%~nc.obj]
!if [for %c in ($(module_cairo_srcs)) do @if "%~xc" == ".cpp" @call create-lists.bat file gjs_modules_objs.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\module-cairo\%~nc.obj]
!endif
!if [call create-lists.bat footer gjs_modules_objs.mak]
......
......@@ -97,6 +97,14 @@ VSVER = 16
VSVER = 0
!endif
# Visual Studio 2015, 2017 and 2019 link to the vc140 C/C++ runtimes,
# so we get a vc140.pdb for all these builds.
!if $(VSVER) < 15
PDBVER = $(VSVER)
!else
PDBVER = 14
!endif
!if "$(VSVER)" == "0"
MSG = ^
This NMake Makefile set supports Visual Studio^
......
......@@ -4,21 +4,21 @@
# one is maintaining the NMake build files.
# Copy the pre-defined config.h.win32
..\config.h: config.h.win32
vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\config.h: config.h.win32 vs$(VSVER)\$(CFG)\$(PLAT)\libgjs
@-copy $(@B).h.win32 $@
# Create the build directories
$(CFG)\$(PLAT)\module-console \
$(CFG)\$(PLAT)\module-system \
$(CFG)\$(PLAT)\module-resources \
$(CFG)\$(PLAT)\module-cairo \
$(CFG)\$(PLAT)\libgjs \
$(CFG)\$(PLAT)\gjs-console:
vs$(VSVER)\$(CFG)\$(PLAT)\module-console \
vs$(VSVER)\$(CFG)\$(PLAT)\module-system \
vs$(VSVER)\$(CFG)\$(PLAT)\module-resources \
vs$(VSVER)\$(CFG)\$(PLAT)\module-cairo \
vs$(VSVER)\$(CFG)\$(PLAT)\libgjs \
vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console:
@-mkdir $@
# Generate the GResource sources
$(CFG)\$(PLAT)\module-resources\modules-resources.h \
$(CFG)\$(PLAT)\module-resources\modules-resources.c: ..\modules\modules.gresource.xml
vs$(VSVER)\$(CFG)\$(PLAT)\module-resources\modules-resources.h \
vs$(VSVER)\$(CFG)\$(PLAT)\module-resources\modules-resources.c: ..\modules\modules.gresource.xml
$(PREFIX)\bin\glib-compile-resources.exe --target=$@ \
--sourcedir=.. --generate --c-name modules_resources \
$**
!if "$(BUILD_INTROSPECTION)" == "TRUE"
# Create the file list for introspection (to avoid the dreaded command-line-too-long problem on Windows)
$(CFG)\$(PLAT)\gjs_private_list:
vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\gjs_private_list:
@for %f in ($(LIBGJS_PRIVATE_SOURCES)) do @echo ../%f >> $@
$(CFG)\$(PLAT)\GjsPrivate-1.0.gir: $(CFG)\$(PLAT)\gjs.lib $(CFG)\$(PLAT)\gjs_private_list
@set LIB=.\$(CFG)\$(PLAT);$(PREFIX)\lib;$(LIB)
@set PATH=.\$(CFG)\$(PLAT);$(PREFIX)\bin;$(PATH)
vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.gir: vs$(VSVER)\$(CFG)\$(PLAT)\gjs.lib vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\gjs_private_list
@-echo Generating $@...
$(PYTHON) $(G_IR_SCANNER) \
--verbose -no-libtool \
......@@ -17,22 +15,20 @@ $(CFG)\$(PLAT)\GjsPrivate-1.0.gir: $(CFG)\$(PLAT)\gjs.lib $(CFG)\$(PLAT)\gjs_pri
--nsversion=1.0 \
$(INTROSPECTION_INCLUDE_PACKAGES) \
--library=gjs \
--library-path=$(CFG)\$(PLAT) \
--add-include-path=$(G_IR_INCLUDEDIR) \
--pkg-export=gjs \
--cflags-begin \
$(CFLAGS) $(LIBGJS_CFLAGS) \
$(CFLAGS) $(LIBGJS_CFLAGS_BASE) \
--cflags-end \
--filelist=$(CFG)\$(PLAT)\gjs_private_list \
--filelist=vs$(VSVER)\$(CFG)\$(PLAT)\libgjs\gjs_private_list \
-L.\vs$(VSVER)\$(CFG)\$(PLAT) \
-o $@
$(CFG)\$(PLAT)\GjsPrivate-1.0.typelib: $(CFG)\$(PLAT)\GjsPrivate-1.0.gir
@copy $*.gir $(@B).gir
vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.typelib: vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.gir
$(PREFIX)\bin\g-ir-compiler \
--includedir=$(CFG)\$(PLAT) --debug --verbose \
$(@B).gir \
--includedir=vs$(VSVER)\$(CFG)\$(PLAT) --debug --verbose \
$(**:\=/).gir \
-o $@
@del $(@B).gir
!else
!error $(ERROR_MSG)
!endif
......@@ -2,8 +2,6 @@
GTK_SUPPORT = yes
CAIRO_SUPPORT = yes
BUILT_TOOLS = gsf.exe gsf-vba-dump.exe
BUILT_LIBRARIES = libgsf libgsf-win32
!if "$(NO_CAIRO)" == "1"
CAIRO_SUPPORT = no
......
......@@ -8,11 +8,11 @@ install: all
@if not exist $(PREFIX)\include\gjs-1.0\util @mkdir $(PREFIX)\include\gjs-1.0\util
@copy /b $(LIBGJS_DLL_FILENAME).dll $(PREFIX)\bin
@copy /b $(LIBGJS_DLL_FILENAME).pdb $(PREFIX)\bin
@copy /b $(CFG)\$(PLAT)\gjs.lib $(PREFIX)\lib
@copy /b $(CFG)\$(PLAT)\gjs-console.exe $(PREFIX)\bin
@copy /b $(CFG)\$(PLAT)\gjs-console.exe $(PREFIX)\bin\gjs.exe
@copy /b $(CFG)\$(PLAT)\gjs-console.pdb $(PREFIX)\bin
@copy /b vs$(VSVER)\$(CFG)\$(PLAT)\gjs.lib $(PREFIX)\lib
@copy /b vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console.exe $(PREFIX)\bin
@copy /b vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console.exe $(PREFIX)\bin\gjs.exe
@copy /b vs$(VSVER)\$(CFG)\$(PLAT)\gjs-console.pdb $(PREFIX)\bin
@for %h in ($(LIBGJS_HEADERS)) do @copy ..\%h $(PREFIX)\include\gjs-1.0\%h
@rem Copy the generated introspection files, if built
@if exist $(CFG)\$(PLAT)\GjsPrivate-1.0.gir copy $(CFG)\$(PLAT)\GjsPrivate-1.0.gir $(PREFIX)\share\gir-1.0
@if exist $(CFG)\$(PLAT)\GjsPrivate-1.0.typelib copy /b $(CFG)\$(PLAT)\GjsPrivate-1.0.typelib $(PREFIX)\lib\girepository-1.0
@if exist vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.gir copy vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.gir $(PREFIX)\share\gir-1.0
@if exist vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.typelib copy /b vs$(VSVER)\$(CFG)\$(PLAT)\GjsPrivate-1.0.typelib $(PREFIX)\lib\girepository-1.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment