Added missing files for atc, boggle, btlgammon, cribbage.

This commit is contained in:
Serge Vakulenko
2014-09-17 13:54:28 -07:00
parent 5c4309942a
commit f58c7a7426
5 changed files with 34 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ TOPSRC = $(shell cd ../../..; pwd)
include $(TOPSRC)/target.mk
#include $(TOPSRC)/cross.mk
CFLAGS = -O
CFLAGS = -O -Wall -Werror
OBJS = btlgammon.o
all: btlgammon

View File

@@ -6,6 +6,7 @@
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/wait.h>
#define WHITE 0
#define BROWN 1
@@ -585,7 +586,7 @@ void prtbrd()
int main()
{
int go[6], tvec[2];
int go[6];
int k, n, pid, ret, rpid, t;
char s[100];
@@ -670,15 +671,18 @@ retry:
exit(0);
case '!': /* escape to Shell */
if(s[1] != '\0')
if(s[1] != '\0') {
system(s+1);
else if((pid = fork()) == 0) {
execl("/bin/sh", "sh", "-", 0);
fprintf(stderr, "back: cannot exec /bin/sh!\n");
exit(2);
}
while((rpid = wait(&ret)) != pid && rpid != -1)
;
} else {
pid = fork();
if(pid == 0) {
execl("/bin/sh", "sh", "-", (char*)0);
fprintf(stderr, "back: cannot exec /bin/sh!\n");
exit(2);
}
while((rpid = wait(&ret)) != pid && rpid != -1)
;
}
goto retry;
case '?': /* well, what can i do? */

View File

@@ -1 +1,2 @@
cribbage
crib.instr

View File

@@ -18,7 +18,7 @@ MAN = cribbage.0
MANSRC = cribbage.6
LIBS = -lcurses -ltermcap -lc
all: cribbage ${MAN} crib.0
all: cribbage ${MAN} crib.instr
cribbage: ${OBJS}
$(CC) $(LDFLAGS) -o $@.elf $(OBJS) $(LIBS)
@@ -26,17 +26,16 @@ cribbage: ${OBJS}
$(SIZE) $@.elf
$(ELF2AOUT) $@.elf $@ && rm $@.elf
crib.0: cribbage.n macro
crib.instr: cribbage.n macro
nroff cribbage.n > $@
${MAN}: ${MANSRC}
${MANROFF} $< > $@
clean:
rm -f *.o core cribbage ${MAN} *.dis
rm -f *.o core cribbage ${MAN} *.dis crib.instr
install: all
install cribbage $(DESTDIR)/games/
install -m 644 crib.0 $(DESTDIR)/games/lib/crib.instr
install -m 644 crib.instr $(DESTDIR)/games/lib/crib.instr
cp ${MAN} $(DESTDIR)/share/man/cat6/
cp crib.0 $(DESTDIR)/share/man/cat6/