# # 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 Gnu make even though you are compiling with # Microsoft Visual C++. # # The supported values of MX_ARCH are: # # linux - compiling with g++ # macosx - compiling with c++ # win32 - compiling with Visual C++ # ifndef MX_ARCH MX_ARCH=linux endif ifeq ($(MX_ARCH),win32) all: mxca_server.exe else all: mxca_server endif include ../../mx/libMx/Makehead.$(MX_ARCH) # Load the primary EPICS configuration from the makefiles # for the main EPICS module in MX core. include ../../mx/modules/epics/Makefile.config -include Makefile.depend MX_INCLUDE += ../../mx/libMx MX_LIB += ../../mx/libMx GCCFLAGS += -Wno-cast-qual ifndef MX_INSTALL_DIR MX_INSTALL_DIR=/opt/mx endif GCCFLAGS += -Wno-class-memaccess #-------------------------------------------------------------------------- # Normally, you should not have to modify anything after this point. # #--- MXCA_SERVER_OBJS = main.$(OBJ) mxca_export.$(OBJ) \ mxcaServer.$(OBJ) mxcaPV.$(OBJ) mxcaChannel.$(OBJ) mxcaRecord.$(OBJ) \ mxcaMcaRecord.$(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 \ -DUNIX -D_DEFAULT_SOURCE -Dlinux -D_REENTRANT -ansi # -DUNIX -D_BSD_SOURCE -Dlinux -D_REENTRANT -ansi ifeq ($(EPICS_HOST_ARCH),linux-x86_64) EPICS_FLAGS += -D_X86_ endif ifeq ($(EPICS_HOST_ARCH),linux-x86) EPICS_FLAGS += -D_X86_ endif ifeq ($(EPICS_HOST_ARCH),linux-ppc) EPICS_FLAGS += -D_ppc_ endif COMPILE_FLAGS = -DOS_LINUX -DDEBUG \ $(EPICS_FLAGS) $(GCCFLAGS) -I$(MX_INCLUDE) $(EPICS_INCLUDES) COMPILE = g++ -c -g $(COMPILE_FLAGS) $(OPTIMIZE) mxca_server: $(MXCA_SERVER_OBJS) g++ -g -o mxca_server $(MXCA_SERVER_OBJS) \ -L$(MX_LIB) $(EPICS_LIB_DIRS) -lcas -lgdd -lca -lCom -lMx depend: -rm Makefile.depend $(CC) -MM $(COMPILE_FLAGS) -D__MX_MAKEDEPEND__ *.c* > Makefile.depend install: cp mxca_server $(MX_INSTALL_DIR)/sbin cp ../scripts/start_mxca_server $(MX_INSTALL_DIR)/sbin cp ../scripts/mxca $(MX_INSTALL_DIR)/sbin endif #-------------------------------------------------------------------------- ifeq ($(MX_ARCH),macosx) EPICS_FLAGS = -DUNIX -Ddarwin COMPILE_FLAGS = -DOS_MACOSX -DDEBUG \ $(EPICS_FLAGS) $(GCCFLAGS) -I$(MX_INCLUDE) $(EPICS_INCLUDES) COMPILE = c++ -c -g $(COMPILE_FLAGS) $(OPTIMIZE) mxca_server: $(MXCA_SERVER_OBJS) c++ -g -o mxca_server $(MXCA_SERVER_OBJS) \ -L$(MX_LIB) $(EPICS_LIB_DIRS) -lcas -lgdd -lca -lCom -lMx depend: -rm Makefile.depend $(CC) -MM $(COMPILE_FLAGS) -D__MX_MAKEDEPEND__ *.c* > Makefile.depend 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 EPICS_FLAGS = -nologo -EHsc -GR \ -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ -D__STDC__=0 -W3 -w44355 -MD COMPILE_FLAGS = -DOS_WIN32 -DDEBUG $(EPICS_FLAGS) -I$(MX_INCLUDE) \ $(EPICS_INCLUDES) -Zi -WX $(OPTIMIZE) COMPILE = cl -c $(COMPILE_FLAGS) CFLAGS = $(COMPILE_FLAGS) mxca_server.exe: $(MXCA_SERVER_OBJS) link -debug -nologo -LTCG -incremental:no -opt:ref -release \ -version:3.14 -out:mxca_server.exe $(MXCA_SERVER_OBJS) \ $(EPICS_LIB_DIRS)\\cas.lib $(EPICS_LIB_DIRS)\\gdd.lib \ $(EPICS_LIB_DIRS)\\ca.lib $(EPICS_LIB_DIRS)\\Com.lib \ $(MX_LIB)\\libmx.lib depend: -rm Makefile.depend makedepend -o.obj -Y -I../../mx/libMx -f- *.c* 2>/dev/null > Makefile.depend install: cp mxca_server.exe $(MX_INSTALL_DIR)/sbin cp mxca_server.pdb $(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 mxcaMcaRecord.$(OBJ): mxcaMcaRecord.cpp mxcaMcaRecord.h mxcaServer.h $(COMPILE) mxcaMcaRecord.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* -rm Makefile.depend distclean: clean