billr@saab.CNA.TEK.COM (Bill Randle) (07/13/89)
Submitted-by: Bill Randle <billr@saab.CNA.TEK.COM> Posting-number: Volume 7, Issue 17 Archive-name: scrabble/Patch1 Patch-To: scrabble: Volume 6, Issue 46-47 [I took the original scrabble posting and the two sets of patches that were posted to the net (diffs for MSDOS and diffs for non-ANSI C compiler) and merged them into a common set of sources. The Makefiles are set up to define things for the specific environment. -br] #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: patches01 # Wrapped by billr@saab on Wed Jul 12 10:05:38 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'patches01' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patches01'\" else echo shar: Extracting \"'patches01'\" \(40696 characters\) sed "s/^X//" >'patches01' <<'END_OF_FILE' X*** /dev/null Wed Jul 12 10:00:03 1989 X--- README2 Wed Jul 12 10:03:52 1989 X*************** X*** 0 **** X--- 1,19 ---- X+ I took the original scrabble posting and the two sets of patches X+ that were posted to the net (diffs for MSDOS and diffs for non-ANSI X+ C compiler) and merged them into a common set of sources. The X+ Makefiles are set up to define things for the specific environment. X+ X+ In the Makefile and Makefile.gcc, comment out the -DBSD define if X+ you are on System V. I haven't tried this on a System V machine, X+ so I don't what else is required over what has already been done. X+ X+ Thanks to: X+ Erik Talvola <talvola@pasteur.Berkeley.EDU> X+ for the MSDOS patches X+ Scott Boyd <scott@futures.UUCP> X+ for the patches for non-ANSI C compilers X+ -------------------------- X+ X+ -Bill Randle X+ billr@saab.CNA.TEK.COM X+ July 12, 1989 X*** /dev/null Wed Jul 12 09:45:01 1989 X--- README.PC Wed Jul 12 07:15:41 1989 X*************** X*** 0 **** X--- 1,58 ---- X+ FILES: X+ X+ README.PC This file X+ Makefile.tcc A make file for Turbo-C and Opus Make X+ X+ patch1 A file for patch(1) to patch various files in X+ the distribution Scrabble. X+ X+ util.c Replacement for original util.c X+ X+ X+ X+ This is an initial attempt to get Wayne Christopher's Scrabble program X+ running under MS-DOS. I initially attempted to use Microsoft C v5.1, but X+ soon ran into some strange bugs, which prompted me to switch over to Turbo-C. X+ After a little while, I was able to get the whole thing compiled and running X+ fine. X+ X+ To compile, you will need Turbo-C, and Bjorn Larsson's PC-Curses package. X+ Bjorn's address is: X+ X+ ...mcvax!enea!infovax!bl X+ X+ from the notes in the PC-Curses source files. I used version v1.3 of the X+ code - earlier (or later) versions may also work. X+ X+ I have included a Makefile which seems to work fairly well. I cheated in X+ creating the compilation command for scrabble.exe though - I use *.obj in X+ the command line, which will bomb if, for example, plural.obj is lying X+ around. Before you do a make, just delete any spurious obj's like this. X+ I used OpusMake from Opus Software, an excellent program - other make programs X+ may or may not work. X+ X+ Note that refresh.c from the original distribution is not needed on the X+ PC. All the diff files should be applied to the original distributed X+ sources. There is a new util.c file needed for MS-DOS, as the diffs to X+ the original Unix file were larger than the file itself. X+ X+ The only problem so far is that I can only get the program to read in a X+ dictionary of about 88K or so, which may be sufficient, but I don't have a X+ good dictionary for DOS. In testing, I just skipped about 3 out of every 4 X+ words from the one I played with on Unix, and it loaded, but a lot of good X+ words were obviously deleted by using this random deletion. Also, the Unix X+ dictionary has things like roman numerals, words such as "qs" (more than one X+ q), which aren't good Scrabble words. If anyone gets a good DOS dictionary, X+ tell me. Also, if you can up the limit that the program can read in, please X+ let me know as well. I don't have much experience with far pointers, and may X+ have used them incorrectly. X+ X+ Anyway, I hope people can get some use out of this program. It seems pretty X+ robust, and plays a decent game of Scrabble (even with the mutant wordlist). X+ Please let me know if anyone makes any improvements to the MS-DOS port. X+ X+ X+ Erik Talvola X+ X+ talvola@cory.berkeley.edu X+ ...!ucbvax!cory!talvola X*** orig/Makefile.orig Sat Apr 1 09:32:37 1989 X--- Makefile Wed Jul 12 09:26:05 1989 X*************** X*** 15,21 **** X X #---- Tool specific stuff ---- X X! DICT_DEF = -DDICT_FILE=\"dictionary\" X X PROGRAM = scrabble X X--- 15,22 ---- X X #---- Tool specific stuff ---- X X! DICT_DEF = -DDICT_FILE=\"/usr/dict/words\" X! SYS_DEF = -DUNIX -DBSD X X PROGRAM = scrabble X X*************** X*** 61,67 **** X X SPEC_INCLUDE = -I. -I../include X X! SPEC_DEFINES = $(DICT_DEF) X X MAN_SECTION = 1 X X--- 62,68 ---- X X SPEC_INCLUDE = -I. -I../include X X! SPEC_DEFINES = $(DICT_DEF) $(SYS_DEF) X X MAN_SECTION = 1 X X*************** X*** 69,75 **** X X MISC = X X! CC = gcc -W -fwritable-strings X X OPT_LIBS = $(SPEC_OPT_LIBS) X X--- 70,76 ---- X X MISC = X X! #CC = gcc -W -fwritable-strings X X OPT_LIBS = $(SPEC_OPT_LIBS) X X*************** X*** 77,93 **** X X PROF_LIBS = $(SPEC_PROF_LIBS) X X! OPT_LDFLAGS = -lcurses -ltermlib -lX -lm -O X X! DEBUG_LDFLAGS = -lcurses -ltermlib -lX -lm -g X X! PROF_LDFLAGS = -lcurses -ltermlib -lX_p -lm_p -pg X X MAN_PAGE = $(PROGRAM).$(MAN_SECTION) X X #---- State ---- X X! CFLAGS=-O -g X LIBS=$(OPT_LIBS) X LDFLAGS=$(OPT_LDFLAGS) X X--- 78,97 ---- X X PROF_LIBS = $(SPEC_PROF_LIBS) X X! #OPT_LDFLAGS = -O -lcurses -ltermlib -lX -lm X! OPT_LDFLAGS = -O -lcurses -ltermlib -lm X X! DEBUG_LDFLAGS = -g -lcurses -ltermlib -lX -lm X X! PROF_LDFLAGS = -pg -lcurses -ltermlib -lX_p -lm_p X X+ X MAN_PAGE = $(PROGRAM).$(MAN_SECTION) X X #---- State ---- X X! #CFLAGS=-O -g X! CFLAGS=-g X LIBS=$(OPT_LIBS) X LDFLAGS=$(OPT_LDFLAGS) X X*** orig/board.c.orig Sat Apr 1 09:32:39 1989 X--- board.c Wed Jul 12 07:16:29 1989 X*************** X*** 8,13 **** X--- 8,17 ---- X * X */ X X+ #ifdef MSDOS X+ typedef char bool; X+ #include <stdlib.h> X+ #endif X #include "scrabble.h" X X static char *bonus_map[] = { X*************** X*** 63,69 **** X--- 67,77 ---- X } X X for (i = POOL_SIZE - 1; i >= 0; i--) { X+ #ifdef MSDOS X+ j = rand() % (i + 1); X+ #else X j = random() % (i + 1); X+ #endif X for (k = 0; j >= 0; j -= distrib[k++]) X ; X k--; X*************** X*** 80,87 **** X--- 88,102 ---- X return (board); X } X X+ #ifdef _STDC_ X void X boardmove(board_t *board, move_t *move) X+ #else X+ void X+ boardmove(board, move) X+ board_t *board; X+ move_t *move; X+ #endif X { X int i; X X*************** X*** 101,108 **** X--- 116,129 ---- X return; X } X X+ #ifdef _STDC_ X char X pickletter(board_t *board) X+ #else X+ char X+ pickletter(board) X+ board_t *board; X+ #endif X { X if (board->numleft) X return (board->pool[--board->numleft]); X*************** X*** 115,122 **** X--- 136,150 ---- X static char lbchar[] = " `\"(<"; X static char rbchar[] = " '\")>"; X X+ #ifdef _STDC_ X void X printboard(board_t *board, FILE *fp) X+ #else X+ void X+ printboard(board,fp) X+ board_t *board; X+ FILE *fp; X+ #endif X { X int i, j; X char c; X*** orig/date.h.orig Thu Apr 6 12:36:52 1989 X--- date.h Wed Jul 12 09:26:10 1989 X*************** X*** 1,3 **** X! #define DATE "Thu Apr 6 12:36:51 PDT 1989" X #define HOST "saab" X #define USER "billr" X--- 1,3 ---- X! #define DATE "Wed Jul 12 09:26:09 PDT 1989" X #define HOST "saab" X #define USER "billr" X*** orig/dict.c.orig Sat Apr 1 09:32:39 1989 X--- dict.c Wed Jul 12 07:23:53 1989 X*************** X*** 8,23 **** X--- 8,41 ---- X * X */ X X+ #ifdef MSDOS X+ typedef char bool; X+ #endif X #include "scrabble.h" X X+ #ifdef _STDC_ X static int dicthash(char *word, int tabsize); X static void getem(word_t **wordp, char *lbuf, int place, char *opt, X int numopt, int len); X+ #else X+ static int dicthash(); X+ static void getem(); X+ #endif X X+ #ifdef MSDOS X+ static dict_t far *dictionary; X+ #else X static dict_t *dictionary; X+ #endif X X+ #ifdef _STDC_ X void X readdict(char *file) X+ #else X+ void X+ readdict(file) X+ char *file; X+ #endif X { X FILE *fp; X char buf[BSIZE], *e; X*************** X*** 31,37 **** X--- 49,59 ---- X fprintf(stderr, "Reading \"%s\" ", file); X fflush(stderr); X X+ #ifdef MSDOS X+ dictionary = (dict_t far *) util_farmalloc(sizeof (dict_t)); X+ #else X dictionary = (dict_t *) util_malloc(sizeof (dict_t)); X+ #endif X for (i = 0; i < MAX_LENGTH; i++) X for (j = 0; j < HASH_SIZE; j++) X dictionary->buckets[i][j] = NULL; X*************** X*** 88,95 **** X--- 110,123 ---- X return; X } X X+ #ifdef _STDC_ X void X writedict(char *file) X+ #else X+ void X+ writedict(file) X+ char *file; X+ #endif X { X int i, j, k = 0; X word_t *word; X*************** X*** 117,124 **** X--- 145,158 ---- X return; X } X X+ #ifdef _STDC_ X void X addword(char *word) X+ #else X+ void X+ addword(word) X+ char *word; X+ #endif X { X int key = dicthash(word, HASH_SIZE); X int len = strlen(word); X*************** X*** 144,151 **** X--- 178,191 ---- X return; X } X X+ #ifdef _STDC_ X void X remword(char *word) X+ #else X+ void X+ remword(word) X+ char *word; X+ #endif X { X int key = dicthash(word, HASH_SIZE); X int len = strlen(word); X*************** X*** 169,176 **** X--- 209,222 ---- X return; X } X X+ #ifdef _STDC_ X bool X isaword(char *poss) X+ #else X+ bool X+ isaword(poss) X+ char *poss; X+ #endif X { X word_t *word; X int len = strlen(poss); X*************** X*** 192,199 **** X--- 238,255 ---- X * up the length. X */ X X+ #ifdef _STDC_ X word_t * X getpossibles(char *opt, int numopt, char *req, int numreq, int len) X+ #else X+ word_t * X+ getpossibles(opt, numopt, req, numreq, len) X+ char *opt; X+ int numopt; X+ char *req; X+ int numreq; X+ int len; X+ #endif X { X char lbuf[SIZE]; X int i; X*************** X*** 232,239 **** X--- 288,306 ---- X return (word); X } X X+ #ifdef _STDC_ X static void X getem(word_t **wordp, char *lbuf, int place, char *opt, int numopt, int len) X+ #else X+ static void X+ getem(wordp, lbuf, place, opt, numopt, len) X+ word_t **wordp; X+ char *lbuf; X+ int place; X+ char *opt; X+ int numopt; X+ int len; X+ #endif X { X int key; X word_t *set, *ww; X*************** X*** 277,284 **** X--- 344,358 ---- X X /* A return value of -1 denotes that this is a bad word. */ X X+ #ifdef _STDC_ X static int X dicthash(char *word, int tabsize) X+ #else X+ static int X+ dicthash(word, tabsize) X+ char *word; X+ int tabsize; X+ #endif X { X int i; X unsigned long result = 0; X*** orig/move.c.orig Sat Apr 1 09:32:40 1989 X--- move.c Wed Jul 12 07:16:31 1989 X*************** X*** 8,15 **** X--- 8,19 ---- X * X */ X X+ #ifdef MSDOS X+ typedef char bool; X+ #endif X #include "scrabble.h" X X+ #ifdef _STDC_ X static void dopos(board_t *board, player_t *player, int x, int y, X bool horiz, move_t *best); X static int wordpoints(board_t *board, int x, int y, bool horiz, int len, X*************** X*** 18,26 **** X--- 22,44 ---- X static bool validword(board_t *board, int x, int y, int len, char subc, X bool horiz, bool machine, bool check); X static bool validlocation(board_t *board, int x, int y, bool horiz, int len); X+ #else X+ static void dopos(); X+ static int wordpoints(); X+ static bool validword(); X+ static bool validlocation(); X+ #endif X X+ #ifdef _STDC_ X void X bestmove(board_t *board, player_t *player, move_t *best) X+ #else X+ void X+ bestmove(board, player, best) X+ board_t *board; X+ player_t *player; X+ move_t *best; X+ #endif X { X int x, y; X move_t try; X*************** X*** 42,49 **** X--- 60,75 ---- X X #ifdef notdef X X+ #ifdef sun386 X void X printmove(int which, move_t *move, FILE *fp) X+ #else X+ void X+ printmove(which, move, fp) X+ int which; X+ move_t *move; X+ FILE *fp; X+ #endif X { X fprintf(fp, "Player %d: \"%s\", %s at (%d, %d) for %d points.\n", X which, move->word, move->horiz ? "horiz" : "vert", X*************** X*** 54,61 **** X--- 80,98 ---- X X #endif X X+ #ifdef _STDC_ X static void X dopos(board_t *board, player_t *player, int x, int y, bool horiz, move_t *best) X+ #else X+ static void X+ dopos(board, player, x, y, horiz, best) X+ board_t *board; X+ player_t *player; X+ int x; X+ int y; X+ bool horiz; X+ move_t *best; X+ #endif X { X char opt[SIZE]; X char req[SIZE]; X*************** X*** 132,139 **** X--- 169,186 ---- X return; X } X X+ #ifdef _STDC_ X static bool X validlocation(board_t *board, int x, int y, bool horiz, int len) X+ #else X+ static bool X+ validlocation(board, x, y, horiz, len) X+ board_t *board; X+ int x; X+ int y; X+ bool horiz; X+ int len; X+ #endif X { X int i; X X*************** X*** 171,178 **** X--- 218,234 ---- X * be invalid. X */ X X+ #ifdef _STDC_ X void X trymove(move_t *move, board_t *board, player_t *player, bool check) X+ #else X+ void X+ trymove(move, board, player, check) X+ move_t *move; X+ board_t *board; X+ player_t *player; X+ bool check; X+ #endif X { X bool used[WORK_SIZE]; X int numused = 0; X*************** X*** 319,327 **** X--- 375,396 ---- X return; X } X X+ #ifdef _STDC_ X static bool X validword(board_t *board, int x, int y, int len, char subc, bool horiz, X bool machine, bool check) X+ #else X+ static bool X+ validword(board, x, y, len, subc, horiz, machine, check) X+ board_t *board; X+ int x; X+ int y; X+ int len; X+ char subc; X+ bool horiz; X+ bool machine; X+ bool check; X+ #endif X { X char buf[BSIZE], qbuf[BSIZE], c; X int i; X*************** X*** 364,372 **** X--- 433,453 ---- X } X } X X+ #ifdef _STDC_ X static int X wordpoints(board_t *board, int x, int y, bool horiz, int len, char *word, X char subc, int wx, int wy, bool allbonuses, bool *wilds) X+ #else X+ static int X+ wordpoints(board, x, y, horiz, len, word, subc, wx, wy, allbonuses, wilds) X+ board_t *board; X+ int x,y; X+ bool horiz; X+ int len; X+ char *word, subc; X+ int wx,wy; X+ bool allbonuses, *wilds; X+ #endif X { X int value = 0; X int mult = 1; X*** orig/player.c.orig Sat Apr 1 09:32:41 1989 X--- player.c Wed Jul 12 07:16:31 1989 X*************** X*** 8,17 **** X--- 8,27 ---- X * X */ X X+ #ifdef MSDOS X+ typedef char bool; X+ #endif X #include "scrabble.h" X X+ #ifdef _STDC_ X player_t * X makeplayer(board_t *board, int num) X+ #else X+ player_t * X+ makeplayer(board, num) X+ board_t *board; X+ int num; X+ #endif X { X player_t *player = (player_t *) util_malloc(sizeof (player_t)); X int i; X*************** X*** 51,58 **** X--- 61,76 ---- X X /* Note that this must be called before boardmove. */ X X+ #ifdef _STDC_ X void X playermove(board_t *board, player_t *player, move_t *move) X+ #else X+ void X+ playermove(board, player, move) X+ board_t *board; X+ player_t *player; X+ move_t *move; X+ #endif X { X int i, j, k; X char c; X*************** X*** 121,128 **** X--- 139,154 ---- X X #ifdef notdef X X+ #ifdef _STDC_ X void X printplayer(player_t *player, int num, FILE *fp) X+ #else X+ void X+ printplayer(player, num, fp) X+ player_t *player; X+ int num; X+ FILE *fp; X+ #endif X { X int i; X X*** orig/plural.c.orig Sat Apr 1 09:32:41 1989 X--- plural.c Wed Jul 12 07:16:32 1989 X*************** X*** 26,33 **** X--- 26,39 ---- X { "", "s" } X } ; X X+ #ifdef _STDC_ X void X pluralize(char *word) X+ #else X+ void X+ pluralize(word) X+ char *word; X+ #endif X { X int i, wl, sl; X char *s, *t; X*** orig/savegame.c.orig Sat Apr 1 09:32:42 1989 X--- savegame.c Wed Jul 12 07:16:32 1989 X*************** X*** 8,35 **** X--- 8,68 ---- X * X */ X X+ #ifdef MSDOS X+ typedef char bool; X+ #endif X #include "scrabble.h" X X+ #ifdef _STDC_ X board_t * X restoregame(FILE *fp, int *nump, int *whosup, int *turn) X+ #else X+ board_t * X+ restoregame(fp, nump, whosup, turn) X+ FILE *fp; X+ int *nump; X+ int *whosup; X+ int *turn; X+ #endif X { X return (NULL); X } X X+ #ifdef _STDC_ X player_t * X restoreplayer(FILE *fp) X+ #else X+ player_t * X+ restoreplayer(fp) X+ FILE *fp; X+ #endif X { X return (NULL); X } X X+ #ifdef _STDC_ X void X savegame(FILE *fp, int nump, int whosup, int turn) X+ #else X+ void X+ savegame(fp, nump, whosup, turn) X+ FILE *fp; X+ int nump; X+ int whosup; X+ int turn; X+ #endif X { X return; X } X X+ #ifdef _STDC_ X void X saveplayer(FILE *fp) X+ #else X+ void X+ saveplayer(fp) X+ FILE *fp; X+ #endif X { X return; X } X*** orig/scrabble.c.orig Sat Apr 1 09:32:43 1989 X--- scrabble.c Wed Jul 12 07:22:12 1989 X*************** X*** 8,13 **** X--- 8,17 ---- X * X */ X X+ #ifdef MSDOS X+ typedef char bool; X+ #include <stdlib.h> X+ #endif X #include "scrabble.h" X #include "date.h" X #include <signal.h> X*************** X*** 16,28 **** X--- 20,47 ---- X bool userpick = false; X bool confirm = false; X X+ #ifdef _STDC_ X static bool domove(board_t *board, player_t **players, int which); X+ #else X+ static bool domove(); X+ #endif X static void sighandler(); X X+ #ifdef MSDOS X+ static char *dictfile = "dictionary"; X+ #else X static char *dictfile = DICT_FILE; X+ #endif X X+ #ifdef _STDC_ X int X main(int ac, char **av) X+ #else X+ int X+ main(ac, av) X+ int ac; X+ char **av; X+ #endif X { X board_t *board; X player_t *players[MAX_PLAYERS]; X*************** X*** 40,46 **** X--- 59,69 ---- X printf("Compiled %s by %s@%s\n\n", DATE, USER, HOST); X */ X X+ #ifdef MSDOS X+ srand((unsigned int) time(0)); X+ #else X srandom(time(0)); X+ #endif X X for (i = 0; i < MAX_PLAYERS; i++) X machine[i] = false; X*************** X*** 115,121 **** X--- 138,146 ---- X X user_init(DEV_TTY, board, players, numplayers); X X+ #ifndef MSDOS X signal(SIGINT, sighandler); X+ #endif X X /* Now take turns. */ X for (;;) { X*************** X*** 179,186 **** X--- 204,219 ---- X exit(1); X } X X+ #ifdef _STDC_ X static bool X domove(board_t *board, player_t **players, int which) X+ #else X+ static bool X+ domove(board, players, which) X+ board_t *board; X+ player_t **players; X+ int which; X+ #endif X { X move_t move; X char buf[BSIZE]; X*** orig/scrabble.h.orig Sat Apr 1 09:32:38 1989 X--- scrabble.h Wed Jul 12 07:16:36 1989 X*************** X*** 25,31 **** X--- 25,35 ---- X #define DICT_FILE "/usr/dict/words" X #endif X X+ #ifdef MSDOS X+ #define HASH_SIZE 1003 X+ #else X #define HASH_SIZE 5003 X+ #endif X #define MAX_LENGTH 15 X #define WILD '*' X #define ZIP ' ' X*************** X*** 120,126 **** X--- 124,134 ---- X X /* scrabble.c */ X X+ #ifdef _STDC_ X extern int main(int ac, char **av); X+ #else X+ extern int main(); X+ #endif X extern dict_t *dictionaries; X extern bool debug; X extern bool userpick; X*************** X*** 128,135 **** X--- 136,148 ---- X /* board.c */ X X extern board_t *makeboard(); X+ #ifdef _STDC_ X extern void boardmove(board_t *board, move_t *move); X extern char pickletter(board_t *board); X+ #else X+ extern void boardmove(); X+ extern char pickletter(); X+ #endif X extern int letterpoint_values[]; X X /* extern void printboard(board_t *board, FILE *fp); */ X*************** X*** 136,148 **** X--- 149,167 ---- X X /* move.c */ X X+ #ifdef _STDC_ X extern void bestmove(board_t *board, player_t *player, move_t *best); X extern void trymove(move_t *move, board_t *board, player_t *player, bool check); X+ #else X+ extern void bestmove(); X+ extern void trymove(); X+ #endif X X /* extern void printmove(int which, move_t *move, FILE *fp); */ X X /* dict.c */ X X+ #ifdef _STDC_ X extern void readdict(char *file); X extern word_t *getpossibles(char *req, int numreq, char *opt, int numopt, X int len); X*************** X*** 150,172 **** X--- 169,212 ---- X extern void addword(char *word); X extern void remword(char *word); X extern void writedict(char *file); X+ #else X+ extern void readdict(); X+ extern word_t *getpossibles(); X+ extern bool isaword(); X+ extern void addword(); X+ extern void remword(); X+ extern void writedict(); X+ #endif X X /* player.c */ X X+ #ifdef _STDC_ X extern player_t *makeplayer(board_t *board, int num); X extern void playermove(board_t *board, player_t *player, move_t *move); X+ #else X+ extern player_t *makeplayer(); X+ extern void playermove(); X+ #endif X X /* extern void printplayer(player_t *player, int num, FILE *fp); */ X X /* savegame.c */ X X+ #ifdef _STDC_ X extern board_t *restoregame(FILE *fp, int *nump, int *whosup, int *turn); X extern player_t *restoreplayer(FILE *fp); X extern void savegame(FILE *fp, int nump, int whosup, int turn); X extern void saveplayer(FILE *fp); X+ #else X+ extern board_t *restoregame(); X+ extern player_t *restoreplayer(); X+ extern void savegame(); X+ extern void saveplayer(); X+ #endif X X /* user.c */ X X+ #ifdef _STDC_ X extern void user_init(devtype_t type, board_t *board, player_t *players[], X int numplayers); X extern void user_message(char *message); X*************** X*** 176,181 **** X--- 216,231 ---- X extern void user_drawplayer(player_t *player, int pos, bool up); X extern void user_drawsummary(board_t *board, int turn); X extern void user_drawmove(board_t *board, move_t *move, player_t *player); X+ #else X+ extern void user_init(); X+ extern void user_message(); X+ extern char *user_question(); X+ extern bool user_confirm(); X+ extern command_t user_command(); X+ extern void user_drawplayer(); X+ extern void user_drawsummary(); X+ extern void user_drawmove(); X+ #endif X extern void user_givehelp(); X extern void user_update(); X extern void user_cleanup(); X*************** X*** 184,189 **** X--- 234,240 ---- X X /* tty.c */ X X+ #ifdef _STDC_ X extern void tty_init(board_t *board, player_t *players[], int numplayers); X extern void tty_message(char *message); X extern char *tty_question(char *message); X*************** X*** 192,197 **** X--- 243,258 ---- X extern void tty_drawplayer(player_t *player, int pos, bool up); X extern void tty_drawsummary(board_t *board, int turn); X extern void tty_drawmove(board_t *board, move_t *mv, player_t *player); X+ #else X+ extern void tty_init(); X+ extern void tty_message(); X+ extern char *tty_question(); X+ extern bool tty_confirm(); X+ extern command_t tty_command(); X+ extern void tty_drawplayer(); X+ extern void tty_drawsummary(); X+ extern void tty_drawmove(); X+ #endif X extern void tty_givehelp(); X extern void tty_update(); X extern void tty_cleanup(); X*** orig/tty.c.orig Sat Apr 1 09:32:44 1989 X--- tty.c Wed Jul 12 07:25:45 1989 X*************** X*** 8,16 **** X--- 8,21 ---- X * X */ X X+ #ifdef MSDOS X+ #include <curses.h> X #include "scrabble.h" X+ #else X+ #include "scrabble.h" X #include <curses.h> X #undef bool X+ #endif X X static WINDOW *boardwin, *scores, *summary, *dialog; X #ifdef notdef X*************** X*** 50,57 **** X--- 55,70 ---- X " ? : Print this help message. " X } ; X X+ #ifdef _STDC_ X void X tty_init(board_t *board, player_t *players[], int numplayers) X+ #else X+ void X+ tty_init(board, players, numplayers) X+ board_t *board; X+ player_t *players[]; X+ int numplayers; X+ #endif X { X int i, j; X int x, y; X*************** X*** 93,103 **** X for (j = 0; j < 15; j++) { X bpos(x, y, i, j); X wmove(boardwin, y, x - 1); X! waddch(boardwin, lbchar[board->bonus[j][i]]); X wmove(boardwin, y, x); X waddch(boardwin, '.'); X wmove(boardwin, y, x + 1); X! waddch(boardwin, rbchar[board->bonus[j][i]]); X } X X /* Draw the scores display... */ X--- 106,116 ---- X for (j = 0; j < 15; j++) { X bpos(x, y, i, j); X wmove(boardwin, y, x - 1); X! waddch(boardwin, lbchar[(int)board->bonus[j][i]]); X wmove(boardwin, y, x); X waddch(boardwin, '.'); X wmove(boardwin, y, x + 1); X! waddch(boardwin, rbchar[(int)board->bonus[j][i]]); X } X X /* Draw the scores display... */ X*************** X*** 121,137 **** X return; X } X X void X tty_message(char *message) X { X /* Print the message and clear the line below it. */ X messline = (messline + 1) % MESS_SIZE; X if (messline < MESS_SIZE - 1) { X wmove(dialog, messline + 1, 0); X! wclrtoeol(dialog); X } X wmove(dialog, messline, 0); X! wclrtoeol(dialog); X wprintw(dialog, "%s", message); X X wrefresh(dialog); X--- 134,156 ---- X return; X } X X+ #ifdef _STDC_ X void X tty_message(char *message) X+ #else X+ void X+ tty_message(message) X+ char *message; X+ #endif X { X /* Print the message and clear the line below it. */ X messline = (messline + 1) % MESS_SIZE; X if (messline < MESS_SIZE - 1) { X wmove(dialog, messline + 1, 0); X! wclrtoeol(dialog); X } X wmove(dialog, messline, 0); X! wclrtoeol(dialog); X wprintw(dialog, "%s", message); X X wrefresh(dialog); X*************** X*** 139,146 **** X--- 158,171 ---- X return; X } X X+ #ifdef _STDC_ X char * X tty_question(char *message) X+ #else X+ char * X+ tty_question(message) X+ char *message; X+ #endif X { X static char buf[BSIZE]; X X*************** X*** 156,163 **** X--- 181,194 ---- X return (buf); X } X X+ #ifdef _STDC_ X bool X tty_confirm(char *message) X+ #else X+ bool X+ tty_confirm(message) X+ char *message; X+ #endif X { X char c; X X*************** X*** 176,183 **** X--- 207,222 ---- X * a word. Other commands are 'T', 'S', 'R', 'Q', and '?'. X */ X X+ #ifdef _STDC_ X command_t X tty_command(board_t *board, player_t *player, move_t *mv) X+ #else X+ command_t X+ tty_command(board, player, mv) X+ board_t *board; X+ player_t *player; X+ move_t *mv; X+ #endif X { X int x = 7, y = 7; X int px, py; X*************** X*** 300,307 **** X--- 339,354 ---- X return (MOVE); X } X X+ #ifdef _STDC_ X void X tty_drawplayer(player_t *player, int pos, bool up) X+ #else X+ void X+ tty_drawplayer(player, pos, up) X+ player_t *player; X+ int pos; X+ bool up; X+ #endif X { X int i; X X*************** X*** 310,316 **** X player->score); X for (i = 0; i < player->numworking; i++) X wprintw(scores, " %c", player->working[i]); X! wclrtoeol(scores); X wmove(scores, pos + 5, 0); X wrefresh(scores); X X--- 357,363 ---- X player->score); X for (i = 0; i < player->numworking; i++) X wprintw(scores, " %c", player->working[i]); X! wclrtoeol(scores); X wmove(scores, pos + 5, 0); X wrefresh(scores); X X*************** X*** 317,324 **** X--- 364,378 ---- X return; X } X X+ #ifdef _STDC_ X void X tty_drawsummary(board_t *board, int turn) X+ #else X+ void X+ tty_drawsummary(board, turn) X+ board_t *board; X+ int turn; X+ #endif X { X wmove(summary, 0, 0); X wprintw(summary, " Game turn: %d ", turn); X*************** X*** 329,336 **** X--- 383,398 ---- X return; X } X X+ #ifdef _STDC_ X void X tty_drawmove(board_t *board, move_t *mv, player_t *player) X+ #else X+ void X+ tty_drawmove(board, mv, player) X+ board_t *board; X+ move_t *mv; X+ player_t *player; X+ #endif X { X int i, x, y; X char c; X*** orig/user.c.orig Sat Apr 1 09:32:44 1989 X--- user.c Wed Jul 12 07:16:34 1989 X*************** X*** 10,18 **** X--- 10,22 ---- X * added to this file. X */ X X+ #ifdef MSDOS X+ typedef char bool; X+ #endif X #include "scrabble.h" X X struct device { X+ #ifdef _STDC_ X void (*init)(board_t *board, player_t *players[], int numplayers); X void (*message)(char *message); X char *(*question)(char *message); X*************** X*** 21,26 **** X--- 25,40 ---- X void (*drawplayer)(player_t *player, int pos, bool up); X void (*drawsummary)(board_t *board, int turn); X void (*drawmove)(board_t *board, move_t *move, player_t *player); X+ #else X+ void (*init)(); X+ void (*message)(); X+ char *(*question)(); X+ bool (*confirm)(); X+ command_t (*command)(); X+ void (*drawplayer)(); X+ void (*drawsummary)(); X+ void (*drawmove)(); X+ #endif X void (*givehelp)(); X void (*update)(); X void (*cleanup)(); X*************** X*** 42,49 **** X--- 56,72 ---- X X static struct device *dev; X X+ #ifdef _STDC_ X void X user_init(devtype_t type, board_t *board, player_t *players[], int numplayers) X+ #else X+ void X+ user_init(type, board, players, numplayers) X+ devtype_t type; X+ board_t *board; X+ player_t *players[]; X+ int numplayers; X+ #endif X { X switch (type) { X case DEV_TTY: dev = &tty_device; break; X*************** X*** 54,100 **** X--- 77,172 ---- X return; X } X X+ #ifdef _STDC_ X void X user_message(char *message) X+ #else X+ void X+ user_message(message) X+ char *message; X+ #endif X { X (dev->message)(message); X return; X } X X+ #ifdef _STDC_ X char * X user_question(char *message) X+ #else X+ char * X+ user_question(message) X+ char *message; X+ #endif X { X return ((dev->question)(message)); X } X X+ #ifdef _STDC_ X bool X user_confirm(char *message) X+ #else X+ bool X+ user_confirm(message) X+ char *message; X+ #endif X { X return ((dev->confirm)(message)); X } X X+ #ifdef _STDC_ X command_t X user_command(board_t *board, player_t *player, move_t *move) X+ #else X+ command_t X+ user_command(board, player, move) X+ board_t *board; X+ player_t *player; X+ move_t *move; X+ #endif X { X return ((dev->command)(board, player, move)); X } X X+ #ifdef _STDC_ X void X user_drawplayer(player_t *player, int pos, bool up) X+ #else X+ void X+ user_drawplayer(player, pos, up) X+ player_t *player; X+ int pos; X+ bool up; X+ #endif X { X (dev->drawplayer)(player, pos, up); X return; X } X X+ #ifdef _STDC_ X void X user_drawsummary(board_t *board, int turn) X+ #else X+ void X+ user_drawsummary(board, turn) X+ board_t *board; X+ int turn; X+ #endif X { X (dev->drawsummary)(board, turn); X return; X } X X+ #ifdef _STDC_ X void X user_drawmove(board_t *board, move_t *move, player_t *player) X+ #else X+ void X+ user_drawmove(board, move, player) X+ board_t *board; X+ move_t *move; X+ player_t *player; X+ #endif X { X (dev->drawmove)(board, move, player); X return; X*************** X*** 123,130 **** X--- 195,210 ---- X X #ifdef notdef X X+ #ifdef _STDC_ X bool X readmove(board_t *board, player_t *player, move_t *move) X+ #else X+ bool X+ readmove(board, player, move) X+ board_t *board; X+ player_t *player; X+ move_t *move; X+ #endif X { X char buf[BSIZE]; X int x, y, i; X*** orig/util.c.orig Sat Apr 1 09:32:45 1989 X--- util.c Wed Jul 12 09:41:38 1989 X*************** X*** 9,22 **** X--- 9,35 ---- X */ X X #include "util.h" X+ #ifdef UNIX X #include <pwd.h> X #include <sys/types.h> X+ #ifdef BSD X #include <sys/time.h> X #include <sys/resource.h> X+ #else /* BSD */ X+ #include <time.h> X+ #endif /* BSD */ X X extern char *malloc(); X extern char *realloc(); X+ #endif /* UNIX */ X X+ #ifdef MSDOS X+ #include <string.h> X+ #include <stdlib.h> X+ #include <time.h> X+ #include <alloc.h> X+ #endif /* MSDOS */ X+ X char * X strsav(str) X char *str; X*************** X*** 51,73 **** X char * X util_datestring() X { X- register char *tzn; X struct tm *tp; X static char tbuf[40]; X char *ap; X struct timeval tv; X struct timezone tz; X! char *timezone(), *asctime(); X! int i; X! struct tm *localtime(); X X (void) gettimeofday(&tv, &tz); X tp = localtime((time_t *) &tv.tv_sec); X- ap = asctime(tp); X tzn = timezone(tz.tz_minuteswest, tp->tm_isdst); X sprintf(tbuf, "%.20s", ap); X if (tzn) X strcat(tbuf, tzn); X strcat(tbuf, ap + 19); X i = strlen(tbuf); X tbuf[i - 1] = '\0'; X--- 64,96 ---- X char * X util_datestring() X { X struct tm *tp; X static char tbuf[40]; X char *ap; X+ int i; X+ #ifdef BSD X+ register char *tzn; X struct timeval tv; X struct timezone tz; X! extern char *timezone(); /* missing from time.h */ X! #else X! time_t t; X! #endif X X+ #ifdef BSD X (void) gettimeofday(&tv, &tz); X tp = localtime((time_t *) &tv.tv_sec); X tzn = timezone(tz.tz_minuteswest, tp->tm_isdst); X+ #else X+ t = time((time_t *) NULL); X+ tp = localtime(&t); X+ #endif X+ ap = asctime(tp); X sprintf(tbuf, "%.20s", ap); X+ #ifdef BSD X if (tzn) X strcat(tbuf, tzn); X+ #endif X strcat(tbuf, ap + 19); X i = strlen(tbuf); X tbuf[i - 1] = '\0'; X*************** X*** 74,79 **** X--- 97,103 ---- X return (tbuf); X } X X+ #ifdef BSD X int X util_seconds() X { X*************** X*** 82,88 **** X--- 106,114 ---- X getrusage(RUSAGE_SELF, &ruse); X return (ruse.ru_utime.tv_sec); X } X+ #endif X X+ #ifdef UNIX X char * X util_tildexpand(s) X char *s; X*************** X*** 111,116 **** X--- 137,143 ---- X strcat(n, s); X return (n); X } X+ #endif X X char * X util_malloc(num) X*************** X*** 123,129 **** X--- 150,160 ---- X fprintf(stderr, "malloc: can't allocate %d bytes", num); X exit(1); X } X+ #ifdef BSD X bzero(s, num); X+ #else X+ (void) memset(s, 0, num); X+ #endif X return (s); X } X X*************** X*** 142,144 **** X--- 173,194 ---- X return (s); X } X X+ #ifdef MSDOS X+ char far * X+ util_farmalloc(num) X+ unsigned long num; X+ { X+ char far *s; X+ char far *t; X+ X+ s = (char far *) farmalloc(num); X+ if (!s) { X+ fprintf(stderr, "malloc: can't allocate %d bytes", num); X+ exit(1); X+ } X+ for (t = s; t < s + num; t++) { X+ *t = 0; X+ } X+ return (s); X+ } X+ #endif X*** orig/util.h.orig Sat Apr 1 09:32:38 1989 X--- util.h Wed Jul 12 07:38:55 1989 X*************** X*** 6,13 **** X * Standard definitions. X */ X X! #define UNIX X! #define BSD X X /* vcc has problems with math.h */ X X--- 6,18 ---- X * Standard definitions. X */ X X! /* X! * One or more of the following should be defined in the Makefile. X! * You can alternately define them here. X! */ X! /* #define UNIX */ X! /* #define MSDOS */ X! /* #define BSD */ X X /* vcc has problems with math.h */ X X*************** X*** 40,46 **** X--- 45,53 ---- X abort();\ X }} X X+ #ifdef UNIX X typedef int bool; X+ #endif X X #define false 0 X #define true 1 X*************** X*** 71,79 **** X--- 78,91 ---- X extern char *strstr(); X extern char *util_datestring(); X extern char *util_malloc(); X+ #ifdef MSDOS X+ extern char far *util_farmalloc(); X+ #endif X extern char *util_realloc(); X extern int util_seconds(); X+ #ifdef UNIX X extern char *util_tildexpand(); X+ #endif X X /* Externs from libc */ X X*************** X*** 82,93 **** X--- 94,109 ---- X extern int errno; X extern char *sys_errlist[]; X extern double atof(); X+ #ifdef UNIX X extern long random(); X extern void srandom(); X+ #endif X extern long time(); X extern void exit(); X extern void bcopy(); X+ #ifdef UNIX X extern char *sbrk(); X+ #endif X extern char *getlogin(); X extern void free(); X extern void perror(); X*** /dev/null Wed Jul 12 09:45:01 1989 X--- patchlevel.h Wed Jul 12 07:29:39 1989 X*************** X*** 0 **** X--- 1 ---- X+ #define PATCHLEVEL 1 X*** /dev/null Wed Jul 12 09:45:01 1989 X--- Makefile.gcc Wed Jul 12 07:42:15 1989 X*************** X*** 0 **** X--- 1,229 ---- X+ X+ # RCS Info: $Revision: 1.2 $ on $Date: 89/03/15 11:16:17 $ X+ # $Source: /yew3/faustus/src/scrabble/RCS/Makefile,v $ X+ # Copyright (c) 1987 Wayne A. Christopher, U. C. Berkeley CAD Group X+ # X+ # Program Makefile X+ # X+ # This makefile has the standard options "clean", "require", and "install". X+ # Also available are "lint", "depend", "tags", "opt", "debug", and "prof". X+ # "opt" causes the program to be compiled optimized, "debug" with -g, and X+ # "prof" with -pg. As an added bonus, the Makefile remembers the last of X+ # these options given. X+ X+ what: all X+ X+ #---- Tool specific stuff ---- X+ X+ DICT_DEF = -DDICT_FILE=\"/usr/dict/words\" X+ SYS_DEF = -DUNIX -DBSD X+ X+ PROGRAM = scrabble X+ X+ SRC = \ X+ board.c \ X+ dict.c \ X+ move.c \ X+ player.c \ X+ savegame.c \ X+ scrabble.c \ X+ tty.c \ X+ user.c \ X+ util.c refresh.c X+ X+ OBJ = \ X+ board.o \ X+ dict.o \ X+ move.o \ X+ player.o \ X+ savegame.o \ X+ scrabble.o \ X+ tty.o \ X+ user.o \ X+ util.o refresh.o X+ X+ HDR = \ X+ scrabble.h \ X+ util.h X+ X+ SUPPORT = plural X+ X+ SABER_HDR = scrabble.h X+ X+ REQUIRE = X+ X+ SPEC_OPT_LIBS = X+ X+ SPEC_DEBUG_LIBS = X+ X+ SPEC_PROF_LIBS = X+ X+ SPEC_LINT_LIBS = X+ X+ SPEC_INCLUDE = -I. -I../include X+ X+ SPEC_DEFINES = $(DICT_DEF) $(SYS_DEF) X+ X+ MAN_SECTION = 1 X+ X+ DOC = X+ X+ MISC = X+ X+ CC = gcc -W -fwritable-strings X+ X+ OPT_LIBS = $(SPEC_OPT_LIBS) X+ X+ DEBUG_LIBS = $(SPEC_DEBUG_LIBS) X+ X+ PROF_LIBS = $(SPEC_PROF_LIBS) X+ X+ #OPT_LDFLAGS = -lcurses -ltermlib -lX -lm -O X+ OPT_LDFLAGS = -lcurses -ltermlib -lm -O X+ X+ DEBUG_LDFLAGS = -lcurses -ltermlib -lX -lm -g X+ X+ PROF_LDFLAGS = -lcurses -ltermlib -lX_p -lm_p -pg X+ X+ MAN_PAGE = $(PROGRAM).$(MAN_SECTION) X+ X+ #---- State ---- X+ X+ #CFLAGS=-O -g X+ CFLAGS=-g X+ LIBS=$(OPT_LIBS) X+ LDFLAGS=$(OPT_LDFLAGS) X+ X+ #---- Generic stuff ---- X+ X+ # EXTDEFINES are things that come from a higher-level Makefile X+ X+ EXTDEFINES = X+ X+ DEFINES = $(EXT_DEFINES) $(SPEC_DEFINES) X+ X+ INCLUDE = $(SPEC_INCLUDE) X+ X+ LINT_LIBS = $(SPEC_LINT_LIB) X+ X+ LINT_FLAGS = -DLINT -u -z -lc X+ X+ .c.o: $*.c X+ $(CC) $(DEFINES) $(INCLUDE) $(CFLAGS) -c $*.c X+ X+ all: date.h $(PROGRAM) $(SUPPORT) .saberinit X+ @echo "All done." X+ X+ $(PROGRAM): $(OBJ) $(LIBS) X+ rm -f $(PROGRAM) X+ $(CC) -o $(PROGRAM) $(OBJ) $(LIBS) $(LDFLAGS) X+ X+ $(SUPPORT): $(SUPPORT).o X+ rm -f $(SUPPORT) X+ $(CC) -o $(SUPPORT) $(SUPPORT).o $(LIBS) $(LDFLAGS) X+ X+ date.h: /tmp X+ @echo \#define DATE \"`date`\" > date.h X+ @echo \#define HOST \"`hostname`\" >> date.h X+ @echo \#define USER \"`whoami`\" >> date.h X+ X+ #---- Stuff that changes our state ---- X+ X+ opt: X+ @-if egrep -s '^CFLAGS=-O' Makefile ; then \ X+ echo already -O ... ; \ X+ else echo converting from $(CFLAGS) to -O ; \ X+ sed -e 's/^CFLAGS=.*$$/CFLAGS=-O/' \ X+ -e 's/^LIBS=.*$$/LIBS=\$$\(OPT_LIBS\)/' \ X+ -e 's/^LDFLAGS=.*$$/LDFLAGS=\$$\(OPT_LDFLAGS\)/' \ X+ < Makefile > mktemp ; \ X+ mv mktemp Makefile ; \ X+ rm *.o ; \ X+ fi X+ @make $(MFLAGS) X+ X+ debug: X+ @-if egrep -s '^CFLAGS=-g' Makefile ; then \ X+ echo already -g ... ; \ X+ else echo converting from $(CFLAGS) to -g ; \ X+ sed -e 's/^CFLAGS=.*$$/CFLAGS=-g/' \ X+ -e 's/^LIBS=.*$$/LIBS=\$$\(DEBUG_LIBS\)/' \ X+ -e 's/^LDFLAGS=.*$$/LDFLAGS=\$$\(DEBUG_LDFLAGS\)/' \ X+ < Makefile > mktemp ; \ X+ mv mktemp Makefile ; \ X+ rm *.o ; \ X+ fi X+ @make $(MFLAGS) X+ X+ prof: X+ @-if egrep -s '^CFLAGS=-pg' Makefile ; then \ X+ echo already -pg -O ... ; \ X+ else echo converting from $(CFLAGS) to -pg -O ; \ X+ sed -e 's/^CFLAGS=.*$$/CFLAGS=-pg -O/' \ X+ -e 's/^LIBS=.*$$/LIBS=\$$\(PROF_LIBS\)/' \ X+ -e 's/^LDFLAGS=.*$$/LDFLAGS=\$$\(PROF_LDFLAGS\)/' \ X+ < Makefile > mktemp ; \ X+ mv mktemp Makefile ; \ X+ rm *.o ; \ X+ fi X+ @make $(MFLAGS) X+ X+ checkin: X+ ci $(SRC) $(HDR) $(MAN_PAGE) Makefile $(DOC) $(MISC) </dev/null X+ rcs -U $(SRC) $(HDR) $(MAN_PAGE) Makefile $(DOC) $(MISC) X+ X+ checkout: X+ co $(SRC) $(HDR) $(MAN_PAGE) $(DOC) $(MISC) </dev/null X+ X+ #---- Stuff for lint ---- X+ X+ lint: $(SRC) $(HDR) X+ lint $(LINT_FLAGS) $(DEFINES) $(INCLUDE) $(SRC) $(LINT_LIBS) X+ X+ #---- Stuff for "make install" ---- X+ X+ #install: $(INSTALLED) $(MAN_INSTALLED) X+ # X+ #$(INSTALLED): $(TARGET) X+ # cp $(TARGET) $(INSTALLED) X+ # strip $(TARGET) $(INSTALLED) X+ # X+ #$(MAN_INSTALLED): $(MAN_PAGE) X+ # cp $(MAN_PAGE) $(MAN_INSTALLED) X+ X+ #---- Misc junk ---- X+ X+ dist: X+ rdist -Rich $(SRC) $(SUPPSRC) $(HDR) $(MAN_PAGE) $(DOC) \ X+ $(MISC) Makefile $(DIST) X+ X+ print: X+ psgrind -2r -Plps $(HDR) $(SRC) $(SUPPSRC) X+ X+ require: X+ @echo $(REQUIRE) X+ X+ clean: X+ rm -f $(TARGET) $(SUPPORT) $(OBJ) $(SUPPOBJ) tags *.out foo tmp X+ X+ tags: $(SRC) $(HDR) $(SUPPSRC) X+ ctags -w -t $(SRC) $(HDR) $(SUPPSRC) > /dev/null 2>&1 X+ X+ depend: $(SRC) $(SUPPSRC) X+ cc -M $(DEFINES) $(INCLUDE) $(CFLAGS) $(SRC) $(SUPPSRC) > makedep X+ echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep X+ echo '$$r makedep' >>eddep X+ echo 'w' >>eddep X+ ed - Makefile < eddep X+ rm eddep makedep X+ echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile X+ echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile X+ echo '# see make depend above' >> Makefile X+ X+ .saberinit: Makefile X+ @echo load $(SRC) $(LIBS) $(LDFLAGS) > .saberinit X+ X+ #----------------------------------------------------------------- X+ # DO NOT DELETE THIS LINE -- make depend uses it X+ # DEPENDENCIES MUST END AT END OF FILE X+ X*** /dev/null Wed Jul 12 09:45:01 1989 X--- Makefile.tcc Wed Jul 12 07:15:42 1989 X*************** X*** 0 **** X--- 1,72 ---- X+ X+ # RCS Info: $Revision: 1.2 $ on $Date: 89/03/15 11:16:17 $ X+ # $Source: /yew3/faustus/src/scrabble/RCS/Makefile,v $ X+ # Copyright (c) 1987 Wayne A. Christopher, U. C. Berkeley CAD Group X+ # X+ # Program Makefile X+ # X+ # This makefile has the standard options "clean", "require", and "install". X+ # Also available are "lint", "depend", "tags", "opt", "debug", and "prof". X+ # "opt" causes the program to be compiled optimized, "debug" with -g, and X+ # "prof" with -pg. As an added bonus, the Makefile remembers the last of X+ # these options given. X+ # X+ # Heavily mutated to work with OpusMake, Turbo-C v1.5 (at least), and X+ # Bjorn Larsson's (...mcvax!enea!infovax!bl) PC-Curses package. X+ # X+ # Erik Talvola X+ # talvola@cory.berkeley.edu X+ # ...!ucbvax!cory!talvola X+ X+ what: all X+ X+ #---- Tool specific stuff ---- X+ X+ PROGRAM = scrabble.exe X+ X+ SRC = \ X+ board.c \ X+ dict.c \ X+ move.c \ X+ player.c \ X+ savegame.c \ X+ scrabble.c \ X+ tty.c \ X+ user.c \ X+ util.c X+ X+ OBJ = board.obj dict.obj move.obj player.obj savegame.obj \ X+ scrabble.obj tty.obj user.obj util.obj X+ X+ HDR = \ X+ scrabble.h \ X+ util.h X+ X+ SUPPORT = plural X+ X+ CC = tcc X+ MODEL = c X+ CFLAGS = -m$(MODEL) -I\turboc\include -G -O -Z -DMSDOS X+ LIBDIR = \turboc\lib X+ X+ LIBS = $(LIBDIR)\$(MODEL)curses.lib X+ LDFLAGS = -L$(LIBDIR) -m$(MODEL) X+ X+ #---- Generic stuff ---- X+ X+ # EXTDEFINES are things that come from a higher-level Makefile X+ X+ all: date.h $(PROGRAM) $(SUPPORT).exe X+ @echo "All done." X+ X+ # the next rule isn't very good - before making scrabble.exe, delete X+ # plural.obj (and any others) if they exist. I didn't bother writing X+ # a file to give to LINK, and the command line is too long to handle all X+ # the obj's directly. X+ X+ $(PROGRAM): $(OBJ) X+ $(CC) -e$(PROGRAM) $(LDFLAGS) *.obj $(LIBS) X+ X+ $(SUPPORT).exe: $(SUPPORT).obj X+ $(CC) -e$(SUPPORT) $(LDFLAGS) $(SUPPORT).obj $(LIBS) X+ END_OF_FILE if test 40696 -ne `wc -c <'patches01'`; then echo shar: \"'patches01'\" unpacked with wrong size! fi # end of 'patches01' fi echo shar: End of shell archive. exit 0