# # Name: Makehead.cygwin # # Purpose: This file is used to customize operating system and installation # dependent features of the MX makefiles. This version is customized # for Cygwin under Microsoft Win32. # # Cygwin may be found at http://sources.redhat.com/cygwin/ # or http://cygwin.com/ # # Normally, the only things that end users may have to modify in this file are # the definitions of INCLUDES, LIB_DIRS, and LIBRARIES. If you want to speed # up the build by linking everything statically, you may want to set the # BUILD_LIBMX_DLL variable to 'no'. # INCLUDES = $(MX_INCLUDES) # LIB_DIRS = -L$(MX_LIB_DIR) LIBRARIES = -lrpclib # # Currently I build libMx.dll and its export library libMx.dll.a using # the Cygwin 'dllwrap' utility. Unfortunately, generating the export # library takes a very long time, sometimes over 10 minutes, since libMx # has so many symbols. Most of this time is taken up by 'dlltool' which # has to create around 4000 temporary files with names like ds0432.o, etc. # in order to create the export library libMx.dll.a. Thus, when you are # debugging libMx on Cygwin, you probably want to set BUILD_LIBMX_DLL # to 'no' while debugging and only set it to 'yes' when you are doing # your final build. However, this is still better than trying to use # a libMx.def file which would have so many entries and change so often # that it would be almost impossible to maintain. # # Theoretically, Cygwin's __attribute__((dllexport)) feature might be # a way to cut down on the build time in analogy to the way that the # Visual C++ _declspec(dllexport) feature does. Unfortunately, so far # any attempt to build libMx.dll.a seems to require the 10 minute wait # to create all the ds*.o files even if you are using the dllexport # attribute. Probably I do not understand how to correctly use this # feature yet, so if somebody can make this work, I would be interested # in hearing about it. # BUILD_LIBMX_DLL = yes # #======================================================================== # # Generally, you should not have to modify anything after this point. # # # gcc specific flags # GCCFLAGS = -Wall -Werror \ -Wstrict-prototypes \ -Wpointer-arith \ -Wcast-align \ -Wcast-qual \ -Wshadow \ -Wmissing-prototypes \ -Wnested-externs \ -Winline # Intel x86 with Cygwin 1.3.2 under Microsoft Win32. # CC = gcc CFLAGS = -g -O $(GCCFLAGS) $(INCLUDES) \ -DOS_CYGWIN $(EXTRA_FLAGS) -DDEBUG CFLAGS_EPICS = $(CFLAGS) -Wno-strict-prototypes # Special cases for individual files. CFLAGS_MX_EPICS = $(CFLAGS_EPICS) -Wno-cast-qual 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 MAKEDEPEND = gcc -MM $(CFLAGS) $(READLINE_INCLUDES) \ *.c > 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 += ../tools/xdr_hyper.o # #--------------------------------------------------- # RM = rm -f MAKE = make OBJ = o EXEOUT = -o DOTEXE = # #--------------------------------------------------- # 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.a MX_LIBRARY_STATIC_NAME = $(MX_LIBRARY_NAME) MX_LIBRARY_DELETE = $(RM) libMx* $(MX_LIBRARY_NAME): $(MX_LIB_OBJS) -$(MX_LIBRARY_DELETE) ar rcs libMx.a $(MX_LIB_OBJS) ranlib libMx.a # # The following, if enabled, takes a very long time to complete. # ifeq ($(BUILD_LIBMX_DLL),yes) dllwrap --verbose -o libMx.dll --export-all-symbols \ --output-lib libMx.dll.a $(MX_LIB_OBJS) $(LIBRARIES) endif 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 install -m 644 mx*.h $(MX_INSTALL_DIR)/include install -m 644 $(MX_LIBRARY_NAME) $(MX_INSTALL_DIR)/lib touch $(MX_INSTALL_DIR)/etc/motor.dat touch $(MX_INSTALL_DIR)/etc/scan.dat install -m 755 ../plotgnu/plotgnu.pl $(MX_INSTALL_DIR)/bin install -m 755 ../plotgnu/showdata $(MX_INSTALL_DIR)/bin/showdata.pl install -m 755 ../plotgnu/showplot $(MX_INSTALL_DIR)/bin/showplot.pl install -m 755 ../plotgnu/plot2ps $(MX_INSTALL_DIR)/bin/plot2ps.pl ifeq ($(BUILD_LIBMX_DLL),yes) install -m 755 libMx.dll $(MX_INSTALL_DIR)/bin install -m 644 libMx.dll.a $(MX_INSTALL_DIR)/lib endif # #--------------------------------------------------- # MOTOR_NAME = motor.static MOTOR_NAME2 = motor.shared $(MOTOR_NAME): $(MOTOR_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(MOTOR_NAME) $(MOTOR_OBJS) \ $(LIB_DIRS) ../libMx/libMx.a $(LIBRARIES) -lreadline ifeq ($(BUILD_LIBMX_DLL),yes) $(CC) $(CFLAGS) -o $(MOTOR_NAME2) $(MOTOR_OBJS) \ $(LIB_DIRS) -lMx $(LIBRARIES) -lreadline endif motor_install: ifeq ($(BUILD_LIBMX_DLL),yes) install -m 755 $(MOTOR_NAME2) $(MX_INSTALL_DIR)/bin endif install -m 755 $(MOTOR_NAME) $(MX_INSTALL_DIR)/bin install -m 755 ../scripts/motor $(MX_INSTALL_DIR)/bin # #--------------------------------------------------- # SERVER_NAME = mxserver $(SERVER_NAME): $(SERVER_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(SERVER_NAME) $(SERVER_OBJS) \ $(LIB_DIRS) -lMx $(LIBRARIES) server_install: install -m 755 $(SERVER_NAME) $(MX_INSTALL_DIR)/sbin install -m 755 ../scripts/startmxserver $(MX_INSTALL_DIR)/sbin install -m 755 ../scripts/mx $(MX_INSTALL_DIR)/sbin touch $(MX_INSTALL_DIR)/etc/mxserver.dat touch $(MX_INSTALL_DIR)/etc/mxserver.acl # #--------------------------------------------------- # UPDATE_NAME = mxupdate $(UPDATE_NAME): $(UPDATE_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(UPDATE_NAME) $(UPDATE_OBJS) \ $(LIB_DIRS) -lMx $(LIBRARIES) update_install: install -m 755 $(UPDATE_NAME) $(MX_INSTALL_DIR)/sbin install -m 755 ../scripts/startmxupdate $(MX_INSTALL_DIR)/sbin touch $(MX_INSTALL_DIR)/etc/mxupdate.dat # #--------------------------------------------------- # MXDRIVERINFO_NAME = mxdriverinfo $(MXDRIVERINFO_NAME): $(MXDRIVERINFO_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(MXDRIVERINFO_NAME) \ $(MXDRIVERINFO_OBJS) $(LIB_DIRS) ../libMx/libMx.a $(LIBRARIES) MXSERIAL_NAME = mxserial $(MXSERIAL_NAME): mxserial.o $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(MXSERIAL_NAME) mxserial.o \ $(LIB_DIRS) -lMx $(LIBRARIES) mxserial.o: mxserial_fork.c $(CC) $(CFLAGS) -c mxserial_fork.c -o mxserial.o util_install: install -m 755 $(MXDRIVERINFO_NAME) $(MX_INSTALL_DIR)/bin install -m 755 $(MXSERIAL_NAME) $(MX_INSTALL_DIR)/bin