# # Name: Makehead.qnx # # Purpose: This file is used to customize operating system and installation # dependent features of the MX makefiles. This version is customized # for QNX Neutrino 6.x # # 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) LIB_DIRS = -L$(MX_LIB_DIR) LIBRARIES = -lrpc -lsocket -lm # # Motor will be linked with the bundled copy of 'editline' if you use the # following definitions. # READLINE_LIB_DIRS = READLINE_LIBRARIES = ../tools/unix/src/editline/libedit.a #READLINE_LIB_DIRS = -L../tools/unix/src/editline #READLINE_LIBRARIES = -ledit # # If you prefer to link motor to GNU Readline instead, uncomment the # following definitions. # #READLINE_LIB_DIRS = -L/usr/local/lib #READLINE_LIBRARIES = -lreadline -lcurses # #======================================================================== # # Generally, you should not have to modify anything after this point. # # # gcc specific flags # GCCFLAGS = -Wall -Werror \ -Wpointer-arith \ -Wcast-align \ -Wcast-qual \ -Wmissing-prototypes \ -Wnested-externs \ -Winline # # Intel x86 with GCC version 2.95.3 under QNX Neutrino 6.2 # CC = gcc CFLAGS = -g -O -fPIC $(GCCFLAGS) $(INCLUDES) -DOS_QNX \ $(EXTRA_FLAGS) -DDEBUG CFLAGS_EPICS = $(CFLAGS) -Wno-strict-prototypes -Wno-shadow # 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) CFLAGS_MAKEDEPEND = $(CFLAGS) $(READLINE_INCLUDES) COMPILE = $(CC) -c DEFINE = -D MAKEDEPEND = gcc -MM $(CFLAGS_MAKEDEPEND) *.c > Makefile.depend MAKEDEPEND_CLEAN = cp /dev/null Makefile.depend # #--------------------------------------------------- # # 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)) # #--------------------------------------------------- # RM = rm -f MAKE = make OBJ = o # #--------------------------------------------------- # 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.so.$(MX_MAJOR_VERSION) MX_LIBRARY_DELETE = rm $(MX_LIBRARY_NAME) libMx.so libMx.a $(MX_LIBRARY_NAME): $(MX_LIB_OBJS) -$(MX_LIBRARY_DELETE) gcc -shared -o $(MX_LIBRARY_NAME) \ $(LIB_DIRS) $(MX_LIB_OBJS) $(LIBRARIES) ln -sf $(MX_LIBRARY_NAME) libMx.so ar rc libMx.a $(MX_LIB_OBJS) ranlib libMx.a 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 ln -sf $(MX_LIBRARY_NAME) $(MX_INSTALL_DIR)/lib/libMx.so cp libMx.a $(MX_INSTALL_DIR)/lib 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 cp ../plotgnu/showplot $(MX_INSTALL_DIR)/bin cp ../plotgnu/plot2ps $(MX_INSTALL_DIR)/bin # #--------------------------------------------------- # MOTOR_NAME = motor.shared MOTOR_NAME2 = motor.static $(MOTOR_NAME): $(MOTOR_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(MOTOR_NAME) $(MOTOR_OBJS) \ $(LIB_DIRS) $(READLINE_LIB_DIRS) \ -lMx $(LIBRARIES) $(READLINE_LIBRARIES) $(CC) $(CFLAGS) -o $(MOTOR_NAME2) $(MOTOR_OBJS) \ $(LIB_DIRS) $(READLINE_LIB_DIRS) \ ../libMx/libMx.a $(LIBRARIES) $(READLINE_LIBRARIES) motor_install: cp $(MOTOR_NAME) $(MX_INSTALL_DIR)/bin cp $(MOTOR_NAME2) $(MX_INSTALL_DIR)/bin cp ../scripts/motor $(MX_INSTALL_DIR)/bin cp ../scripts/motor_xterm $(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: cp ../scripts/whoami $(MX_INSTALL_DIR)/bin cp $(SERVER_NAME) $(MX_INSTALL_DIR)/sbin cp ../scripts/startmxserver $(MX_INSTALL_DIR)/sbin cp ../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: cp $(UPDATE_NAME) $(MX_INSTALL_DIR)/sbin cp ../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) -lMx $(LIBRARIES) mxdriverinfo_install: cp $(MXDRIVERINFO_NAME) $(MX_INSTALL_DIR)/bin # #--------------------------------------------------- # # Somehow, GCC miscompiles d_scipe_amplifier.c if optimization # is turned on, so we must compile it with optimization turned off. # d_scipe_amplifier.$(OBJ): $(COMPILE) $(CFLAGS) -O0 d_scipe_amplifier.c # # va_start(args, format) generates a warning that the const qualifier is # being discarded for argument 'format'. There does not seem to be a quick # way of getting around this, so for now we just allow the warning to happen. # mx_hrt_debug.$(OBJ): $(COMPILE) $(CFLAGS) -Wno-error mx_hrt_debug.c