# # Name: Makehead.win32 # # Purpose: This file is used to customize operating system and installation # dependent features of the MX makefiles. This version is customized # for Microsoft Win32 (Windows 95/98/NT/2000/XP). # # Normally, the only things that end users may have to modify in this file are # the definitions of INCLUDES, LIB_DIRS, and LIBRARIES. # INCLUDES = $(MX_INCLUDES) LIBRARIES = $(WIN32_LIBS) #INCLUDES = $(MX_INCLUDES) $(EPICS_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(EPICS_LIBS) #INCLUDES = $(MX_INCLUDES) $(EPIX_XCLIB_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(EPIX_XCLIB_LIBS) #INCLUDES = $(MX_INCLUDES) $(ESONE_CAMAC_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(JORWAY_CAMAC_LIBS) #INCLUDES = $(MX_INCLUDES) $(XIA_HANDEL_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(XIA_HANDEL_LIBS) #INCLUDES = $(MX_INCLUDES) $(XIA_HANDEL_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(XIA_HANDEL_LIBS) $(XIA_XERXES_LIBS) #INCLUDES = $(MX_INCLUDES) $(DRIVERLINX_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(DRIVERLINX_LIBS) #INCLUDES = $(MX_INCLUDES) $(U500_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(U500_LIBS) #INCLUDES = $(MX_INCLUDES) $(PMC_MCAPI_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(PMC_MCAPI_LIBS) #INCLUDES = $(MX_INCLUDES) $(UMCBI_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(UMCBI_LIBS) #INCLUDES = $(MX_INCLUDES) $(DRIVERLINX_INCLUDES) $(PCMOTION32_INCLUDES) \ # $(PMC_MCAPI_INCLUDES) $(U500_INCLUDES) $(UMCBI_INCLUDES) #LIBRARIES = $(WIN32_LIBS) $(DRIVERLINX_LIBS) $(PCMOTION32_LIBS) \ # $(PMC_MCAPI_LIBS) $(U500_LIBS) $(UMCBI_LIBS) # *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** # # If you link to third party libraries, you _must_ make sure that you are # compiling MX to use the same run time libraries, e.g. MSVCRT versus LIBCMT, # as the third party library is using. If you do not and there is a mismatch, # then at best linking your binaries will fail and alert you to the problem. # However, it is also possible that the executables will seem to build # correctly, but then occasionally fail in mysterious ways. Thus, it is # very important to get this right! # # Also, since MX uses threads in a number of places, -ML and -MLd are # not valid choices and must not be used. RUN_TIME_LIBRARY_FLAGS = -MD # dynamically linked MSVCRT #RUN_TIME_LIBRARY_FLAGS = -MDd # dynamically linked MSVCRT (debugging version) #RUN_TIME_LIBRARY_FLAGS = -MT # statically linked LIBCMT #RUN_TIME_LIBRARY_FLAGS = -MTd # statically linked LIBCMT (debugging version) # # You may also need to modify some of the following definitions, depending # on the drivers you plan to use. # # # You must specify the directory that Microsoft Visual C++ was installed in. # Usually this is c:\progra~1\micros~1.net\vc7\PlatformSDK. The name specified # for Gnu Make MUST NOT contain any spaces in it. That is why the example # below specified the progra~1\micros~1 directory. # MSDEV_DIR = c:\\progra~1\\micros~1.net\\vc7\\PlatformSDK #MSDEV_DIR = c:\\progra~1\\micros~1\\vc98 #MSDEV_DIR = c:\\progra~1\\micros~2\\vc98 #MSDEV_DIR = c:\\progra~1\\micros~3\\vc98 #MSDEV_DIR = c:\\progra~1\\micros~2\\vc #MSDEV_DIR = c:\\progra~1\\devstudio\\vc #MSDEV_DIR = c:\\msdev #MSDEV_DIR = c:\\progra~1\\micros~3 #MSDEV_DIR = c:\\progra~1\\micros~4 # # If you are using the Win32 version of DUMA (duma.sourceforge.net) # uncomment the following lines. DUMA is a fork of Electric Fence # which has been ported to Win32. # # WARNING: Make sure that DUMA has been compiled with the same flags # (-MD, -MDd, -MT, or -MTd) as is being used to compile MX. The default # configuration as delivered of DUMA uses -MLd. -MLd is not supported # by MX, since the use of the -MLd flag breaks MX's support for threads. # #DUMA_DIR = c:\\opt\\duma_2_4_27-MTd #DUMA_LIB = $(DUMA_DIR)\\win32-msvc\\dumalib\\Debug\\dumalib.lib #DUMA_OPTS = /force $(DUMA_LIB) # # If you are using a separately downloaded copy of the Win32 Platform SDK, # the following is an example of how to have your compiler use that rather # than the version bundled with the compiler. Most people should not have # to do something like this. #PLATFORM_SDK = c:\\progra~1\\mifd68~1 #PLATFORM_SDK = c:\\progra~1\\micros~3 #PLATFORM_SDK = c:\\progra~1\\micros~4 # #RUN_TIME_LIBRARY_FLAGS += $(LIBMX_INCLUDES) #INCLUDES = -I$(PLATFORM_SDK)\\include $(MX_INCLUDES) #LIBMX_INCLUDES = -I$(PLATFORM_SDK)\\include $(MX_INCLUDES) #MSDEV_DIR = $(PLATFORM_SDK) # # The following definition of WIN32_LIBS can probably be left alone if you # are creative enough in how you define MSDEV_DIR. # WIN32_LIBS = $(MSDEV_DIR)\\lib\\wsock32.lib $(MSDEV_DIR)\\lib\\winmm.lib \ $(MSDEV_DIR)\\lib\\advapi32.lib # # Visual C++ 2005 and above use "manifest" files to find C runtime library DLLs. # It is possible to use a "manifest tool" program to embed the contents of # the manifest file back into the binary file. # # Since Cygwin comes with a completely unrelated program that is _also_ called # 'mt', we must specify the full pathname of the manifest tool to ensure that # we find the correct one. # # The following forest of backticks, backslashes, and double quotes should be # sufficient to ensure that the final pathname for 'mt' uses forward slashes # when handed to 'bash' by the Cygwin make program. # MSMANIFEST_TOOL = `echo "$(MSDEV_DIR)\\bin\\mt" | tr \\\\ / ` # # Directory containing the EG&G Ortec UMCBI library and include file. # UMCBI_DIR = c:\\Ortec UMCBI_INCLUDES = -I$(UMCBI_DIR)\\lib UMCBI_LIBS = $(UMCBI_DIR)\\lib\\Mcbcio32.lib # # Directory tree containing compiled versions of the XIA Handel libraries # and include files. # # Tested with Handel 0.5.4 (January 2005) # # WARNING: For current versions of Handel you must set the makefile variable # RUN_TIME_LIBRARY_FLAGS to -MTd above. # #XIA_HANDEL_DIR = c:\\progra~1\\xia\\kepler-dev-tools-1_1_7\\handel #XIA_HANDEL_DIR = c:\\progra~1\\xia\\handel-0.6-1216\\handel #XIA_HANDEL_DIR = c:\\opt\\handel-0.5.4\\handel XIA_HANDEL_DIR = c:\\opt\\handel-0.5.4-ken\\handel #XIA_HANDEL_DIR = c:\\progra~1\\xia\\handel-Win_All_DLL-0_5_4\\handel XIA_HANDEL_INCLUDES = -I$(XIA_HANDEL_DIR)\\inc -DIS_MX_DRIVER XIA_HANDEL_LIB_DIR = $(XIA_HANDEL_DIR)\\lib XIA_HANDEL_LIBS = $(XIA_HANDEL_LIB_DIR)\\handel.lib XIA_XERXES_LIBS = $(XIA_HANDEL_LIB_DIR)\\xerxes.lib \ $(XIA_HANDEL_LIB_DIR)\\md.lib # # Aerotech Unidex 500 motor controllers # U500_DIR = c:\\U500\\mmi U500_INCLUDES = -I$(U500_DIR)\\include U500_LIBS = $(U500_DIR)\\Win50032.lib # # Precision MicroControl Motion Control API (MCAPI) interface. # PMC_MCAPI_DIR = c:\\progra~1\\motion~1\\motion~1\\sources PMC_MCAPI_INCLUDES = -I$(PMC_MCAPI_DIR) PMC_MCAPI_LIBS = $(PMC_MCAPI_DIR)\\mcapi32.lib \ $(PMC_MCAPI_DIR)\\mcdlg32.lib # # Jorway CAMAC drivers from Fermilab # JORWAY_CAMAC_DIR = c:\\camac\\jorway\\sjyWIN JORWAY_CAMAC_LIBS = $(JORWAY_CAMAC_DIR)\\lib\\sjy73a.lib ESONE_CAMAC_INCLUDES = -I$(JORWAY_CAMAC_DIR)\\inc # # DriverLINX NT Port I/O driver. # DRIVERLINX_DIR = c:\\progra~1\\DLPortIO DRIVERLINX_INCLUDES = -I$(DRIVERLINX_DIR)\\API DRIVERLINX_LIBS = $(DRIVERLINX_DIR)\\API\\DLPORTIO.lib # # Directory containing the National Instruments pcMotion32 DLL for the # ValueMotion series of motor controllers. # #PCMOTION32_DIR = c:\\nuLogic\\pcMotion #PCMOTION32_INCLUDES = -I$(PCMOTION32_DIR)\\SUPPORT #PCMOTION32_LIBS = $(PCMOTION32_DIR)\\SUPPORT\\Microsoft\\pcmotionMS.lib PCMOTION32_DIR = c:\\ValueMotion PCMOTION32_INCLUDES = -I$(PCMOTION32_DIR)\\Include PCMOTION32_LIBS = $(PCMOTION32_DIR)\\lib\\Microsoft\\pcmotionMS.lib # # EPICS includes and libraries. # EPICS_ARCH = WIN32 EPICS_TOP = c:\\users\\lavender\\epics\\R3.13.1 EPICS_INCLUDES = -I$(EPICS_TOP)\\base\\include EPICS_LIBS = $(EPICS_TOP)\\base\\lib\\$(EPICS_ARCH)\\ca.lib \ $(EPICS_TOP)\\base\\lib\\$(EPICS_ARCH)\\Com.lib # # EPIX, Inc. XCLIB includes and libraries. # # Note: EPICS and EPIX are unrelated. The names are just a coincidence. # EPIX_XCLIB_DIR = c:\\XCLIB EPIX_XCLIB_INCLUDES = -I$(EPIX_XCLIB_DIR) -DIS_MX_DRIVER EPIX_XCLIB_LIBS = $(EPIX_XCLIB_DIR)\\XCLIBWNT.lib # #======================================================================== # # Generally, you should not have to modify anything after this point. # # Intel x86 with Microsoft Visual C++ under Win32. # .SUFFIXES: .SUFFIXES: .c .obj .c.obj: $(CC) -c $(CFLAGS) $< CC = cl CFLAGS = -nologo $(INCLUDES) $(RUN_TIME_LIBRARY_FLAGS) \ -Zi -WX -DOS_WIN32 $(EXTRA_FLAGS) -DDEBUG CFLAGS_EPICS = $(CFLAGS) # Special cases for individual files. CFLAGS_MX_EPICS = $(CFLAGS_EPICS) CFLAGS_MX_VERS = $(CFLAGS) -DMX_MAJOR_VERSION=$(MX_MAJOR_VERSION) \ -DMX_MINOR_VERSION=$(MX_MINOR_VERSION) \ -DMX_UPDATE_VERSION=$(MX_UPDATE_VERSION) COMPILE = $(CC) -c DEFINE = -D # # I use a version of makedepend that I obtained from the web site # http://www.utexas.edu/ftp/microlib/nt/new/ # # Disabled for now. # #MAKEDEPEND = mkdepend -f- $(CFLAGS) $(EPICS_INCLUDES) *.c > Makefile.depend #MAKEDEPEND = cp nul Makefile.depend MAKEDEPEND = ( rm Makefile.depend ; touch Makefile.depend ) MAKEDEPEND_CLEAN = rm Makefile.depend # #--------------------------------------------------- # MX_LIB_SRCS = mx_driver.c $(MX_CORE_SRCS) $(MX_DRIVER_SRCS) # # See libMx/Makehead.irix for why this is here. # MX_LIB_OBJS = $(MX_LIB_SRCS:.c=.$(OBJ)) MOTOR_OBJS = $(MOTOR_SRCS:.c=.$(OBJ)) SERVER_OBJS = $(SERVER_SRCS:.c=.$(OBJ)) UPDATE_OBJS = $(UPDATE_SRCS:.c=.$(OBJ)) MXDRIVERINFO_OBJS = $(MXDRIVERINFO_SRCS:.c=.$(OBJ)) #---- MX_LIB_OBJS += mx_util_win32.obj MX_LIB_OBJS += ..\\tools\\strlcpy.obj ..\\tools\\strlcat.obj MX_LIB_OBJS += ..\\tools\\xdr.obj ..\\tools\\xdr_hyper.obj MX_LIB_OBJS += ..\\tools\\getopt.obj # #--------------------------------------------------- # RM = rm MAKE = make OBJ = obj EXEOUT = -Fe DOTEXE = .exe # MX_LIB_DIR = ..\\libMx MX_INC_DIR = $(MX_LIB_DIR) MX_INCLUDES = -I$(MX_INC_DIR) MX_LIBRARY_PATH = $(MX_LIB_DIR)\\$(MX_LIBRARY_NAME) MX_LIBRARY_NAME = libMx.lib MX_LIBRARY_STATIC_NAME = $(MX_LIBRARY_NAME) MX_LIBRARY_DELETE = $(RM) libMx.* $(MX_LIBRARY_NAME): $(MX_LIB_OBJS) -$(MX_LIBRARY_DELETE) link /dll /debug /nologo /out:libMx.dll /nodefaultlib:libc \ $(DUMA_OPTS) $(MX_LIB_OBJS) $(LIBRARIES) # For VC2005 or later, embed the manifest in the DLL. if test -f libMx.dll.manifest; then \ $(MSMANIFEST_TOOL) -nologo -outputresource:libMx.dll\;2 \ -manifest libMx.dll.manifest $(EXTRA_MANIFESTS) ; \ rm -f libMx.dll.manifest; \ fi library_install: -mkdir $(MX_INSTALL_DIR)/bin -mkdir $(MX_INSTALL_DIR)/etc -mkdir $(MX_INSTALL_DIR)/etc/startup -mkdir $(MX_INSTALL_DIR)/include -mkdir $(MX_INSTALL_DIR)/lib -mkdir $(MX_INSTALL_DIR)/log -mkdir $(MX_INSTALL_DIR)/run -mkdir $(MX_INSTALL_DIR)/sbin -mkdir $(MX_INSTALL_DIR)/state cp mx*.h $(MX_INSTALL_DIR)/include cp $(MX_LIBRARY_NAME) $(MX_INSTALL_DIR)/lib cp libMx.dll $(MX_INSTALL_DIR)/bin touch $(MX_INSTALL_DIR)/etc/motor.dat touch $(MX_INSTALL_DIR)/etc/scan.dat cp ../plotgnu/plotgnu.pl $(MX_INSTALL_DIR)/bin cp ../plotgnu/showdata $(MX_INSTALL_DIR)/bin/showdata.pl cp ../plotgnu/showplot $(MX_INSTALL_DIR)/bin/showplot.pl cp ../plotgnu/plot2ps $(MX_INSTALL_DIR)/bin/plot2ps.pl cp ../plotgnu/*.bat $(MX_INSTALL_DIR)/bin cp ../tools/*.exe $(MX_INSTALL_DIR)/bin # #--------------------------------------------------- # MOTOR_NAME = motor.exe $(MOTOR_NAME): $(MOTOR_OBJS) $(MX_LIBRARY_PATH) link /debug /nologo /out:$(MOTOR_NAME) $(MOTOR_OBJS) \ /nodefaultlib:libc $(DUMA_OPTS) $(MX_LIBRARY_PATH) $(WIN32_LIBS) # For VC2005 or later, embed the manifest in the executable. if test -f $(MOTOR_NAME).manifest; then \ $(MSMANIFEST_TOOL) -nologo -outputresource:$(MOTOR_NAME)\;1 \ -manifest $(MOTOR_NAME).manifest $(EXTRA_MANIFESTS) ; \ rm -f $(MOTOR_NAME).manifest; \ fi motor_install: cp $(MOTOR_NAME) $(MX_INSTALL_DIR)/bin # #--------------------------------------------------- # SERVER_NAME = mxserver.exe $(SERVER_NAME): $(SERVER_OBJS) $(MX_LIBRARY_PATH) link /debug /nologo /out:mxserver.exe *.obj \ /nodefaultlib:libc $(DUMA_OPTS) $(MX_LIBRARY_PATH) $(WIN32_LIBS) # For VC2005 or later, embed the manifest in the executable. if test -f $(SERVER_NAME).manifest; then \ $(MSMANIFEST_TOOL) -nologo -outputresource:$(SERVER_NAME)\;1 \ -manifest $(SERVER_NAME).manifest $(EXTRA_MANIFESTS) ; \ rm -f $(SERVER_NAME).manifest; \ fi server_install: cp $(SERVER_NAME) $(MX_INSTALL_DIR)/sbin cp ../scripts/startmxserver.bat $(MX_INSTALL_DIR)/sbin cp ../scripts/mx.bat $(MX_INSTALL_DIR)/sbin touch $(MX_INSTALL_DIR)/etc/mxserver.dat touch $(MX_INSTALL_DIR)/etc/mxserver.acl # #--------------------------------------------------- # UPDATE_NAME = mxupdate.exe $(UPDATE_NAME): $(UPDATE_OBJS) $(MX_LIBRARY_PATH) link /debug /nologo /out:mxupdate.exe *.obj \ /nodefaultlib:libc $(DUMA_OPTS) $(MX_LIBRARY_PATH) $(WIN32_LIBS) # For VC2005 or later, embed the manifest in the executable. if test -f $(UPDATE_NAME).manifest; then \ $(MSMANIFEST_TOOL) -nologo -outputresource:$(UPDATE_NAME)\;1 \ -manifest $(UPDATE_NAME).manifest $(EXTRA_MANIFESTS) ; \ rm -f $(UPDATE_NAME).manifest; \ fi update_install: cp $(UPDATE_NAME) $(MX_INSTALL_DIR)/sbin cp ../scripts/startmxupdate.bat $(MX_INSTALL_DIR)/sbin touch $(MX_INSTALL_DIR)/etc/mxupdate.dat # #--------------------------------------------------- # MXDRIVERINFO_NAME = mxdriverinfo.exe $(MXDRIVERINFO_NAME): $(MXDRIVERINFO_OBJS) $(MX_LIBRARY_PATH) link /debug /nologo /out:mxdriverinfo.exe *.obj \ /nodefaultlib:libc $(DUMA_OPTS) $(MX_LIBRARY_PATH) $(WIN32_LIBS) # For VC2005 or later, embed the manifest in the executable. if test -f $(MXDRIVERINFO_NAME).manifest; then \ $(MSMANIFEST_TOOL) -nologo \ -outputresource:$(MXDRIVERINFO_NAME)\;1 \ -manifest $(MXDRIVERINFO_NAME).manifest $(EXTRA_MANIFESTS) ; \ rm -f $(MXDRIVERINFO_NAME).manifest; \ fi util_install: cp $(MXDRIVERINFO_NAME) $(MX_INSTALL_DIR)/bin