include lang/cem/build.mk
include lang/basic/build.mk
+include lang/pc/build.mk
include mach/proto/as/build.mk
include mach/proto/ncg/build.mk
$(call llgen, $(OBJDIR)/$D, $D/basic.g)
-$(eval g := $(OBJDIR)/$D/token.h)
+$(eval g := $(OBJDIR)/$D/tokentab.h)
+$(eval $q: $g)
$(eval CLEANABLES += $g)
$g: $D/maketokentab $(OBJDIR)/$D/Lpars.h
@echo TOKENTAB $$@
@mkdir -p $$(dir $$@)
$(hide) cd $(OBJDIR)/$D && $(abspath $$^)
-$(eval $q: $(OBJDIR)/$D/token.h)
$(eval $q: $(OBJDIR)/$D/Lpars.h)
$(eval $q: $(INCDIR)/print.h)
--- /dev/null
+include lang/pc/libpc/build.mk
+include lang/pc/comp/build.mk
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include "parameters.h"
#include "debug.h"
-#include "idfsize.h"
-#include "numsize.h"
-#include "strsize.h"
#include <alloc.h>
#include <em_arith.h>
#include <em_arith.h>
#include <em_label.h>
+#include "parameters.h"
#include "LLlex.h"
#include "Lpars.h"
#include "idf.h"
+#include "parameters.h"
#include "debug.h"
#include <alloc.h>
--- /dev/null
+D := lang/pc/comp
+
+define build-pc-allocd-header
+$2: $1 $D/make.allocd
+ @echo ALLOCD $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) $D/make.allocd < $$^ > $$@
+
+$(eval CLEANABLES += $2)
+$(eval $q: $2)
+endef
+
+define build-pc-next
+$(eval CLEANABLES += $(OBJDIR)/$D/next.c)
+$(OBJDIR)/$D/next.c: $D/make.next $1
+ @echo NEXT $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) $$^ > $$@
+$(call cfile, $(OBJDIR)/$D/next.c)
+
+$(foreach f, $1, $(call build-pc-allocd-header, \
+ $f, $(OBJDIR)/$(basename $f).h))
+endef
+
+define build-pc-impl
+
+$(call reset)
+$(eval cflags += -I$(OBJDIR)/$D -I$D -DSTATIC=static)
+
+$(call cfile, $D/LLlex.c)
+$(call cfile, $D/LLmessage.c)
+$(call cfile, $D/body.c)
+$(call cfile, $D/chk_expr.c)
+$(call cfile, $D/code.c)
+$(call cfile, $D/cstoper.c)
+$(call cfile, $D/def.c)
+$(call cfile, $D/desig.c)
+$(call cfile, $D/enter.c)
+$(call cfile, $D/error.c)
+$(call cfile, $D/idf.c)
+$(call cfile, $D/input.c)
+$(call cfile, $D/label.c)
+$(call cfile, $D/lookup.c)
+$(call cfile, $D/main.c)
+$(call cfile, $D/misc.c)
+$(call cfile, $D/node.c)
+$(call cfile, $D/options.c)
+$(call cfile, $D/progs.c)
+$(call cfile, $D/readwrite.c)
+$(call cfile, $D/scope.c)
+$(call cfile, $D/stab.c)
+$(call cfile, $D/tokenname.c)
+$(call cfile, $D/type.c)
+$(call cfile, $D/typequiv.c)
+
+$(call llgen, $(OBJDIR)/$D, \
+ $(OBJDIR)/$D/tokenfile.g \
+ $D/program.g \
+ $D/declar.g \
+ $D/expression.g \
+ $D/statement.g)
+
+$(eval CLEANABLES += $(OBJDIR)/$D/tokenfile.g)
+$(OBJDIR)/$D/tokenfile.g: $D/make.tokfile $D/tokenname.c
+ @echo TOKENFILE $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) sh $D/make.tokfile < $D/tokenname.c > $$@
+
+$(call tabgen, $D/char.tab)
+
+$(eval $q: $(OBJDIR)/$D/parameters.h)
+
+$(eval CLEANABLES += $(OBJDIR)/$D/parameters.h)
+$(OBJDIR)/$D/parameters.h: $D/Parameters
+ @echo PARAMETERS $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) echo '#ifndef PARAMETERS_H' > $$@
+ $(hide) echo '#define PARAMETERS_H' >> $$@
+ $(hide) grep -v '^!' < $$^ >> $$@
+ $(hide) echo '#endif' >> $$@
+
+$(eval CLEANABLES += $(OBJDIR)/$D/symbol2str.c)
+$(OBJDIR)/$D/symbol2str.c: $D/make.tokcase $D/tokenname.c
+ @echo TOKCASE $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) $D/make.tokcase < $D/tokenname.c > $$@
+$(call cfile, $(OBJDIR)/$D/symbol2str.c)
+
+$(call build-pc-next, \
+ $D/def.H \
+ $D/type.H \
+ $D/node.H \
+ $D/scope.H \
+ $D/desig.H \
+ $D/tmpvar.C \
+ $D/casestat.C)
+
+$(call build-pc-allocd-header, $D/tmpvar.C, $(OBJDIR)/$D/tmpvar.c)
+$(call cfile, $(OBJDIR)/$D/tmpvar.c)
+
+$(call build-pc-allocd-header, $D/casestat.C, $(OBJDIR)/$D/casestat.c)
+$(call cfile, $(OBJDIR)/$D/casestat.c)
+
+$(eval $q: $(OBJDIR)/$D/Lpars.h)
+$(eval $q: $(INCDIR)/idf_pkg.spec)
+$(eval $q: $(INCDIR)/idf_pkg.body)
+$(eval $q: $(INCDIR)/inp_pkg.spec)
+$(eval $q: $(INCDIR)/inp_pkg.body)
+$(eval $q: $(INCDIR)/alloc.h)
+$(eval $q: $(INCDIR)/em_codeEK.h)
+$(eval $q: $(INCDIR)/print.h)
+$(eval $q: $(INCDIR)/system.h)
+
+$(call file, $(LIBEM_MES))
+$(call file, $(LIBEMK))
+$(call file, $(LIBEM_DATA))
+$(call file, $(LIBINPUT))
+$(call file, $(LIBASSERT))
+$(call file, $(LIBALLOC))
+$(call file, $(LIBFLT_ARITH))
+$(call file, $(LIBPRINT))
+$(call file, $(LIBSYSTEM))
+$(call file, $(LIBSTRING))
+$(call cprogram, $(BINDIR)/em_pc)
+$(call installto, $(PLATDEP)/em_pc)
+
+$(call reset)
+$(eval q := $D/em_pc.6)
+$(call installto, $(INSDIR)/share/man/man6/em_pc.6)
+endef
+
+$(eval $(build-pc-impl))
/* C A S E S T A T E M E N T C O D E G E N E R A T I O N */
+#include "parameters.h"
#include "debug.h"
#include <alloc.h>
#include "LLlex.h"
#include "Lpars.h"
#include "chk_expr.h"
-#include "density.h"
#include "main.h"
#include "node.h"
#include "type.h"
/* Check expressions, and try to evaluate them as far as possible.
*/
+#include "parameters.h"
#include "debug.h"
+#include <stdlib.h>
#include <alloc.h>
#include <assert.h>
#include <em_arith.h>
#include <stdlib.h>
#include <string.h>
+#include "parameters.h"
#include "debug.h"
#include <assert.h>
#include <em.h>
#include <stdlib.h>
#include <string.h>
+#include "parameters.h"
#include "debug.h"
-#include "target_sizes.h"
#include <alloc.h>
#include <assert.h>
/* A debugging macro
*/
-#include "debugcst.h"
-
#ifdef DEBUG
#define DO_DEBUG(x, y) ((x) && (y))
#else
/* D E C L A R A T I O N S */
{
-/* next line DEBUG */
+#include "parameters.h"
+/* next line DEBUG */
#include "debug.h"
#include <alloc.h>
#include "node.h"
#include "scope.h"
#include "type.h"
-#include "dbsymtab.h"
#define PC_BUFSIZ (sizeof(struct file) - (int)((struct file *)0)->bufadr)
/* D E F I N I T I O N M E C H A N I S M */
+#include "parameters.h"
#include "debug.h"
#include <alloc.h>
or perform a store.
*/
+#include "parameters.h"
#include "debug.h"
#include <assert.h>
#include <em_arith.h>
#include <em_label.h>
+#include "parameters.h"
#include "LLlex.h"
#include "def.h"
#include "idf.h"
#include "node.h"
#include "scope.h"
#include "type.h"
-#include "dbsymtab.h"
extern int proclevel;
extern int parlevel;
number of arguments!
*/
+#include "parameters.h"
#include "debug.h"
-#include "errout.h"
#if __STDC__
#include <stdarg.h>
/* I N S T A N T I A T I O N O F I D F P A C K A G E */
+#include "parameters.h"
#include "idf.h"
#include <idf_pkg.body>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include "parameters.h"
#include "f_info.h"
struct f_info file_info;
#include "input.h"
/* I N S T A N T I A T I O N O F I N P U T M O D U L E */
-#include "inputtype.h"
-
#define INP_NPUSHBACK 3
#define INP_TYPE struct f_info
#define INP_VAR file_info
#include <alloc.h>
#include <em.h>
+#include "parameters.h"
#include "LLlex.h"
#include "def.h"
#include "idf.h"
#include <em_label.h>
#include <assert.h>
+#include "parameters.h"
#include "LLlex.h"
#include "def.h"
#include "idf.h"
#include <stdlib.h>
#include <string.h>
+#include "parameters.h"
#include "debug.h"
#include <em.h>
#include "tokenname.h"
#include "type.h"
#include "scope.h"
-#include "dbsymtab.h"
char options[128];
char *ProgName;
+echo '#include "parameters.h"'
echo '#include "debug.h"'
sed -n '
s:^.*[ ]ALLOCDEF[ ].*"\(.*\)".*$:struct \1 *h_\1 = 0;\
#include <alloc.h>
#include <em.h>
+#include "parameters.h"
#include "LLlex.h"
#include "f_info.h"
#include "idf.h"
/* N O D E O F A N A B S T R A C T P A R S E T R E E */
+#include "parameters.h"
#include "debug.h"
#include <alloc.h>
#include <em_arith.h>
#include <em_label.h>
+#include "parameters.h"
#include "class.h"
#include "const.h"
-#include "idfsize.h"
#include "main.h"
#include "type.h"
-#include "nocross.h"
-#include "dbsymtab.h"
#define MINIDFSIZE 9
/* The grammar of ISO-Pascal as given by the specification, BS6192: 1982. */
{
+#include "parameters.h"
#include <alloc.h>
#include <em_arith.h>
#include <em_label.h>
#include "main.h"
#include "node.h"
#include "scope.h"
-#include "dbsymtab.h"
}
%lexical LLlex;
+#include "parameters.h"
#include "debug.h"
#include <em.h>
/* R E A D ( L N ) & W R I T E ( L N ) */
+#include "parameters.h"
#include "debug.h"
#include <assert.h>
/* S C O P E M E C H A N I S M */
+#include "parameters.h"
#include "debug.h"
#include <alloc.h>
/* $Id$ */
-#include "dbsymtab.h"
+#include "parameters.h"
#ifdef DBSYMTAB
/* S T A T E M E N T S */
{
+#include "parameters.h"
#include <alloc.h>
#include <em.h>
#include <stb.h>
#include "node.h"
#include "scope.h"
#include "type.h"
-#include "dbsymtab.h"
int slevel = 0; /* nesting level of statements */
}
/* T O K E N D E F I N I T I O N S */
+#include "parameters.h"
#include "Lpars.h"
#include "idf.h"
#include "tokenname.h"
/* T Y P E D E S C R I P T O R S T R U C T U R E */
-#include "dbsymtab.h"
-
struct paramlist { /* structure for parameterlist of a PROCEDURE */
struct paramlist *next;
struct def *par_def; /* "df" of parameter */
*void_type,
*error_type; /* All from type.c */
-#include "nocross.h"
#ifdef NOCROSS
#include "target_sizes.h"
#define word_align (AL_WORD)
/* T Y P E D E F I N I T I O N M E C H A N I S M */
+#include "parameters.h"
#include "debug.h"
#include <alloc.h>
#include "type.h"
#ifndef NOCROSS
-#include "target_sizes.h"
int
word_align = AL_WORD,
int_align = AL_INT,
/* Routines for testing type equivalence & type compatibility.
*/
+#include "parameters.h"
#include "debug.h"
#include <assert.h>
--- /dev/null
+define build-runtime-libpascal-impl
+
+$(call reset)
+$(eval objdir := $(PLATFORM))
+
+$(call ackfile, lang/pc/libpc/abi.c)
+$(call ackfile, lang/pc/libpc/abl.c)
+$(call ackfile, lang/pc/libpc/abr.c)
+$(call ackfile, lang/pc/libpc/arg.c)
+$(call ackfile, lang/pc/libpc/ass.c)
+$(call ackfile, lang/pc/libpc/asz.c)
+$(call ackfile, lang/pc/libpc/atn.c)
+$(call ackfile, lang/pc/libpc/bcp.c)
+$(call ackfile, lang/pc/libpc/bts.e)
+$(call ackfile, lang/pc/libpc/buff.c)
+$(call ackfile, lang/pc/libpc/catch.c)
+$(call ackfile, lang/pc/libpc/clock.c)
+$(call ackfile, lang/pc/libpc/cls.c)
+$(call ackfile, lang/pc/libpc/cvt.c)
+$(call ackfile, lang/pc/libpc/diag.c)
+$(call ackfile, lang/pc/libpc/dis.c)
+$(call ackfile, lang/pc/libpc/efl.c)
+$(call ackfile, lang/pc/libpc/eln.c)
+$(call ackfile, lang/pc/libpc/encaps.e)
+$(call ackfile, lang/pc/libpc/exp.c)
+$(call ackfile, lang/pc/libpc/fef.e)
+$(call ackfile, lang/pc/libpc/fif.e)
+$(call ackfile, lang/pc/libpc/get.c)
+$(call ackfile, lang/pc/libpc/gto.e)
+$(call ackfile, lang/pc/libpc/hlt.c)
+$(call ackfile, lang/pc/libpc/hol0.e)
+$(call ackfile, lang/pc/libpc/incpt.c)
+$(call ackfile, lang/pc/libpc/ini.c)
+$(call ackfile, lang/pc/libpc/log.c)
+$(call ackfile, lang/pc/libpc/mdi.c)
+$(call ackfile, lang/pc/libpc/mdl.c)
+$(call ackfile, lang/pc/libpc/new.c)
+$(call ackfile, lang/pc/libpc/nfa.c)
+$(call ackfile, lang/pc/libpc/nobuff.c)
+$(call ackfile, lang/pc/libpc/notext.c)
+$(call ackfile, lang/pc/libpc/opn.c)
+$(call ackfile, lang/pc/libpc/outcpt.c)
+$(call ackfile, lang/pc/libpc/pac.c)
+$(call ackfile, lang/pc/libpc/pclose.c)
+$(call ackfile, lang/pc/libpc/pcreat.c)
+$(call ackfile, lang/pc/libpc/pentry.c)
+$(call ackfile, lang/pc/libpc/perrno.c)
+$(call ackfile, lang/pc/libpc/pexit.c)
+$(call ackfile, lang/pc/libpc/popen.c)
+$(call ackfile, lang/pc/libpc/put.c)
+$(call ackfile, lang/pc/libpc/rcka.c)
+$(call ackfile, lang/pc/libpc/rdc.c)
+$(call ackfile, lang/pc/libpc/rdi.c)
+$(call ackfile, lang/pc/libpc/rdl.c)
+$(call ackfile, lang/pc/libpc/rdr.c)
+$(call ackfile, lang/pc/libpc/rf.c)
+$(call ackfile, lang/pc/libpc/rln.c)
+$(call ackfile, lang/pc/libpc/rnd.c)
+$(call ackfile, lang/pc/libpc/sav.e)
+$(call ackfile, lang/pc/libpc/sig.e)
+$(call ackfile, lang/pc/libpc/sin.c)
+$(call ackfile, lang/pc/libpc/sqt.c)
+$(call ackfile, lang/pc/libpc/string.c)
+$(call ackfile, lang/pc/libpc/trap.e)
+$(call ackfile, lang/pc/libpc/trp.e)
+$(call ackfile, lang/pc/libpc/unp.c)
+$(call ackfile, lang/pc/libpc/uread.c)
+$(call ackfile, lang/pc/libpc/uwrite.c)
+$(call ackfile, lang/pc/libpc/wdw.c)
+$(call ackfile, lang/pc/libpc/wf.c)
+$(call ackfile, lang/pc/libpc/wrc.c)
+$(call ackfile, lang/pc/libpc/wrf.c)
+$(call ackfile, lang/pc/libpc/wri.c)
+$(call ackfile, lang/pc/libpc/wrl.c)
+$(call ackfile, lang/pc/libpc/wrr.c)
+$(call ackfile, lang/pc/libpc/wrs.c)
+$(call ackfile, lang/pc/libpc/wrz.c)
+
+$(call acklibrary, $(LIBDIR)/$(PLATFORM)/libpascal.a)
+$(call installto, $(PLATIND)/$(PLATFORM)/libpascal.a)
+
+$(call reset)
+$(eval objdir := $(PLATFORM))
+$(call ackfile, lang/pc/libpc/head_pc.e)
+$(call installto, $(PLATIND)/$(PLATFORM)/pascal.o)
+
+endef
+
+build-runtime-libpascal = $(eval $(build-runtime-libpascal-impl))
+
+$(eval RUNTIMES += libpascal)
+
$(call cfile, $D/em.c)
$(eval $q: $(INCDIR)/em_codeEK.h)
+ $(eval $q: $(INCDIR)/em_path.h)
+ $(eval $q: $(INCDIR)/system.h)
+ $(eval $q: $(INCDIR)/local.h)
$(call clibrary, $(LIBDIR)/libem$2.a)
$(eval LIBEM$1 := $o)