# # Name: Makehead.rtems # # Purpose: This file is used to customize operating system and installation # dependent features of the MX makefiles. This version is customized # for RTEMS. # RTEMS_MAKEFILE_PATH = /opt/rtems-4.6/i386-rtems/pc486 #RTEMS_MAKEFILE_PATH = /opt/rtems-4.6/m68k-rtems/mvme162 #RTEMS_MAKEFILE_PATH = /opt/rtems-4.6/powerpc-rtems/mvme2307 INCLUDES = $(MX_INCLUDES) LIB_DIRS = -L$(MX_LIB_DIR) LIBRARIES = -lm # # RTEMS often runs on resource constrained systems, so we define here # a list of MX drivers that only includes the actual drivers we need. # You must also edit libMx/mx_driver_rtems.c to match. # # The following is just an example. You should customize it to match # the configuration you actually need. # MX_DRIVER_RTEMS_SRCS = i_tty.c i_rtems_vme.c \ i_pdi40.c i_pdi45.c i_vme58.c i_vsc16.c i_iseries.c \ d_soft_ainput.c d_soft_aoutput.c d_soft_dinput.c d_soft_doutput.c \ d_pdi45_aio.c d_pdi45_dio.c d_iseries_aio.c d_iseries_dio.c \ d_bit.c d_vme_dio.c \ d_soft_motor.c d_pdi40.c d_stp100.c d_vme58.c d_elapsed_time.c \ d_soft_scaler.c d_vsc16_scaler.c d_vsc16_timer.c \ d_pdi45_scaler.c d_pdi45_timer.c d_soft_timer.c d_interval_timer.c \ d_soft_amplifier.c d_generic_relay.c d_blind_relay.c \ d_pdi45_pulser.c v_mathop.c # # WARNING: I am not currently sure if the following information is correct, # since my MVME162 is currently not booting with RTEMS. # # MVME162 Note: # The linker command file /opt/rtems-4.6/m68k-rtems/mvme162/lib/linkcmds, # as distributed, comes configured for 1 megabyte of RAM. This is not # enough to run MX, so you must change the specified amount of RAM to # match the actual board you have. MX has only been tested with RTEMS # on the 16 megabyte MVME162-532A, which has more than enough memory. # # The lines that need to be changed are: # # _RamSize = DEFINED(_RamSize) ? _RamSize : 1M; # # and # # ram : org = 0x000000, l = 1M # # where you must replace the 1M with the actual amount of memory you have. # For example, 16M for the MVME162-532A mentioned above. # # If you really only have 1 megabyte of RAM in your MVME162, then you # are out of luck and cannot run MX on it. # # #======================================================================== # # Generally, you should not have to modify anything after this point unless # you are adding a new board support package, where you must customize the # makefile conditionals that use RTEMS_BSP below. # include $(RTEMS_MAKEFILE_PATH)/Makefile.inc include $(RTEMS_CUSTOM) include $(PROJECT_ROOT)/make/leaf.cfg # # Define a CPP macro describing the board support package (BSP) in use # and also define any BSP specific CPP macro definitions as well. # # In general, $(RTEMS_CUSTOM) provides definitions for at least # RTEMS_BSP, RTEMS_BSP_FAMILY, RTEMS_CPU, and RTEMS_CPU_MODEL # for each board support package. # # Most BSPs actually provide even more definitions. Look in the # directory /opt/rtems-4.6/make/custom for the details. # ifeq ($(RTEMS_BSP),pc486) BSP_FLAGS = -DMX_RTEMS_BSP_PC486 MX_LIB_SRCS = mx_driver_rtems.c $(MX_CORE_SRCS) $(MX_DRIVER_RTEMS_SRCS) endif ifeq ($(RTEMS_BSP),mvme162) BSP_FLAGS = -DMX_RTEMS_BSP_MVME162 -DHAVE_RTEMS_VME MX_LIB_SRCS = mx_driver_rtems.c $(MX_CORE_SRCS) $(MX_DRIVER_RTEMS_SRCS) endif ifeq ($(RTEMS_BSP),mvme2307) BSP_FLAGS = -DMX_RTEMS_BSP_MVME2307 -DHAVE_RTEMS_VME MX_LIB_SRCS = mx_driver_rtems.c $(MX_CORE_SRCS) $(MX_DRIVER_RTEMS_SRCS) endif #------------------------------------------------------------------------ MANAGERS = io event semaphore ifeq ($(mx_directory_name),"motor") OBJS = mrtems.o $(MOTOR_OBJS) \ ../libMx/libMx.a $(LIBRARIES) else ifeq ($(mx_directory_name),"server") OBJS = ms_rtems.o $(SERVER_OBJS) \ ../libMx/libMx.a $(LIBRARIES) endif endif CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0x80000 # # gcc specific flags # GCCFLAGS = -Wall -Werror \ -Wpointer-arith \ -Wcast-align \ -Wcast-qual \ -Wnested-externs \ -Winline # The RTEMS include files are not compatible with the following warnings. # #-Wstrict-prototypes \ #-Wmissing-prototypes \ #-Wshadow \ # # RTEMS with GCC # CFLAGS = -g -O $(GCCFLAGS) -I$(RTEMS_MAKEFILE_PATH)/lib/include \ $(INCLUDES) -DOS_RTEMS \ $(EXTRA_FLAGS) -DDEBUG \ $(BSP_FLAGS) 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 = $(CC) -MM $(CFLAGS) *.c > Makefile.depend MAKEDEPEND_CLEAN = rm 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)) #---- MX_LIB_OBJS += ../tools/strlcpy.o ../tools/strlcat.o MX_LIB_OBJS += ../tools/xdr_hyper.o # #--------------------------------------------------- # RM = rm -f MAKE = make MKDIR = mkdir OBJ = o EXEOUT = -o DOTEXE = # #--------------------------------------------------- # MX_LIB_DIR = ../libMx MX_INC_DIR = $(MX_LIB_DIR) MX_INCLUDES = -I$(MX_INC_DIR) MX_LIBRARY_NAME = libMx.a MX_LIBRARY_STATIC_NAME = $(MX_LIBRARY_NAME) MX_LIBRARY_PATH = $(MX_LIB_DIR)/$(MX_LIBRARY_NAME) MX_LIBRARY_DELETE = rm $(MX_LIBRARY_NAME) $(MX_LIBRARY_NAME): $(MX_LIB_OBJS) -$(MX_LIBRARY_DELETE) ar rcs $(MX_LIBRARY_NAME) $(MX_LIB_OBJS) ranlib $(MX_LIBRARY_NAME) 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 install -m 644 libMx.a $(MX_INSTALL_DIR)/lib ( cd $(MX_INSTALL_DIR)/lib ; ln -sf $(MX_LIBRARY_NAME) $(MX_SONAME) ) ( cd $(MX_INSTALL_DIR)/lib ; ln -sf $(MX_LIBRARY_NAME) libMx.so ) 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 install -m 755 ../plotgnu/showplot $(MX_INSTALL_DIR)/bin install -m 755 ../plotgnu/plot2ps $(MX_INSTALL_DIR)/bin # #--------------------------------------------------- # MOTOR_NAME = motor.exe $(MOTOR_NAME): mrtems.o $(MOTOR_OBJS) $(MX_LIBRARY_PATH) $(LINK_FILES) $(make-exe) mrtems.o: mrtems.c $(COMPILE) $(CFLAGS) mrtems.c motor_install: install -m 755 $(MOTOR_NAME) $(MX_INSTALL_DIR)/bin # #--------------------------------------------------- # SERVER_NAME = mxserver.exe $(SERVER_NAME): ms_rtems.o $(SERVER_OBJS) $(MX_LIBRARY_PATH) $(LINK_FILES) $(make-exe) ms_rtems.o: ms_rtems.c $(COMPILE) $(CFLAGS) ms_rtems.c server_install: install -m 755 $(SERVER_NAME) $(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_install: # #--------------------------------------------------- # MXDRIVERINFO_NAME = mxdriverinfo.exe $(MXDRIVERINFO_NAME): util_install: