!==========================================================================
! MMS description file for VMS-fsp V2.6.5jt.7              11 February 1993
!==========================================================================
!
! 27 Dec 92  Original by S.A.Pechler, <S.A.Pechler@bdk.tue.nl>
!  3 Jan 93  Modified for version V2.6.5
! 28 Jan 93  Modified for version V2.6.5jt.3
! 11 Feb 93  Modified for version V2.6.5jt.7
!  5 Mar 93  Modified for version V2.6.5jt.8

! To build the VMS-FSP clients
! ----------------------------
! For UCX:      mms /MACRO=(UCX=1)
! For Multinet: mms /MACRO=(MUL=1)
! For Multinet without ucx$ipc library: mms /MACRO=(LIB=1)
! (One-time users will find it easier to use the MAKE_CLIENT.COM command
! file, which generates the client software.  Just type "@MAKE_CLIENT" .)

! To build the VMS-FSP server
! ---------------------------
! For UCX:	mms server /MACRO=(UCX=1)
! For Multinet: mms server /MACRO=(MUL=1)
! For Multinet without ucx$ipc library: mms server /MACRO=(LIB=1)
! (One-time users will find it easier to use the MAKE_SERVER.COM command
! file, which generates the server software.  Just type "@MAKE_SERVER" .)

! To build the fsp-server without shared libraries,
!	mms noshare

! To delete unnecessary .OBJ files,
!	mms clean

! There's no mms-makefile for the merge files, use MAKE_MERGE.COM instead.

!============================================================================
! This is where you want to install the binary (only when using the
! 'install' option).
!
BIN=pool:[bdaasp]

!============================================================================
! If you want to provide FSP service, this should be set to the working
! directory of the FSP server.
!
DEF_FSP_HOME=pool:[bdaasp]

!============================================================================
! If you are going to use the logging option, you can specify a default
! file to recieve the log output here, and then just specify -l on the 
! command line.
!
DEF_FSP_LOG=pool:[bdaasp]logfile.fsp

!============================================================================
! If the server is to run on a machine with file name length limit, set the
! following variable to the length.  Otherwise, set it to something big.
!
FILE_NAME_LIMIT=99999

!============================================================================
! If you want to provide FSP service, this should be set to the UDP socket
! port number the FSP server should use.
!
DEF_FSP_PORT=21

!============================================================================
! The following defines the maximum number of files to be cached. On VMS
! systems the opening/closing of files use a lot of CPU-time. You can enter
! the maximum number of files that can stay open during runtime. When the
! cache is full, the 'oldest' file will be closed again before the new one
! is opened. The minimum number of files to be cached is 1.
MAX_FILE_CACHE=30

!============================================================================
! FSP servers normally keep a directory listing file in each directory it
! exports.  In situation where this is not appropriate, FSP can store the
! listing in another directory instead.  DEF_DIRECTORY_CACHE should contain
! a directory where such a listing is to be placed.  The path is relative
! to DEF_FSP_HOME unless it starts with a '/'.  FSP server also uses this
! directory to hold temporary files during upload, so this variable must
! refer to a valid directory even if all subdirectories are writable by
! the fspd process.

DEF_DIRECTORY_CACHE=pool:[bdaasp.cache]

!============================================================================
! MAX_DIR_CACHE_COUNT should contain the number of listings to be cached in
! DEF_DIRECTORY_CACHE.  The number should be a power of 2.

MAX_DIR_CACHE_COUNT=32

