# # Name: Makehead.djgpp # # Purpose: This file is used to customize operating system and installation # dependent features of the MX makefiles. This version is customized # for DJGPP 2.0.3 under a DOS extender using WATT32 for TCP/IP # support. # # Please note that you should use Watt32 version 2.1 dev.4 or newer. # That is the first version of Watt32 that can build a successfully # working version of mxserver.exe, since older versions did not handle # non-blocking sockets correctly. # # DJGPP may be found at http://www.delorie.com/djgpp/ # Watt32 may be found at http://www.bgnett.no/~giva/ # # WARNING: The source code for MX has many files that are longer than the # 8.3 filenames accepted by MSDOS. This means that MX for DJGPP # can only be compiled if long filename (LFN) support is available # at compilation time. Ideally, one would set this up to run under # FreeDOS or MSDOS directly. However, I have not been able to get # either of the available LFN packages for DOS, that is, DOSLFN or # LFNDOS, to work well enough to successfully compile MX. Instead, # I currently compile DJGPP versions of MX in a Windows 98 DOS # command window, which _does_ support LFN. I gather that Windows # 2000 DOS command windows work as well, but I have not tried this. # # 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) $(WATT32_LIB_DIRS) LIBRARIES = $(WATT32_LIBRARIES) -lreadline -lm MX_DRIVER_SRCS += i_dos_com.c i_dos_portio.c i_fossil.c WATT32_DIR = c:/watt32 #WATT32_DIR = c:/users/lavender/watt32 WATT32_INCLUDES = -I$(WATT32_DIR)/inc WATT32_LIB_DIRS = -L$(WATT32_DIR)/lib WATT32_LIBRARIES = -lwatt # #======================================================================== # # Generally, you should not have to modify anything after this point. # # # gcc specific flags # GCCFLAGS = -Wall -Werror \ -Wpointer-arith \ -Wcast-align \ -Wcast-qual \ -Wshadow \ -Wstrict-prototypes \ -Wmissing-prototypes \ -Wnested-externs \ -Winline # Intel x86 with DJGPP 2.0.3 for FreeDOS or MSDOS # CC = gcc CFLAGS = -g -O $(GCCFLAGS) $(INCLUDES) $(WATT32_INCLUDES) \ -DOS_DJGPP $(EXTRA_FLAGS) -DDEBUG # Special cases for individual files. CFLAGS_MX_VERS = -DOS_DJGPP -DMX_MAJOR_VERSION=$(MX_MAJOR_VERSION) \ -DMX_MINOR_VERSION=$(MX_MINOR_VERSION) \ -DMX_UPDATE_VERSION=$(MX_UPDATE_VERSION) \ -DMX_BRANCH_LABEL="\"$(MX_BRANCH_LABEL)\"" COMPILE = $(CC) -c DEFINE = -D MAKEDEPEND = gcc -MM $(CFLAGS) $(READLINE_INCLUDES) \ *.c > Makefile.depend MAKEDEPEND_CLEAN = rm Makefile.depend # #--------------------------------------------------- # # Declare bundled programs to be MX "applications". # One of the consequences of this is that mx_poison.h # is applied to them. # APP_FLAGS=$(DEFINE)__MX_APP__ # #--------------------------------------------------- # 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)) AUTOSAVE_OBJS = $(AUTOSAVE_SRCS:.c=.$(OBJ)) MXDRIVERINFO_OBJS = $(MXDRIVERINFO_SRCS:.c=.$(OBJ)) MXMONITOR_OBJS = $(MXMONITOR_SRCS:.c=.o) #---- MX_LIB_OBJS += ../tools/strlcpy.o ../tools/strlcat.o MX_LIB_OBJS += ../tools/strptime.o MX_LIB_OBJS += ../tools/xdr.o ../tools/xdr_hyper.o # #--------------------------------------------------- # RM = rm -f MAKE = make TOUCH = touch -a OBJ = o EXEOUT = -o DOTEXE = .exe # #--------------------------------------------------- # 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) $(MX_LIBRARY_NAME) $(MX_LIBRARY_NAME): $(MX_LIB_OBJS) $(EXTRA_LIB_OBJS) -$(MX_LIBRARY_DELETE) ar rcs libMx.a $(MX_LIB_OBJS) $(EXTRA_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 libMx.a $(MX_INSTALL_DIR)/lib cp ../tools/mx_config $(MX_INSTALL_DIR)/bin touch /c $(MX_INSTALL_DIR)/etc/mxmotor.dat touch /c $(MX_INSTALL_DIR)/etc/mxscan.dat mx_list_head.$(OBJ): Makefile.version mx_list_head.c mx_version.h $(COMPILE) $(CFLAGS) -DMX_CFLAGS="${CFLAGS}" mx_list_head.c # #--------------------------------------------------- # MOTOR_NAME = mxmotor.exe $(MOTOR_NAME): $(MOTOR_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(MOTOR_NAME) $(MOTOR_OBJS) \ $(LIB_DIRS) -lMx $(LIBRARIES) motor_install: cp $(MOTOR_NAME) $(MX_INSTALL_DIR)/bin # #--------------------------------------------------- # SERVER_NAME = mxserver.exe $(SERVER_NAME): $(SERVER_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(SERVER_NAME) $(SERVER_OBJS) \ $(LIB_DIRS) -lMx $(LIBRARIES) server_install: cp $(SERVER_NAME) $(MX_INSTALL_DIR)/sbin cp ../scripts/mx.bat $(MX_INSTALL_DIR)/sbin touch /c $(MX_INSTALL_DIR)/etc/mxserver.dat touch /c $(MX_INSTALL_DIR)/etc/mxserver.acl # #--------------------------------------------------- # AUTOSAVE_NAME = mxautosave.exe $(AUTOSAVE_NAME): $(AUTOSAVE_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(AUTOSAVE_NAME) $(AUTOSAVE_OBJS) \ $(LIB_DIRS) -lMx $(LIBRARIES) autosave_install: cp $(AUTOSAVE_NAME) $(MX_INSTALL_DIR)/sbin touch /c $(MX_INSTALL_DIR)/etc/mxautosave.dat # #--------------------------------------------------- # MXDRIVERINFO_NAME = mxdriverinfo.exe $(MXDRIVERINFO_NAME): $(MXDRIVERINFO_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(MXDRIVERINFO_NAME) \ $(MXDRIVERINFO_OBJS) $(LIB_DIRS) -lMx $(LIBRARIES) #--- MXMONITOR_NAME = mxmonitor $(MXMONITOR_NAME): $(MXMONITOR_OBJS) $(MX_LIBRARY_PATH) $(CC) $(CFLAGS) -o $(MXMONITOR_NAME) \ $(MXMONITOR_OBJS) $(LIB_DIRS) -lMx $(LIBRARIES) #--- util_install: cp $(MXDRIVERINFO_NAME) $(MX_INSTALL_DIR)/bin cp $(MXMONITOR_NAME) $(MX_INSTALL_DIR)/bin