barrier/lib/platform/nmake.mak

120 lines
4.2 KiB
Makefile
Raw Normal View History

Applied patch by maruel: - Fixed taking the address of begin() on an empty std::vector. - Fixed nsis makefile to use %ProgramFiles% environment variable. - Fixed nsis makefile to pass the output directory and file to makensis. - Fixed synergy.nsi to get the files from the output directory. That enables a debug build of the installer. - Fixes to compile under VS2005. I did not apply VS2005 project files, instead adding nmake files. nmake is pretty weak but the makefiles can be modified without having visual studio. Also modified the .rc files to not use winres.h. This plus nmake means synergy can now be built using the freely downloadable Microsoft Windows SDK for Vista, available from microsoft's web site. This change removes all of the old VC++6 project files in favor of the nmake files. It also removes the XCode project in favor of ./configure and make. All of the nmake files are named nmake.mak. Only the top level makefile is directly useful (the rest are included by it) so all builds are from the top level directory. nmake knows the following targets: all: build synergy.exe, synergyc.exe and synergys.exe clean: remove all intermediate files, keep programs clobber: clean and remove programs installer: build programs and an installer debug: build a debug version of 'all' release: build a release version of 'all' debug-installer: build an installer of the debug build release-installer: build an installer of the release build The default build version is release so 'all' and 'installer' will build a release version. The installer itself never has debug symbols, just the stuff it installs. The default target is 'all'. To build use: nmake /nologo /f nmake.mak <target> VC++ and VisualStudio users may need to manually run vcvars.bat in a command.exe or cmd.exe window before invoking nmake. The Window 98/Me command.exe may not handle potentially long command lines; I haven't tried to verify if that works.
2007-09-06 05:01:44 +00:00
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2007 Chris Schoeneman
#
# This package is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# found in the file COPYING that should have accompanied this file.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
LIB_PLATFORM_SRC = lib\platform
LIB_PLATFORM_DST = $(BUILD_DST)\$(LIB_PLATFORM_SRC)
LIB_PLATFORM_LIB = "$(LIB_PLATFORM_DST)\platform.lib"
LIB_PLATFORM_CPP = \
"CMSWindowsClipboard.cpp" \
"CMSWindowsClipboardAnyTextConverter.cpp" \
"CMSWindowsClipboardBitmapConverter.cpp" \
"CMSWindowsClipboardHTMLConverter.cpp" \
"CMSWindowsClipboardTextConverter.cpp" \
"CMSWindowsClipboardUTF16Converter.cpp" \
"CMSWindowsDesks.cpp" \
"CMSWindowsEventQueueBuffer.cpp" \
"CMSWindowsKeyState.cpp" \
"CMSWindowsScreen.cpp" \
"CMSWindowsScreenSaver.cpp" \
"CMSWindowsUtil.cpp" \
$(NULL)
LIB_PLATFORM_OBJ = \
"$(LIB_PLATFORM_DST)\CMSWindowsClipboard.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsClipboardAnyTextConverter.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsClipboardBitmapConverter.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsClipboardHTMLConverter.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsClipboardTextConverter.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsClipboardUTF16Converter.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsDesks.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsEventQueueBuffer.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsKeyState.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsScreen.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsScreenSaver.obj" \
"$(LIB_PLATFORM_DST)\CMSWindowsUtil.obj" \
$(NULL)
LIB_PLATFORM_HOOK_CPP = \
"$(LIB_PLATFORM_SRC)\CSynergyHook.cpp" \
$(NULL)
LIB_PLATFORM_HOOK_OBJ = \
"$(LIB_PLATFORM_DST)\CSynergyHook.obj" \
$(NULL)
LIB_PLATFORM_HOOK_DLL = "$(BUILD_DST)\synrgyhk.dll"
LIB_PLATFORM_INC = \
/I"lib\common" \
/I"lib\arch" \
/I"lib\base" \
/I"lib\mt" \
/I"lib\io" \
/I"lib\net" \
/I"lib\synergy" \
$(NULL)
CPP_FILES = $(CPP_FILES) $(LIB_PLATFORM_CPP)
OBJ_FILES = $(OBJ_FILES) $(LIB_PLATFORM_OBJ)
LIB_FILES = $(LIB_FILES) $(LIB_PLATFORM_LIB) $(LIB_PLATFORM_HOOK_DLL)
# Hook should be as small as possible.
cpphookdebug = $(cppdebug:-Ox=-O1)
# Don't do security checks or run time error checking on hook.
cpphookflags = $(cppflags:-GS=)
cpphookdebug = $(cpphookdebug:/GZ=)
cpphookdebug = $(cpphookdebug:/RTC1=)
# Dependency rules
$(LIB_PLATFORM_OBJ): $(AUTODEP)
!if EXIST($(LIB_PLATFORM_DST)\deps.mak)
!include $(LIB_PLATFORM_DST)\deps.mak
!endif
# Build rules. Use batch-mode rules if possible.
!if DEFINED(_NMAKE_VER)
{$(LIB_PLATFORM_SRC)\}.cpp{$(LIB_PLATFORM_DST)\}.obj::
!else
{$(LIB_PLATFORM_SRC)\}.cpp{$(LIB_PLATFORM_DST)\}.obj:
!endif
@$(ECHO) Compile in $(LIB_PLATFORM_SRC)
-@$(MKDIR) $(LIB_PLATFORM_DST) 2>NUL:
$(cpp) $(cppdebug) $(cppflags) $(cppvarsmt) /showIncludes \
$(LIB_PLATFORM_INC) \
/Fo$(LIB_PLATFORM_DST)\ \
/Fd$(LIB_PLATFORM_LIB:.lib=.pdb) \
$< | $(AUTODEP) $(LIB_PLATFORM_SRC) $(LIB_PLATFORM_DST)
$(LIB_PLATFORM_LIB): $(LIB_PLATFORM_OBJ)
@$(ECHO) Link $(@F)
$(implib) $(ildebug) $(ilflags) \
/out:$@ \
$**
$(AUTODEP) $(LIB_PLATFORM_SRC) $(LIB_PLATFORM_DST) \
$(LIB_PLATFORM_OBJ:.obj=.d) $(LIB_PLATFORM_HOOK_OBJ:.obj=.d)
# Hook build rules
$(LIB_PLATFORM_HOOK_OBJ): \
$(LIB_PLATFORM_HOOK_CPP) $(LIB_PLATFORM_HOOK_CPP:.cpp=.h)
@$(ECHO) Compile $(LIB_PLATFORM_HOOK_CPP)
-@$(MKDIR) $(LIB_PLATFORM_DST) 2>NUL:
$(cpp) $(cpphookdebug) $(cpphookflags) $(cppvarsmt) /showIncludes \
-D_DLL -D_USRDLL -DSYNRGYHK_EXPORTS \
$(LIB_PLATFORM_INC) \
/Fo$(LIB_PLATFORM_DST)\ \
/Fd$(@:.obj=.pdb) \
$(LIB_PLATFORM_HOOK_CPP) | \
$(AUTODEP) $(LIB_PLATFORM_SRC) $(LIB_PLATFORM_DST)
$(LIB_PLATFORM_HOOK_DLL): $(LIB_PLATFORM_HOOK_OBJ)
@$(ECHO) Link $(@F)
$(link) $(ldebug) $(lflags) $(guilibsmt) \
/entry:"DllMain$(DLLENTRY)" /dll \
/out:$@ \
$**
$(AUTODEP) $(LIB_PLATFORM_SRC) $(LIB_PLATFORM_DST) \
$(LIB_PLATFORM_OBJ:.obj=.d) $(LIB_PLATFORM_HOOK_OBJ:.obj=.d)