# # Makefile for mxca_server using EPICS 3.14.x # # WARNING: This makefile assumes that you are using Gnu make! Any attempts # to use a different make, such as the Solaris make, will crash # and burn. In this case, this is not a big restriction since # you must have Gnu make around to build EPICS. # # On Win32, you must use the Cygwin make even though you are compiling with # Microsoft Visual C++. # # The supported values of MX_ARCH are: # # linux - compiling with G++ # win32 - compiling with Visual C++ # MX_ARCH = linux MX_INSTALL_DIR = /opt/mx #MX_INSTALL_DIR = /mnt/mx #MX_INSTALL_DIR = $(HOME)/local/mx #MX_INSTALL_DIR = c:/opt/mx-1.5.3-2010_06_18 ifeq ($(MX_ARCH),linux) # Example for Linux MX_INCLUDE = ../../mx/libMx MX_LIB = ../../mx/libMx #EPICS_BASE = /opt/epics/base #EPICS_BASE = /opt/EPICS/base #EPICS_BASE = /mnt/epics/base #EPICS_BASE = /home/lavender/local/epics/base endif ifeq ($(MX_ARCH),win32) # Example for Win32 MX_INCLUDE = ../../mx/libMx MX_LIB = ..\\..\\mx\\libMx #EPICS_BASE = c:/opt/epics/base-3.14.10 #EPICS_BASE_WIN32 = c:\\opt\\epics\\base-3.14.10 EPICS_BASE = c:/opt/epics/base-3-14-11 EPICS_BASE_WIN32 = c:\\opt\\epics\\base-3-14-11 endif #---- ifeq ($(MX_ARCH),linux) OBJ = o EPICS_HOST_ARCH = linux-x86_64 #EPICS_HOST_ARCH = linux-x86 #EPICS_HOST_ARCH = linux-ppc #EPICS_HOST_ARCH = linux-x86-debug #EPICS_INCLUDES = -I$(EPICS_BASE)/include \ # -I$(EPICS_BASE)/include/os/Linux #EPICS_LIB_DIR = -L$(EPICS_BASE)/lib/$(EPICS_HOST_ARCH) # If you are using the NSLS-II EPICS Debian packages, use # the following definitions. EPICS_INCLUDES = -I/usr/lib/epics/include \ -I/usr/lib/epics/include/os/Linux EPICS_LIB_DIR = -L/usr/lib/epics/lib/$(EPICS_HOST_ARCH) # If you are using IIT's EPICS Debian packages, use # the following definitions. #EPICS_INCLUDES = -I/usr/include/epics -I/usr/include/epics/os/Linux #EPICS_LIB_DIR = endif ifeq ($(MX_ARCH),win32) OBJ = obj EPICS_HOST_ARCH = win32-x86 EPICS_INCLUDES = -I$(EPICS_BASE)/include \ -I$(EPICS_BASE)/include/os/WIN32 EPICS_LIB_DIR = $(EPICS_BASE_WIN32)\\lib\\$(EPICS_HOST_ARCH) endif #--- # # gcc specific flags # GCCFLAGS = -Wall -Werror \ -Wpointer-arith \ -Wcast-align \ -Winline \ -Wno-deprecated # FIXME: Get rid of -Wno-deprecated # Debian Etch needs the following. Debian Lenny does _not_ need it. #GCCFLAGS += -Wno-non-virtual-dtor #--- MXCA_SERVER_OBJS = main.$(OBJ) mxca_export.$(OBJ) \ mxcaServer.$(OBJ) mxcaPV.$(OBJ) mxcaChannel.$(OBJ) mxcaRecord.$(OBJ) \ mxcaMotorRecord.$(OBJ) mxcaScalerRecord.$(OBJ) #-------------------------------------------------------------------------- # Linux ifeq ($(MX_ARCH),linux) EPICS_FLAGS = -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS \ -D_XOPEN_SOURCE=500 -DOSITHREAD_USE_DEFAULT_STACK \ -D_X86_ -DUNIX -D_BSD_SOURCE \ -Dlinux -D_REENTRANT -ansi COMPILE_FLAGS = -DOS_LINUX -DDEBUG \ $(EPICS_FLAGS) $(GCCFLAGS) -I$(MX_INCLUDE) $(EPICS_INCLUDES) COMPILE = g++ -c -g $(COMPILE_FLAGS) mxca_server: $(MXCA_SERVER_OBJS) g++ -g -o mxca_server $(MXCA_SERVER_OBJS) \ -L $(MX_LIB) $(EPICS_LIB_DIR) -lcas -lgdd -lca -lCom -lMx install: cp mxca_server $(MX_INSTALL_DIR)/sbin endif #-------------------------------------------------------------------------- # Win32 ifeq ($(MX_ARCH),win32) EPICS_FLAGS = -nologo -EHsc -GR \ -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ -D__STDC__=0 -Ox -GL -W3 -w44355 -MD COMPILE_FLAGS = -DOS_WIN32 -DDEBUG \ $(EPICS_FLAGS) -I$(MX_INCLUDE) $(EPICS_INCLUDES) -Zi -WX COMPILE = cl -c $(COMPILE_FLAGS) mxca_server.exe: $(MXCA_SERVER_OBJS) link -nologo -LTCG -incremental:no -opt:ref -release -version:3.14 \ -out:mxca_server.exe $(MXCA_SERVER_OBJS) \ $(EPICS_LIB_DIR)\\cas.lib $(EPICS_LIB_DIR)\\gdd.lib \ $(EPICS_LIB_DIR)\\ca.lib $(EPICS_LIB_DIR)\\Com.lib \ $(MX_LIB)\\libmx.lib install: cp mxca_server.exe $(MX_INSTALL_DIR)/sbin endif #-------------------------------------------------------------------------- main.$(OBJ): main.cpp mxcaServer.h $(COMPILE) main.cpp mxca_export.$(OBJ): mxca_export.cpp mxcaServer.h $(COMPILE) mxca_export.cpp mxcaServer.$(OBJ): mxcaServer.cpp mxcaServer.h $(COMPILE) mxcaServer.cpp mxcaPV.$(OBJ): mxcaPV.cpp mxcaServer.h $(COMPILE) mxcaPV.cpp mxcaChannel.$(OBJ): mxcaChannel.cpp mxcaServer.h $(COMPILE) mxcaChannel.cpp mxcaRecord.$(OBJ): mxcaRecord.cpp mxcaServer.h $(COMPILE) mxcaRecord.cpp mxcaMotorRecord.$(OBJ): mxcaMotorRecord.cpp mxcaMotorRecord.h mxcaServer.h $(COMPILE) mxcaMotorRecord.cpp mxcaScalerRecord.$(OBJ): mxcaScalerRecord.cpp mxcaScalerRecord.h mxcaServer.h $(COMPILE) mxcaScalerRecord.cpp clean: -rm mxca_server *.$(OBJ) *.exe *.exp *.lib *.pdb core* distclean: clean