barrier/Makefile.win

146 lines
3.3 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.
# Name of this file for recursive make
MAKEFILE = Makefile.win
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
# Default build is release is NODEBUG is defined, debug otherwise.
!if !DEFINED(DEBUG)
NODEBUG = 1
!else
!undef NODEBUG
!endif
# Build all by default
default: all
# Redefine implicit rule suffixes
.SUFFIXES:
.SUFFIXES: .cpp .rc .obj
# Shut up
.SILENT:
# Include system macros
#APPVER = 5.0
#TARGETOS = WINNT
!include <win32.mak>
# Be explicit about C++ compiler
cpp = $(cc)
cppdebug = $(cdebug)
cppflags = $(cflags)
cppvarsmt = $(cvarsmt)
# Library tool options
ildebug =
ilflags = /nologo
# Handy macro for defining list macros
NULL =
# System commands
ECHO = echo
MKDIR = mkdir
RM = del /f
RMR = rmdir /q /s
# Local build utilities
UTIL_DIR = win32util
AUTODEP = "$(UTIL_DIR)\autodep.exe"
# Destination for intermediate build targets
BUILD_DIR = build
BUILD_DEBUG_DIR = $(BUILD_DIR)\Debug
BUILD_RELEASE_DIR = $(BUILD_DIR)\Release
!if DEFINED(NODEBUG)
BUILD_DST = $(BUILD_RELEASE_DIR)
!else
BUILD_DST = $(BUILD_DEBUG_DIR)
!endif
# Compiler argument changes
cflags = $(cflags:-W3=-W4) /WX
cflags = $(cflags) -D_CRT_SECURE_NO_DEPRECATE
cflags = $(cflags) /GR
!if !DEFINED(OLDCOMPILER)
cflags = $(cflags) /EHsc
!else
cflags = $(cflags) /GX
!endif
!if !DEFINED(NODEBUG)
!if !DEFINED(OLDCOMPILER)
cdebug = $(cdebug) /RTC1
!else
cdebug = $(cdebug) /GZ
!endif
!endif
# Initialize variables for library and program makefiles
C_FILES =
CPP_FILES =
OBJ_FILES =
LIB_FILES =
PROGRAMS =
OPTPROGRAMS = $(AUTODEP)
# Include subdirectory makefiles
!include lib\common\$(MAKEFILE)
!include lib\arch\$(MAKEFILE)
!include lib\base\$(MAKEFILE)
!include lib\mt\$(MAKEFILE)
!include lib\io\$(MAKEFILE)
!include lib\net\$(MAKEFILE)
!include lib\synergy\$(MAKEFILE)
!include lib\platform\$(MAKEFILE)
!include lib\client\$(MAKEFILE)
!include lib\server\$(MAKEFILE)
!include cmd\synergyc\$(MAKEFILE)
!include cmd\synergys\$(MAKEFILE)
!include cmd\launcher\$(MAKEFILE)
!include dist\nullsoft\$(MAKEFILE)
# Collect library and program variables
INTERMEDIATES = $(OBJ_FILES) $(AUTODEP:.exe=.obj)
TARGETS = $(LIB_FILES) $(PROGRAMS)
OPTTARGETS = $(OPTPROGRAMS)
# Build release by reinvoking make with NODEBUG defined
release:
@$(MAKE) /nologo /f $(MAKEFILE) NODEBUG=1
# Build debug by reinvoking make with DEBUG defined
debug:
@$(MAKE) /nologo /f $(MAKEFILE) DEBUG=1
# Build all targets
all: $(TARGETS)
# Clean intermediate targets
clean:
-$(RMR) $(BUILD_DEBUG_DIR)
-$(RMR) $(BUILD_RELEASE_DIR)
# Clean all targets
clobber: clean
-$(RMR) $(BUILD_DIR)
# Utility command build rules
$(AUTODEP): $(AUTODEP:.exe=.cpp)
!if DEFINED(NODEBUG)
@$(ECHO) Build $(@F)
$(cpp) $(cppdebug) $(cppflags) $(cppvars) /Fo"$(**:.cpp=.obj)" $**
$(link) $(ldebug) $(conflags) -out:$@ $(**:.cpp=.obj) $(conlibs)
!else
@$(MAKE) /nologo /f $(MAKEFILE) NODEBUG=1 $@
!endif