Got Yacc compiling and running

This commit is contained in:
Matt Jenkins
2016-07-14 00:06:12 +01:00
parent 66e5cd88c0
commit f3dbdc7615
6 changed files with 47 additions and 24 deletions

View File

@@ -605,6 +605,7 @@ file /bin/whoami
file /bin/write file /bin/write
mode 02755 mode 02755
file /bin/xargs file /bin/xargs
file /bin/yacc
file /bin/zcat file /bin/zcat
link /bin/[ link /bin/[

View File

@@ -17,7 +17,7 @@ SUBDIR = adb adc-demo aout ar as awk basic calendar cc chflags \
ranlib re renice retroforth scm sed setty sh sl smallc \ ranlib re renice retroforth scm sed setty sh sl smallc \
smlrc smux stty sysctl test uname wiznet xargs \ smlrc smux stty sysctl test uname wiznet xargs \
zmodem gtest msec cron compress date2 tip \ zmodem gtest msec cron compress date2 tip \
talloc uucp talloc uucp yacc
# /sbin # /sbin
SUBDIR += chown chroot disktool fsck getty init \ SUBDIR += chown chroot disktool fsck getty init \

View File

@@ -1,24 +1,31 @@
# #==========================================
# @(#)Makefile 4.2.1 (2.11BSD) 1996/10/24 # Makefile: makefile for yacc
# # Copyright 2012 Majenko Technolohies
DESTDIR= # (matt@majenko.co.uk
SEPFLAG= -i # Last Modified: 29/01/2012
CFLAGS=-O #==========================================
SRCS = Makefile dextern files yaccpar \
y1.c y2.c y3.c y4.c \
yaccdiffs yaccnews
all: yacc TOPSRC = $(shell cd ../../..; pwd)
include $(TOPSRC)/target.mk
yacc: y1.o y2.o y3.o y4.o OBJS = y1.o y2.o y3.o y4.o
$(CC) ${SEPFLAG} -o yacc y?.o SRCS = y1.c y2.c y3.c y4.c
y1.o y2.o y3.o y4.o: dextern files
install: yacc yaccpar
install -s yacc $(DESTDIR)/usr/bin
install -c yaccpar $(DESTDIR)/usr/share/misc
clean :
-rm -f *.o yacc
srcs: $(SRCS) all: yacc
$(SRCS):
sccs get $@ yacc: ${OBJS}
${CC} ${LDFLAGS} -o yacc.elf ${OBJS} ${LIBS}
${OBJDUMP} -S yacc.elf > yacc.dis
${SIZE} yacc.elf
${ELF2AOUT} yacc.elf $@
clean:
-rm -f yacc ${OBJS} yacc.elf yacc.dis
install: all
install yacc $(DESTDIR)/bin/
y1.o: y1.c dextern
y2.o: y2.c dextern
y3.o: y3.c dextern
y4.o: y4.c dextern

View File

@@ -33,7 +33,7 @@
# ifdef MEDIUM # ifdef MEDIUM
# define ACTSIZE 4000 # define ACTSIZE 4000
# define MEMSIZE 5200 # define MEMSIZE 5200
# define NSTATES 600 # define NSTATES 750
# define NTERMS 127 # define NTERMS 127
# define NPROD 400 # define NPROD 400
# define NNONTERM 200 # define NNONTERM 200
@@ -43,6 +43,19 @@
# define WSETSIZE 250 # define WSETSIZE 250
# endif # endif
# ifdef TINY
# define ACTSIZE 1000
# define MEMSIZE 1300
# define NSTATES 750
# define NTERMS 127
# define NPROD 200
# define NNONTERM 50
# define TEMPSIZE 200
# define CNAMSZ 1000
# define LSETSIZE 250
# define WSETSIZE 100
# endif
# define NAMESIZE 50 # define NAMESIZE 50
# define NTYPES 63 # define NTYPES 63

View File

@@ -17,4 +17,5 @@
/* basic size of the Yacc implementation */ /* basic size of the Yacc implementation */
/* # define HUGE */ /* # define HUGE */
#define MEDIUM /* #define MEDIUM */
#define TINY

View File

@@ -3,6 +3,7 @@ static char sccsid[] = "@(#)y1.c 4.1.1 (2.11BSD) 1995/05/11";
#endif #endif
# include "dextern" # include "dextern"
#include <stdlib.h>
/* variables used locally */ /* variables used locally */