DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: M T

⟦fd5c85bff⟧ TextFile

    Length: 12650 (0x316a)
    Types: TextFile
    Names: »Makefile«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Cchess/Makefile« 

TextFile

# Cchess Version 1.00
#
# (C) Copyright - Jan D. Wolter - Dec 1987.
#
# INTRODUCTION
# Cchess is a corrispondence chess program.  It doesn't play chess, it only
# moderates games between human players.  A transcript of the game to date
# is saved in a file in a private directory.  Each time a player makes a
# move, the other player is notified via system mail.  There are options
# to play several variant games, to watch replays, and to print transcripts.
#
# This program has been written to be as portable as possible without
# compromising on plain out-right fanciness.  Configuration is supposed to
# be done mainly by defining a suitable subset of the following flags.  For
# very non-standard systems it may be necessary to make changes to the code,
# primarily in the sys.c file, but I hope not.  I have expended quite a bit
# of trouble trying to make this as simple to port as possible.
#
# CCHESS INSTALLATION INSTRUCTIONS:
# (1) Read the contents of this file to determine what definitions should be
#     used for your system.  It's not as hard as the size of this file tends
#     to suggest.  There are sample definitions for several systems where
#     cchess has been run further below.  Put your defines in with them.
# (2) Compile cchess with the "make cchess" command.
# (3) Create the chess transcript directory whose name is given by the
#     CCDIR definition.  This should be owned by the same uid that will
#     own the cchess program, and should be permitted "drwx------" (i.e.
#     to the owner only).
# (4) Move the compiled cchess program to the place given in RUN_CMD, and
#     make sure that it is permitted "-rws--x--x".
# (5) Read the directions below to decide what you want to do about installing
#     the ccreap utility, if anything.
#     
# CCREAP NOTES
#
# WARNING:  Ccreap is still somewhat experimental in this release.  Bugs are
# likely.  Use at your own risk.
#
# Ccreap is a program which can be run to remind users to move in old games,
# and finally delete the games if they have been abandoned long enough.  It
# also deletes games involving user id's that no longer exist on the system.
# If your system has plenty of disk space or few cchess players, you may opt
# to dispense with ccreap entirely.  Ideally a cron table entry should be
# made to run ccreap once a day (though running it as root is only a good idea
# if you trust whoever owns the ccreap file a lot).  If this is impractical,
# ccreap can be run manually by the person administering cchess.  Running it
# more often than once a day will do neither harm nor good.  Running it less
# often may lengthen the time between reminders.  Ccreap normally generates
# no output, so putting the command "/usr/games/lib/ccreap &" in your .login
# or .profile file may be convenient.   Letting ccreap be run by other users
# would have the disadvantage that the mail it sends appears to come from
# whatever person ran the program, which tends to cause confusion.  In any
# case, if ccreap is to be run by anyone other than root or the account that
# owns cchess, it should have it's suid bit set.
#
# As distributed, ccreap will send a reminder message if 4 days have elapsed
# with no move made.  7 days later, it will send another.  Then 7 days later
# it sends a warning to both players that the game will be deleted in 5 days.
# If 5 days later there has still been no move made, it deletes the game.
# To alter this schedule, see the comments at the beginning of reap.c.
#
# CCHESS CONFIGURATION DEFINITIONS
# All three of the following must be defined for cchess to compile:
#
#   CCDIR	A string giving the full pathname to the cchess transcript
#		directory.  This is where cchess keeps its game files.
#		Cchess should have full access.  Other folks should have
#		neither read nor write access.
#
#   GAME_LIST	A string giving the full pathname to the cchess scorefile.
#		This is where a perminant record of the outcome of all
#		games is kept.  Normally it is inside the CCDIR, but you
#		can put it anywhere you please.  Cchess should have read/
#		write access.  Other folks should not have write access.
#
#   RUN_CMD	A string giving the command a user should type to run
#		the cchess program.  This is used in the mail messages
#		sent by cchess to tell the recipient how to respond.  If
#		cchess is being installed in a directory in the normal path
#		this should just be "cchess".  Otherwise, it should the the
#		full path to the binary.
#
# One of the next six should be defined, depending on the version of Unix you
# are running:
#
#   U43BSD	Define this for Unix 4.3bsd.  Signal handling is done with
#		the sigvec system.  Sigvec would include signal(),
#		sigblock(), and sigsetmask().  This also indicates that
#		directories have the fancier 4.3bsd format, and that the
#		gettimeofday() call should be used instead of time().  The
#		default MAILER is the /usr/lib/sendmail program.  The default
#		tty interface is TSTTY (see below), though TIOCTL could also
#		be used.  Window sizes are obtained from the kernal instead of
#		termcaps and the screen is redrawn with new size if SIGWINCH
#		is recieved.  This should be used for Suns, even if they
#		claim to be 4.2bsd.
#
#   U42BSD	Define this for Unix 4.2bsd.  Currently this has exactly
#		the same effect as the U43BSD definition, except that it
#		gets window sizes from the termcaps, not the kernel and
#		doesn't know about SIGWINCH.  Suns should use U43BSD.
#
#   U41BSD	Define this if you have Unix 4.1bsd.  If it is defined,
#		the default MAILER is /etc/delivermail program.  Also,
#		signals are handled by the sigsys library.  This would
#		include sigset(), sigrelse(), sighold(), and sigpause().
#		If this is defined, then the program should be linked
#		with the -ljobs option.  The default tty interface is TSTTY,
#		but TIOCTL can also be used (see below).  Many versions have
#		elapsed since cchess ran on a 4.1bsd system, but it should
#		still work.
#
#   USYS_5	Define this if you have Unix System V or a better Bell Unix.
#		If it is defined, the routine to find a character in a
#		string is called strchr() instead of index().  Signals are
#		handled with the signal() call, and the default MAILER is
#		/bin/mail.  The default tty interface is TTERMIO (see below).
#		The dup2() call is replaced with an fcntl() call.  If you
#		have SCO Xenix, also define SCO (see below).
#
#   USYS_3	Define this if you have Unix System III.  Signals are handled
#		with the signal() call and the default MAILER is /bin/mail.
#		The default tty interface is TSTTY (see below), but TTERMIO
#		can also be used.  USYS_3 is the default if none of the
#		above are defined.
#
# The following may be defined to take care of local oddities.  For normal
# systems, none of the following should be needed, since the defaults should
# work.
#
#   SCO		Define this flag for SCO Xenix system V.  It does a few
#		strange things to avoid compiler bugs that existed in the
#		Release 2.2.1 SCO.  It is unlikely to do any good for any
#		other unix.
#
#   UNCHAR	Define this flag if characters are unsigned on your machine.
#		If this is the case, shorts will be used for signed
#		characters.  Most machines don't need this.  Cchess will
#		get real confused about colors of players and what moves
#		are legal if this is needed, but not defined.  Cchess will
#		work fine if it is defined unnecessarily, but will use a
#		wee bit more memory than necessary.  It is automatically
#		set when running lint on cchess.
#
#   NOTERMCAP	Unless this is defined cchess will use the termcap library
#		to update the screen.   Most Unixes seem to have this or
#		termlib, which works equally well for the purposes of cchess.
#		Termcap contains the routines tgetent(), tgetnum(),
#		tgetflag(), tgetstr(), tgoto(), and tputs().  These normally
#		require adding the -ltermcap or -ltermlib flags to compile
#		command.  Without termcaps, cchess will still work, but nearly
#		all the fancy display handling will be lost.
#
#   MAILER	If the full pathname of the mailer is different than the
#		default described above for your version of Unix, set this
#		to the full pathname (e.g. "/usr/bin/mail").
#
#   NODUP2	If this is defined, the dup2() call is avoided.  This is the
#		default for USYS_V, where that seems to be missing.
#
#   TSTTY	If this is defined, cchess will use the call gtty() and
#		stty() to set cbreak mode and noecho.  This is the default
#		for all systems except USYS_V, where stty() has been phased
#		out in favor of the TTERMIO ioctl calls.
#
#   TTERMIO	If this is defined and TSTTY is not defined, cchess attempts
#		to set cbreak and noecho with System V style ioctl() calls.
#		This is the default for USYS_V.
#
#   TIOCTL	If this is set and neither TSTTY nor TTERMIO are, then cchess
#		attempts to set cbreak and noecho mode with version 6 style
#		ioctl() calls.  This should work with Version 6, Version 7,
#		and Berkeley unixes.
#
#   COMPAT018	Defining this includes code to allow cchess to handle game
#		files created under cchess version 0.18.  If not defined,
#		cchess will choke on such files.  You only need this if you
#		are upgrading an installation that already has a previous
#		version of cchess, and even then you may prefer to edit the
#		old files into the new format.
#
#	All externals variables are unique in the first seven characters.
#	There are several cases where the first six characters are nonunique.
#	You'll have to change these if your linker is that brain damaged.
#
#	There should be no problems for systems with short 16-bit integers.
#
#	The following option is intended only for debugging, and should not
#	be included in the installed game.
#
#   DEBUG	If DEBUG is defined cchess recognizes the -d option.  Two
#		player names must be given with the -d option.  The program
#		runs (for most purposes) as if you are the second person
#		named, playing against the first person named.  Mail is sent
#		to the person whose name DEBUG is set to.
#
#---------------------------------------------------------------------------
# The following are sample definitions.  It should be noted that some are
# largely fictional, since I don't have much access to some of these.  Make
# a copy of the one nearest your system, delete the #'s and change the
# CCDIR, GAME_LIST, and RUN_CMD to something appropriate.
#
# Unix System III.  Altos 68000.  (short integers)
#LIBS   = -ltermcap
#CFLAGS = -DRUN_CMD='"cchess"'\
#         -DGAME_LIST='"/usr/games/lib/chessboard/gamelist"'\
#         -DCCDIR='"/usr/games/lib/chessboard"'\
#         -DUSYS_3
#
# Unix 4.1bsd.  Vax 11/780.
#LIBS   = -ltermcap -ljobs
#CFLAGS = -DRUN_CMD='"cchess"'\
#         -DGAME_LIST='"/usr/games/lib/chessboard/gamelist"'\
#         -DCCDIR='"/usr/games/lib/chessboard"'\
#         -DU41BSD
#
# Unix 4.2bsd.  Vax 11/780.  (for Suns, use 4.3bsd definition)
#LIBS   = -ltermcap
#CFLAGS = -DRUN_CMD='"\~janc/bin/cchess"'\
#         -DGAME_LIST='"/e/janc/bin/src/cchess/boards/gamelist"'\
#         -DCCDIR='"/e/janc/bin/src/cchess/boards"'\
#         -DU42BSD
#
# Unix 4.3bsd.  Vax 11/780.  (or Sun 3/50 running 4.2bsd)
#LIBS   = -ltermcap
#CFLAGS = -DRUN_CMD='"\~janc/bin/cchess"'\
#         -DGAME_LIST='"/n/logan/u/janc/bin/src/cchess/boards/gamelist"'\
#         -DCCDIR='"/n/logan/u/janc/bin/src/cchess/boards"'\
#         -DU43BSD
#
# IBM PC/AT running SCO Xenix System V Rel 2.2.1.  Uses Large Memory Model.
#LIBS   = -ltermcap
#CFLAGS = -Ml\
#         -DRUN_CMD='"/u/guest/janc/cchess"'\
#         -DGAME_LIST='"/u/guest/janc/Cchess/boards/gamelist"'\
#         -DCCDIR='"/u/guest/janc/Cchess/boards"'\
#         -DMAILER='"/usr/bin/mail"'\
#         -DUSYS_5\
#         -DSCO
#
# IBM PC/AT running Microport System V.  Uses Large Memory Model.
#     Thanks to John Sucilla for this.
#LIBS   = -lcurses
#CFLAGS = -Ml\
#         -DRUN_CMD='"/usr/lbin/cchess"'\
#         -DGAME_LIST='"/usr/lbin/Cchess/boards/gamelist"'\
#         -DCCDIR='"/usr/lbin/Cchess/boards"'\
#         -DUSYS_5
#

OBJ = main.o cmd.o init.o play.o misc.o scrn.o sys.o
SRC = main.c cmd.c init.c play.c misc.c scrn.c sys.c 

# NOTE:  If the make command gives an error message about missing separators
# in the following lines, it may be because the tabs have gotten expanded into
# spaces during file transfer.  Turn them back into tabs to fix this.

cchess:	$(OBJ)
	cc $(CFLAGS) -o cchess $(OBJ) $(LIBS)
	chmod 4711 cchess

ccreap: reap.o
	cc -o ccreap reap.o $(LIBS)
	chmod 4711 ccreap

tags: $(SRC) cchess.h def.h
	ctags $(SRC) cchess.h def.h

lint:
	lint -cha $(CFLAGS) $(SRC) $(LIBS)

cchess.doc: cchess.6
	nroff -man cchess.6 | uniq > cchess.doc