!============================================================================
! ALWAYS_USE_CACHE_DIR should be 1 if you want it used as the default way to
! store directory listing files.  (Note, .FSP_CONTENT files will still be
! used if they alreay exist.

ALWAYS_USE_CACHE_DIR=0

!============================================================================
! This is where the version number string comes from:
!
VERSION_STR="VMS-FSP Caltech version 2.6.6.5, April 19 1993"

!============================================================================
! Set the following to 1 if you wish the server to fork into the background
! after startup (not yet tested on VMS!).
!
DAEMONIZE = 0

!============================================================================
! VMS has no lockf or flock functions, so don't use them.
!
LOCK_FLAGS= /def=(NOLOCKING)

!============================================================================
! If you wish your clients to time out while not in the middle of a transfer
! uncomment the following line.  Read the ChangeLog file for version 2.6.5jt7
! for details.
!CLIENT_TIMEOUT= /def=(CLIENT_TIMEOUT)

!============================================================================
! The following variable defines the compiler to use in your compilation.
!
CC = cc
!CC=gcc

!============================================================================
! Flags for the compiler.
!
.IFDEF DEBUG
CFLAGS = /def=(DIRENT=1,DEBUG=1,FSP_FILE_CACHE=$(MAX_FILE_CACHE)) \
         /include=('F$ENVIRONMENT("DEFAULT")') /object=$*.obj
.ELSE
CFLAGS = /nodebug /def=(DIRENT=1,FSP_FILE_CACHE=$(MAX_FILE_CACHE)) \
         /include=('F$ENVIRONMENT("DEFAULT")') /object=$*.obj
.ENDIF

!============================================================================
!  Linker command
!
LD = link

.IFDEF DEBUG
LDFLAGS = 
.ELSE
LDFLAGS = /notrace
.ENDIF

.IFDEF UCX
LDLIB = [.vms]ucxshare.opt
.ELSE
.IFDEF LIB
LDLIB = [.vms]libshare.opt
.ELSE
LDLIB = [.vms]mulshare.opt
.ENDIF
.ENDIF

EXE =
O = .obj;

SERVER     = fspd.exe

CLIENTS    = flscmd.exe, fcdcmd.exe, fgetcmd.exe, frmcmd.exe, frmdircmd.exe,\
             fprocmd.exe, fmkdir.exe, fput.exe, fver.exe, fcatcmd.exe,\
             fgrabcmd.exe

ICLIENTS   = $(BIN)flscmd.exe, $(BIN)fcdcmd.exe, $(BIN)fgetcmd.exe, \
             $(BIN)frmcmd.exe, $(BIN)frmdircmd.exe, $(BIN)fprocmd.exe, \
             $(BIN)fmkdir.exe, $(BIN)fput.exe, $(BIN)fver.exe, \
             $(BIN)fcatcmd.exe, $(BIN)fgrabcmd.exe

SERVER_OBJ = server_main$(O), server_lib$(O), server_host$(O), udp_io$(O), \
             server_file$(O), filecache$(O), [.vms_src]miscvms$(O), \
             [.vms_src]convpath$(O),[.vms_src]vmsreaddir$(O), \
             [.bsd_src]random$(O)

CLIENT_OBJ = client_lib$(O), udp_io$(O), client_util$(O), client_lock$(O)

GLOB_OBJ   = [.bsd_src]glob$(O)

UTIL_LS_OBJ = [.bsd_src]cmp$(O), [.bsd_src]ls$(O), [.bsd_src]print$(O), \
              [.bsd_src]util$(O), [.vms_src]getopt$(O), $(GLOB_OBJ)

MISC_OBJ    = [.vms_src]miscvms$(O),[.vms_src]getopt$(O),[.vms_src]convpath$(O)

LDFLAGS2 =

default	:	init $(CLIENTS)
	@	!	Do nothing.
install :	init $(ICLIENTS)
	@	!	Do nothing.
server  :	init $(SERVER)
	@	!	Do nothing.

init     :      !descrip.mms
.IFDEF UCX
            $def/nolog sys sys$library
            $def/nolog netinet sys$library
.ELSE
            $def/nolog sys multinet_root:[multinet.include.sys]
            $def/nolog netinet multinet_root:[multinet.include.netinet]
.ENDIF

fspd.exe :	$(SERVER_OBJ)
	$(LD) /exe=FSPD.EXE $(LDFLAGS) $(SERVER_OBJ), $(LDLIB)/options

flscmd.exe :	flscmd$(O), $(CLIENT_OBJ), $(UTIL_LS_OBJ)
	$(LD) $(LDFLAGS) flscmd$(O), $(CLIENT_OBJ), $(UTIL_LS_OBJ), \
                $(LDLIB)/options

fcdcmd.exe :	fcdcmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ)
	$(LD) $(LDFLAGS) fcdcmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ), \
                $(LDLIB)/options

