From: ceriel Date: Tue, 10 Feb 1987 09:27:44 +0000 (+0000) Subject: Initial revision X-Git-Tag: release-5-5~4691 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e04aa9639e93cc2f4eb1da5867f14aa641e27213;p=ack.git Initial revision --- diff --git a/lang/cem/cemcom/Makefile b/lang/cem/cemcom/Makefile new file mode 100644 index 000000000..39250fcd1 --- /dev/null +++ b/lang/cem/cemcom/Makefile @@ -0,0 +1,235 @@ +# $Header$ +# M A K E F I L E F O R A C K C - C O M P I L E R + +# Machine and environ dependent definitions +EMHOME = ../../.. +MKDEP = $(EMHOME)/bin/mkdep +PRID = $(EMHOME)/bin/prid +CID = $(EMHOME)/bin/cid + +# Libraries and EM interface definitions +SYSLIB = $(EMHOME)/modules/lib/libsystem.a +EMKLIB = $(EMHOME)/modules/lib/libemk.a +EMELIB = $(EMHOME)/modules/lib/libeme.a +STRLIB = $(EMHOME)/modules/lib/libstring.a +PRTLIB = $(EMHOME)/modules/lib/libprint.a +EMMESLIB = $(EMHOME)/modules/lib/libem_mes.a +INPLIB = $(EMHOME)/modules/lib/libinput.a +ALLOCLIB = $(EMHOME)/modules/lib/liballoc.a +MALLOC = $(EMHOME)/modules/lib/malloc.o +LIBS = $(INPLIB) $(EMMESLIB) $(EMKLIB) $(PRTLIB) $(STRLIB) \ + $(ALLOCLIB) $(MALLOC) $(SYSLIB) +ELIBS = $(INPLIB) $(EMMESLIB) $(EMELIB) $(PRTLIB) $(STRLIB) \ + $(ALLOCLIB) $(MALLOC) $(SYSLIB) +LIB_INCLUDES = -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg +EM_INCLUDES = -I$(EMHOME)/h +SYSLLIB = $(EMHOME)/modules/lib/llib-lsys.ln +EMKLLIB = $(EMHOME)/modules/lib/llib-lemk.ln +EMELLIB = $(EMHOME)/modules/lib/llib-leme.ln +STRLLIB = $(EMHOME)/modules/lib/llib-lstr.ln +PRTLLIB = $(EMHOME)/modules/lib/llib-lprint.ln +EMMESLLIB = $(EMHOME)/modules/lib/llib-lmes.ln +INPLLIB = $(EMHOME)/modules/lib/llib-linput.ln +ALLOCLLIB = $(EMHOME)/modules/lib/llib-lalloc.ln +LINTLIBS = +#LINTLIBS = $(EMMESLLIB) $(EMKLLIB) $(PRTLLIB) $(STRLLIB) $(SYSLLIB) $(ALLOCLLIB) +CURRDIR = . + +COPTIONS = + +# What parser generator to use and how +GEN = $(EMHOME)/bin/LLgen +GENOPTIONS = + +# Special #defines during compilation +CDEFS = $(EM_INCLUDES) $(LIB_INCLUDES) +CFLAGS = $(CDEFS) $(COPTIONS) -O + +# Grammar files and their objects +LSRC = tokenfile.g declar.g statement.g expression.g program.g +LCSRC = tokenfile.c declar.c statement.c expression.c program.c Lpars.c +LOBJ = tokenfile.o declar.o statement.o expression.o program.o Lpars.o + +# Objects of hand-written C files +CSRC = main.c idf.c declarator.c decspecs.c struct.c \ + expr.c ch7.c ch7bin.c cstoper.c arith.c \ + asm.c code.c dumpidf.c error.c field.c\ + tokenname.c LLlex.c LLmessage.c \ + input.c domacro.c replace.c init.c options.c \ + scan.c skip.c stack.c type.c ch7mon.c label.c eval.c \ + switch.c ival.c conversion.c \ + blocks.c dataflow.c +COBJ = main.o idf.o declarator.o decspecs.o struct.o \ + expr.o ch7.o ch7bin.o cstoper.o arith.o \ + asm.o code.o dumpidf.o error.o field.o\ + tokenname.o LLlex.o LLmessage.o \ + input.o domacro.o replace.o init.o options.o \ + scan.o skip.o stack.o type.o ch7mon.o label.o eval.o \ + switch.o ival.o conversion.o \ + blocks.o dataflow.o + +# Objects of other generated C files +GCSRC = char.c symbol2str.c next.c +GOBJ = char.o symbol2str.o next.o + +# generated source files +GHSTRSRC = code.h declar.h decspecs.h def.h expr.h field.h \ + idf.h macro.h stack.h stmt.h struct.h switch.h type.h +GSRC = $(GCSRC) $(GHSTRSRC) + +# .h files generated by `make hfiles'; PLEASE KEEP THIS UP-TO-DATE! +GHSRC = botch_free.h dataflow.h debug.h density.h errout.h \ + idepth.h idfsize.h ifdepth.h inputtype.h lapbuf.h \ + maxincl.h nobitfield.h nofloat.h nopp.h \ + nparams.h numsize.h parbufsize.h pathlength.h \ + strsize.h target_sizes.h textsize.h use_tmp.h spec_arith.h static.h + +HFILES = LLlex.h align.h arith.h assert.h atw.h class.h faulty.h \ + input.h interface.h label.h level.h mes.h sizes.h specials.h \ + $(GHSRC) $(GHSTRSRC) tokenname.h Lpars.h file_info.h + +# generated files, for 'make clean' only +GENERATED = tab tokenfile.g Lpars.h LLfiles LL.output lint.out \ + print Xref lxref hfiles Cfiles $(GHSRC) $(GSRC) longnames $(LCSRC) + +# include files containing ALLOCDEF specifications +NEXTFILES = code.str declar.str decspecs.str def.str expr.str field.str \ + idf.str macro.str stack.str stmt.str struct.str switch.str type.str + +OBJ = $(COBJ) $(LOBJ) $(GOBJ) +SRC = $(CSRC) $(LCSRC) $(GCSRC) + +#EXCLEXCLEXCLEXCL + +.SUFFIXES: .str .h +.str.h: + ./make.allocd <$*.str >$*.h + +Main: Cfiles + sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make $(CURRDIR)/main ; else sh Resolve main ; fi' + @rm -f nmclash.o a.out + +Emain: Cfiles + sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make $(CURRDIR)/emain ; else sh Resolve emain ; fi' + @rm -f nmclash.o a.out + +install: Main + rm -f $(EMHOME)/lib/em_cemcom + cp $(CURRDIR)/main $(EMHOME)/lib/em_cemcom + +clean: + rm -f $(OBJ) $(GENERATED) + (cd .. ; rm -rf Xsrc) + +lint: Cfiles + sh -c 'if $(CC) nmclash.c > /dev/null 2>&1 ; then make Xlint ; else sh Resolve Xlint ; fi' + @rm -f nmclash.o a.out + +longnames: $(SRC) $(HFILES) + sh -c 'if test -f longnames ; then $(PRID) -l7 longnames $? > Xlongnames ; mv Xlongnames longnames ; else $(PRID) -l7 $? > longnames ; fi' + +# entry points not to be used directly + +Cfiles: hfiles LLfiles $(GENCFILES) $(GHSTRSRC) $(GHSRC) makefile + echo $(SRC) $(HFILES) > Cfiles + +hfiles: ./make.hfiles Parameters + ./make.hfiles Parameters + @touch hfiles + +LLfiles: $(LSRC) + $(GEN) $(GENOPTIONS) $(LSRC) + @touch LLfiles + +tokenfile.g: tokenname.c make.tokfile + tokenfile.g + +symbol2str.c: tokenname.c make.tokcase + symbol2str.c + +char.c: tab char.tab + tab -fchar.tab >char.c + +tab: + $(CC) tab.c -o tab + +next.c: make.next $(NEXTFILES) + ./make.next $(NEXTFILES) >next.c + +code.h: make.allocd +declar.h: make.allocd +decspecs.h: make.allocd +def.h: make.allocd +expr.h: make.allocd +field.h: make.allocd +idf.h: make.allocd +macro.h: make.allocd +stack.h: make.allocd +stmt.h: make.allocd +struct.h: make.allocd +switch.h: make.allocd +type.h: make.allocd + +depend: Cfiles + sed '/^#AUTOAUTO/,$$d' makefile >makefile.new + echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO' >>makefile.new + $(MKDEP) $(SRC) | sed 's/\.c:/.o:/' >>makefile.new + mv makefile makefile.old + mv makefile.new makefile + +#INCLINCLINCLINCL + +$(CURRDIR)/main: $(OBJ) $(CURRDIR)/makefile + $(CC) $(COPTIONS) $(LFLAGS) $(OBJ) $(LIBS) -o $(CURRDIR)/main + size $(CURRDIR)/main + +$(CURRDIR)/emain: $(OBJ) $(CURRDIR)/makefile + $(CC) $(COPTIONS) $(LFLAGS) $(OBJ) $(ELIBS) -o $(CURRDIR)/emain + size $(CURRDIR)/emain + +Xlint: + lint $(CDEFS) $(LINTFLAGS) $(SRC) + +#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO +main.o: LLlex.h Lpars.h arith.h debug.h declar.h file_info.h idf.h input.h inputtype.h level.h maxincl.h nobitfield.h nofloat.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h +idf.o: LLlex.h Lpars.h align.h arith.h assert.h botch_free.h debug.h declar.h decspecs.h def.h file_info.h idf.h idfsize.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h specials.h stack.h struct.h type.h +declarator.o: Lpars.h arith.h botch_free.h declar.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h +decspecs.o: Lpars.h arith.h decspecs.h def.h level.h nobitfield.h nofloat.h spec_arith.h type.h +struct.o: LLlex.h Lpars.h align.h arith.h assert.h botch_free.h debug.h def.h field.h file_info.h idf.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h stack.h struct.h type.h +expr.o: LLlex.h Lpars.h arith.h botch_free.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h +ch7.o: Lpars.h arith.h assert.h debug.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h struct.h type.h +ch7bin.o: Lpars.h arith.h botch_free.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h struct.h type.h +cstoper.o: Lpars.h arith.h assert.h debug.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h target_sizes.h type.h +arith.o: Lpars.h arith.h botch_free.h expr.h field.h idf.h label.h mes.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h +code.o: LLlex.h Lpars.h arith.h assert.h atw.h botch_free.h code.h dataflow.h debug.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h level.h mes.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h specials.h stack.h stmt.h type.h use_tmp.h +dumpidf.o: Lpars.h arith.h debug.h def.h expr.h field.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h static.h struct.h type.h +error.o: LLlex.h arith.h debug.h errout.h expr.h file_info.h label.h nofloat.h nopp.h spec_arith.h tokenname.h use_tmp.h +field.o: Lpars.h arith.h assert.h code.h debug.h expr.h field.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h +tokenname.o: LLlex.h Lpars.h arith.h file_info.h idf.h nofloat.h nopp.h spec_arith.h tokenname.h +LLlex.o: LLlex.h Lpars.h arith.h assert.h class.h debug.h def.h file_info.h idf.h idfsize.h input.h nofloat.h nopp.h numsize.h sizes.h spec_arith.h strsize.h +LLmessage.o: LLlex.h Lpars.h arith.h file_info.h idf.h nofloat.h nopp.h spec_arith.h +input.o: file_info.h input.h inputtype.h nopp.h +domacro.o: LLlex.h Lpars.h arith.h assert.h botch_free.h class.h debug.h file_info.h idf.h idfsize.h ifdepth.h input.h interface.h macro.h nofloat.h nopp.h nparams.h parbufsize.h spec_arith.h textsize.h +replace.o: LLlex.h arith.h assert.h class.h debug.h file_info.h idf.h input.h interface.h macro.h nofloat.h nopp.h pathlength.h spec_arith.h static.h strsize.h +init.o: class.h idf.h interface.h macro.h nopp.h +options.o: align.h arith.h botch_free.h class.h dataflow.h idf.h idfsize.h macro.h maxincl.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h use_tmp.h +scan.o: class.h idf.h input.h interface.h lapbuf.h macro.h nopp.h nparams.h +skip.o: LLlex.h arith.h class.h file_info.h input.h interface.h nofloat.h nopp.h spec_arith.h +stack.o: Lpars.h arith.h botch_free.h debug.h def.h idf.h level.h mes.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h struct.h type.h +type.o: Lpars.h align.h arith.h botch_free.h def.h idf.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h +ch7mon.o: Lpars.h arith.h botch_free.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h +label.o: Lpars.h arith.h def.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h +eval.o: Lpars.h align.h arith.h assert.h atw.h code.h dataflow.h debug.h def.h expr.h idf.h label.h level.h mes.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h stack.h type.h +switch.o: Lpars.h arith.h assert.h botch_free.h code.h debug.h density.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h switch.h type.h +ival.o: Lpars.h align.h arith.h assert.h class.h debug.h def.h expr.h field.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h struct.h type.h +conversion.o: Lpars.h arith.h nobitfield.h nofloat.h sizes.h spec_arith.h type.h +blocks.o: arith.h atw.h label.h nofloat.h sizes.h spec_arith.h stack.h +dataflow.o: dataflow.h +tokenfile.o: Lpars.h +declar.o: LLlex.h Lpars.h arith.h debug.h declar.h decspecs.h def.h expr.h field.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h struct.h type.h +statement.o: LLlex.h Lpars.h arith.h botch_free.h code.h debug.h def.h expr.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h type.h +expression.o: LLlex.h Lpars.h arith.h expr.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h +program.o: LLlex.h Lpars.h arith.h code.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h +Lpars.o: Lpars.h +char.o: class.h +symbol2str.o: Lpars.h diff --git a/lang/cem/cemcom/Resolve b/lang/cem/cemcom/Resolve new file mode 100755 index 000000000..5522cc6f8 --- /dev/null +++ b/lang/cem/cemcom/Resolve @@ -0,0 +1,56 @@ +: create a directory Xsrc with name clashes resolved +: and run make in that directory +: '$Header$' + +case $# in +1) + ;; +*) echo "$0: one argument expected" 1>&2 + exit 1 + ;; +esac +PW=`pwd` +case $1 in +main|emain) + target=$PW/$1 + ;; +Xlint) + target=$1 + ;; +*) echo "$0: $1: Illegal argument" 1>&2 + exit 1 + ;; +esac +if test -d ../Xsrc +then + : +else mkdir ../Xsrc +fi +make longnames +: remove code generating routines from the clashes list as they are defines. +: code generating routine names start with C_ +sed '/^C_/d' < longnames > tmp$$ +cclash -c -l7 tmp$$ > ../Xsrc/Xclashes +rm -f tmp$$ +cd ../Xsrc +if cmp -s Xclashes clashes +then + : +else + mv Xclashes clashes +fi +rm -f makefile +ed - $PW/makefile <<'EOF' +/^#EXCLEXCL/,/^#INCLINCL/d +w makefile +q +EOF +for i in `cat $PW/Cfiles` +do + cat >> makefile < $i +EOF +done +make CURRDIR=$PW $target diff --git a/lang/cem/cemcom/nmclash.c b/lang/cem/cemcom/nmclash.c new file mode 100644 index 000000000..95a9489e6 --- /dev/null +++ b/lang/cem/cemcom/nmclash.c @@ -0,0 +1,5 @@ +/* Accepted if many characters of long names are significant */ +/* $Header$ */ +abcdefghijklmnopr() { } +abcdefghijklmnopq() { } +main() { }