fgetcmd.exe :	fgetcmd$(O), $(CLIENT_OBJ), $(MISC_OBJ), $(GLOB_OBJ)
	$(LD) $(LDFLAGS) fgetcmd$(O), $(CLIENT_OBJ), $(MISC_OBJ), \
              $(GLOB_OBJ), $(LDLIB)/options

frmcmd.exe :	frmcmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ)
	$(LD) $(LDFLAGS) frmcmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ), \
                $(LDLIB)/options

frmdircmd.exe :	frmdircmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ)
	$(LD) $(LDFLAGS) frmdircmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ), \
                $(LDLIB)/options

fprocmd.exe :	fprocmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ)
	$(LD) $(LDFLAGS) fprocmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ), \
                $(LDLIB)/options

fmkdir.exe :	fmkdir$(O), $(CLIENT_OBJ)
	$(LD) $(LDFLAGS) fmkdir$(O), $(CLIENT_OBJ), \
                $(LDLIB)/options

fput.exe :	fput$(O), $(CLIENT_OBJ)
	$(LD) $(LDFLAGS) fput$(O), $(CLIENT_OBJ), \
                $(LDLIB)/options

fver.exe :	fver$(O), $(CLIENT_OBJ)
	$(LD) $(LDFLAGS) fver$(O), $(CLIENT_OBJ), \
                $(LDLIB)/options

fcatcmd.exe :	fcatcmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ)
	$(LD) $(LDFLAGS) fcatcmd$(O), $(CLIENT_OBJ), $(GLOB_OBJ), \
                $(LDLIB)/options

fgrabcmd.exe :	fgrabcmd$(O), $(CLIENT_OBJ), $(MISC_OBJ), $(GLOB_OBJ)
	$(LD) $(LDFLAGS) fgrabcmd$(O), $(CLIENT_OBJ), $(MISC_OBJ), \
              $(GLOB_OBJ), $(LDLIB)/options

noshare :	$(SERVER_OBJ)
	$(LD) $(LDFLAGS) $(SERVER_OBJ), \
		sys$library:vaxcrtl.olb/library $(LDFLAGS2)

clean :
	delete $(SERVER_OBJ), $(CLIENT_OBJ), $(GLOB_OBJ), $(UTIL_LS_OBJ)
        ! you may want to change this to 'delete *.obj;*'

server_main$(O) :   server_main.c server_def.h descrip.mms
	      $(CC)  /define=(DEF_FSP_PORT=$(DEF_FSP_PORT), \
		              DEF_FSP_HOME="""$(DEF_FSP_HOME)""", \
	                      DEF_FSP_LOG="""$(DEF_FSP_LOG)""", \
		              VERSION_STR=""$(VERSION_STR)"",	\
		              FILE_NAME_LIMIT=$(FILE_NAME_LIMIT), \
			      FSP_FILE_CACHE=$(MAX_FILE_CACHE), \
		              ALWAYS_USE_CACHE_DIR=$(ALWAYS_USE_CACHE_DIR), \
		              MAX_DIR_CACHE_COUNT=$(MAX_DIR_CACHE_COUNT), \
		              DEF_DIRECTORY_CACHE="""$(DEF_DIRECTORY_CACHE)""" \
                             ) server_main.c
server_lib$(O)  :   server_lib.c server_def.h
server_host$(O) :   server_host.c server_def.h
server_file$(O) :   server_file.c server_def.h descrip.mms
.IFDEF DEBUG
              $(CC) $(CFLAGS) /def=(DIRENT=1,DEBUG=1) server_file.c
.ENDIF
client_lib$(O)  :   client_lib.c client_def.h
client_util$(O) :   client_util.c client_def.h
client_lock$(O) :   client_lock.c client_def.h
              $(CC) $(CFLAGS) $(LOCK_FLAGS) client_lock.c
udp_io$(O)      :   udp_io.c common_def.h
fver$(O)        :   fver.c client_def.h
              $(CC) $(CFLAGS) /def=(VERSION_STR=""$(VERSION_STR)"") fver.c

!all other sources have default compilation rules.
