--- /dev/null
+BUILDDIR = /tmp/obj
+OBJDIR = $(BUILDDIR)/obj
+BINDIR = $(BUILDDIR)/bin
+LIBDIR = $(BUILDDIR)/lib
+INCDIR = $(BUILDDIR)/include
+INSDIR = $(BUILDDIR)/staging
+
+PLATIND = $(INSDIR)/share/ack
+PLATDEP = $(INSDIR)/lib/ack
+
+CC = gcc
+AR = ar
+RM = rm -f
+CP = cp
+
+hide = @
+
+CFLAGS = \
+ -g \
+ -I$(INCDIR) \
+ -Imodules/h \
+ -Ih
+
+LDFLAGS =
+
+all: installables
+
+.DELETE_ON_ERROR:
+
+include first/core.mk
+
+include modules/src/object/build.mk
+include modules/src/alloc/build.mk
+include modules/src/input/build.mk
+include modules/src/idf/build.mk
+include modules/src/system/build.mk
+include modules/src/string/build.mk
+include modules/src/print/build.mk
+include modules/src/flt_arith/build.mk
+include modules/src/em_code/build.mk
+include modules/src/em_mes/build.mk
+
+include util/amisc/build.mk
+include util/cmisc/build.mk
+include util/ack/build.mk
+include util/LLgen/build.mk
+include util/data/build.mk
+include util/opt/build.mk
+include util/ncgg/build.mk
+include util/arch/build.mk
+
+include lang/cem/build.mk
+
+include mach/proto/as/build.mk
+include mach/proto/ncg/build.mk
+
+include plat/build.mk
+include plat/pc86/build.mk
+include plat/cpm/build.mk
+
+.PHONY: installables
+installables: $(INSTALLABLES)
+
+.PHONY: clean
+clean:
+ @echo CLEAN
+ $(hide) $(RM) $(CLEANABLES)
+
+$(INCDIR)/local.h:
+ @echo LOCAL
+ @mkdir -p $(dir $@)
+ $(hide) echo '#define VERSION 3' > $@
+ $(hide) echo '#define ACKM "pc86"' >> $@
+ $(hide) echo '#define BIGMACHINE 1' >> $@
+ $(hide) echo '#define SYS_5' >> $@
+
+$(INCDIR)/em_path.h:
+ @echo EM_PATH
+ @mkdir -p $(dir $@)
+ $(hide) echo '#define TMP_DIR "/tmp"' > $@
+ $(hide) echo '#define EM_DIR "/tmp/obj/staging"' >> $@
+ $(hide) echo '#define ACK_PATH "share/ack/descr"' >> $@
+
+-include $(DEPENDS)
--- /dev/null
+define reset
+ $(eval q :=)
+ $(eval o :=)
+ $(eval s :=)
+ $(eval cflags :=)
+ $(eval ldflags :=)
+ $(eval objdir :=)
+endef
+
+# --- Host compiler
+
+define cfile-rule
+$o: $s
+ @echo CC $o
+ @mkdir -p $(dir $o)
+ @$(CC) $(CFLAGS) $(cflags) -MM -MQ $d -o $d $s
+ $(hide) $(CC) $(CFLAGS) $(cflags) -c -o $o $s
+endef
+
+define cfile
+ $(eval s := $1)
+ $(eval o := $(OBJDIR)/$(objdir)/$(1:.c=.o))
+ $(eval d := $(OBJDIR)/$(objdir)/$(1:.c=.d))
+ $(eval DEPENDS += $d)
+ $(eval CLEANABLES += $o $d)
+ $(eval q += $o)
+ $(eval $(cfile-rule))
+endef
+
+# --- ACK compiler
+
+define ackfile-rule
+$o: $s $(ACK) \
+ $(PLATIND)/descr/$(PLATFORM) \
+ $(PLATDEP)/$(PLATFORM)/as \
+ $(CCOMPILER) \
+ $(PLATFORM_$(PLATFORM))
+ @echo ACK $o
+ @mkdir -p $(dir $o)
+ $(hide) ACKDIR=$(INSDIR) $(ACK) $(ACKFLAGS) $(ackflags) -m$(PLATFORM) -c -o $o $s
+endef
+
+define ackfile
+ $(eval s := $1)
+ $(eval o := $(OBJDIR)/$(basename $1).o)
+ $(eval d := $(OBJDIR)/$(basename $1).d)
+ $(eval DEPENDS += $d)
+ $(eval CLEANABLES += $o $d)
+ $(eval q += $o)
+ $(eval $(ackfile-rule))
+endef
+
+# --- Add a raw to the queue
+
+define file
+ $(eval q += $1)
+endef
+
+# --- Host compiler linking
+
+define cprogram-rule
+$o: $s
+ @echo CPROGRAM $o
+ @mkdir -p $(dir $o)
+ $(hide) $(CC) $(CFLAGS) $(cflags) $(LDFLAGS) $(ldflags) -o $o $s
+endef
+
+define cprogram
+ $(eval o := $1)
+ $(eval s := $q)
+ $(eval CLEANABLES += $o)
+ $(eval q := $o)
+ $(eval $(cprogram-rule))
+endef
+
+# --- Host library linking
+
+define clibrary-rule
+$o: $s
+ @echo CLIBRARY $o
+ @mkdir -p $(dir $o)
+ @$(RM) $o
+ $(hide) $(AR) qsc $o $s
+endef
+
+define clibrary
+ $(eval o := $1)
+ $(eval s := $q)
+ $(eval CLEANABLES += $o)
+ $(eval q := $o)
+ $(eval $(clibrary-rule))
+endef
+
+# --- ACK library linking
+
+define acklibrary-rule
+$o: $s $(ACKAR)
+ @echo ACKLIBRARY $o
+ @mkdir -p $(dir $o)
+ @$(RM) $o
+ $(hide) $(AAL) q $o $s
+endef
+
+define acklibrary
+ $(eval o := $1)
+ $(eval s := $q)
+ $(eval CLEANABLES += $o)
+ $(eval q := $o)
+ $(eval $(acklibrary-rule))
+endef
+
+# --- Copies a file.
+
+define copyto-rule
+$o: $s
+ @echo CP $o
+ @mkdir -p $(dir $o)
+ $(hide) $(CP) $s $o
+endef
+
+define copyto
+ $(eval o := $1)
+ $(eval s := $q)
+ $(eval CLEANABLES += $o)
+ $(eval q := $o)
+ $(eval $(copyto-rule))
+endef
+
+# --- Installs a file (copies it and adds it to INSTALLABLES).
+
+define installto-rule
+$o: $s
+ @echo INSTALL $o
+ @mkdir -p $(dir $o)
+ $(hide) $(CP) $s $o
+endef
+
+define installto
+ $(eval o := $1)
+ $(eval s := $q)
+ $(eval CLEANABLES += $o)
+ $(eval INSTALLABLES += $o)
+ $(eval q := $o)
+ $(eval $(installto-rule))
+endef
+
+# --- Adds a dependency for the last object file
+
+define dependson
+ $(eval $o: $1)
+endef
+
+# --- Runs yacc.
+
+# $1: directory to put output files
+# $2: input files
+#
+# Output files are compiled via cfile and queued.
+
+define yacc-impl
+ $(eval o := $1/y.tab.c)
+ $(eval CLEANABLES += $o $1/y.tab.h)
+
+$o: $2
+ @echo YACC $o
+ @mkdir -p $(dir $o)
+ $(hide) yacc -t -b $1/y -d $2
+
+ $(call cfile, $o)
+
+$1/y.tab.h: $o
+
+endef
+
+yacc = $(eval $(call yacc-impl,$1,$2))
+
+# --- Runs flex.
+
+# $1: directory to put output files
+# $2: input files
+#
+# Output files are compiled via cfile and queued.
+
+define flex-impl
+
+$(eval o := $1/lex.yy.c)
+$(eval CLEANABLES += $o)
+
+$o: $2
+ @echo FLEX $o
+ @mkdir -p $(dir $o)
+ $(hide) flex -s -t $2 > $o
+
+$(call cfile, $o)
+
+endef
+
+flex = $(eval $(call flex-impl,$1,$2))
+
--- /dev/null
+include lang/cem/cpp.ansi/build.mk
+include lang/cem/cemcom.ansi/build.mk
+include lang/cem/libcc.ansi/build.mk
+
+$(eval CCOMPILER := $(CPPANSI) $(CEMCOMANSI) $(LIBCCANSIHEADERS))
+
/* $Id$ */
/* L E X I C A L A N A L Y Z E R */
-#include "debug.h"
-#include "lint.h"
#include <alloc.h>
-#include "idfsize.h"
-#include "numsize.h"
-#include "strsize.h"
-#include "nopp.h"
+#include "parameters.h"
#include "input.h"
#include "arith.h"
#include "def.h"
*/
#include "file_info.h"
-#include "nopp.h"
/* the structure of a token: */
struct token {
/* PARSER ERROR ADMINISTRATION */
#include <alloc.h>
-#include "idf.h"
#include "arith.h"
#include "LLlex.h"
#include "Lpars.h"
/* $Id$ */
/* A L I G N M E N T D E F I N I T I O N S */
-#include "nocross.h"
-#include "trgt_sizes.h"
+#include "parameters.h"
#ifndef NOCROSS
extern int
semantics of C is a mess.
*/
+#include "parameters.h"
#include <alloc.h>
-#include "debug.h"
-#include "lint.h"
-#include "nobitfield.h"
-#include "idf.h"
#include <flt_arith.h>
#include "arith.h"
#include "sizes.h"
be handy.
*/
-#include "spec_arith.h"
+#include "parameters.h"
#ifndef SPECIAL_ARITHMETICS
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Id$ */
there is no reasonable method to prove that a program is 100%
correct, these assertions are needed in some places.
*/
-#include "debug.h" /* UF */
+
+#include "parameters.h"
#ifdef DEBUG
/* Note: this macro uses parameter substitution inside strings */
/* $Id$ */
/* B L O C K S T O R I N G A N D L O A D I N G */
-#include "lint.h"
+#include "parameters.h"
#ifndef LINT
#include <em.h>
--- /dev/null
+D := lang/cem/cemcom.ansi
+
+define build-cemcom-ansi-allocd-header
+$(eval g := $(OBJDIR)/$D/$(strip $1).h)
+$g: $D/$(strip $1).str $D/make.allocd
+ @echo ALLOCD $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) $D/make.allocd < $$^ > $$@
+
+$(eval CLEANABLES += $g)
+$(eval $q: $g)
+endef
+
+define build-cemcom-ansi-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-cemcom-ansi-allocd-header, \
+ $(basename $(notdir $f))))
+endef
+
+define build-cemcom-ansi-impl
+
+$(call reset)
+$(eval cflags += -I$(OBJDIR)/$D -I$D)
+
+$(call cfile, $D/arith.c)
+$(call dependson, $(INCDIR)/flt_arith.h)
+
+$(call cfile, $D/blocks.c)
+$(call dependson, $(INCDIR)/em_codeEK.h)
+
+$(call cfile, $D/LLlex.c)
+$(call cfile, $D/LLmessage.c)
+
+$(call cfile, $D/ch3.c)
+$(call cfile, $D/ch3bin.c)
+$(call cfile, $D/ch3mon.c)
+$(call cfile, $D/code.c)
+$(call cfile, $D/conversion.c)
+$(call cfile, $D/cstoper.c)
+$(call cfile, $D/dataflow.c)
+$(call cfile, $D/declarator.c)
+$(call cfile, $D/decspecs.c)
+$(call cfile, $D/domacro.c)
+$(call cfile, $D/dumpidf.c)
+$(call cfile, $D/error.c)
+$(call cfile, $D/eval.c)
+$(call cfile, $D/expr.c)
+$(call cfile, $D/field.c)
+$(call cfile, $D/fltcstoper.c)
+$(call cfile, $D/idf.c)
+$(call cfile, $D/init.c)
+$(call cfile, $D/input.c)
+$(call cfile, $D/l_comment.c)
+$(call cfile, $D/l_ev_ord.c)
+$(call cfile, $D/l_lint.c)
+$(call cfile, $D/l_misc.c)
+$(call cfile, $D/l_outdef.c)
+$(call cfile, $D/l_states.c)
+$(call cfile, $D/label.c)
+$(call cfile, $D/main.c)
+$(call cfile, $D/options.c)
+$(call cfile, $D/pragma.c)
+$(call cfile, $D/proto.c)
+$(call cfile, $D/replace.c)
+$(call cfile, $D/skip.c)
+$(call cfile, $D/stab.c)
+$(call cfile, $D/stack.c)
+$(call cfile, $D/struct.c)
+$(call cfile, $D/switch.c)
+$(call cfile, $D/tokenname.c)
+$(call cfile, $D/type.c)
+$(call cfile, $D/util.c)
+
+$(call llgen, $(OBJDIR)/$D, \
+ $(OBJDIR)/$D/tokenfile.g \
+ $D/program.g \
+ $D/declar.g \
+ $D/expression.g \
+ $D/statement.g \
+ $D/ival.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/BigPars
+ @echo PARAMETERS $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) echo '#ifndef PARAMETERS_H' > $$@
+ $(hide) echo '#define PARAMETERS_H' >> $$@
+ $(hide) grep -v '^!' < $D/BigPars >> $$@
+ $(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-cemcom-ansi-next, \
+ $D/code.str \
+ $D/declar.str \
+ $D/def.str \
+ $D/expr.str \
+ $D/field.str \
+ $D/estack.str \
+ $D/util.str \
+ $D/proto.str \
+ $D/replace.str \
+ $D/idf.str \
+ $D/macro.str \
+ $D/stack.str \
+ $D/stmt.str \
+ $D/struct.str \
+ $D/switch.str \
+ $D/type.str \
+ $D/l_brace.str \
+ $D/l_state.str \
+ $D/l_outdef.str)
+
+$(eval $q: $(OBJDIR)/$D/Lpars.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)/cemcom.ansi)
+$(call installto, $(PLATDEP)/em_cemcom.ansi)
+$(eval CEMCOMANSI := $o)
+
+$(call reset)
+$(eval q := $D/cemcom.1)
+$(call installto, $(INSDIR)/share/man/man1/cemcom.6)
+endef
+
+$(eval $(build-cemcom-ansi-impl))
/* $Id$ */
/* S E M A N T I C A N A L Y S I S -- C H A P T E R 3.3 */
-#include "debug.h"
-#include "lint.h"
-#include "nobitfield.h"
-#include "idf.h"
+#include "parameters.h"
#include <flt_arith.h>
#include "arith.h"
+#include "idf.h"
#include "proto.h"
#include "type.h"
#include "struct.h"
/* $Id$ */
/* SEMANTIC ANALYSIS (CHAPTER 3.3) -- BINARY OPERATORS */
-#include "botch_free.h"
-#include "debug.h"
+#include "parameters.h"
#include <alloc.h>
-#include "lint.h"
-#include "idf.h"
#include <flt_arith.h>
#include "arith.h"
#include "type.h"
/* $Id$ */
/* SEMANTIC ANALYSIS (CHAPTER 3.3) -- MONADIC OPERATORS */
-#include "botch_free.h"
-#include "debug.h"
+#include "parameters.h"
#include <alloc.h>
-#include "nobitfield.h"
#include "Lpars.h"
#include <flt_arith.h>
+#include "idf.h"
#include "arith.h"
#include "type.h"
#include "label.h"
#include "expr.h"
-#include "idf.h"
#include "def.h"
#include "sizes.h"
#include <stdlib.h>
#include <string.h>
-#include "lint.h"
-#include "debug.h"
-#include "dbsymtab.h"
+#include "parameters.h"
#ifndef LINT
#include <em.h>
#else
#include "l_em.h"
#include "l_lint.h"
#endif /* LINT */
-#include "botch_free.h"
#include <alloc.h>
-#include "dataflow.h"
-#include "use_tmp.h"
#include <flt_arith.h>
+#include "idf.h"
#include "arith.h"
#include "type.h"
-#include "idf.h"
#include "label.h"
#include "code.h"
#include "stmt.h"
/* $Id$ */
/* C O N V E R S I O N - C O D E G E N E R A T O R */
-#include "lint.h"
+#include "parameters.h"
#ifndef LINT
#include <em.h>
/* $Id$ */
/* C O N S T A N T E X P R E S S I O N H A N D L I N G */
-#include "trgt_sizes.h"
-#include "idf.h"
+#include "parameters.h"
#include <flt_arith.h>
#include "arith.h"
#include "type.h"
Use the compiler option --d.
*/
-#include "dataflow.h" /* UF */
+#include "parameters.h" /* UF */
#ifdef DATAFLOW
char *CurrentFunction = 0;
/* DECLARATION SYNTAX PARSER */
{
-#include "lint.h"
-#include "dbsymtab.h"
+#include "parameters.h"
#include <alloc.h>
-#include "nobitfield.h"
-#include "debug.h"
#include <flt_arith.h>
+#include "idf.h"
#include "arith.h"
#include "LLlex.h"
#include "label.h"
#include "code.h"
-#include "idf.h"
#include "type.h"
#include "proto.h"
#include "struct.h"
/* $Id$ */
/* D E C L A R A T O R M A N I P U L A T I O N */
-#include "debug.h"
-#include "botch_free.h"
+#include "parameters.h"
#include <alloc.h>
#include <flt_arith.h>
#include "arith.h"
#include "Lpars.h"
#include "declar.h"
#include "def.h"
-#include "idf.h"
#include "label.h"
#include "expr.h"
#include "sizes.h"
/* $Id$ */
/* IDENTIFIER DEFINITION DESCRIPTOR */
-#include "lint.h"
+#include "parameters.h"
struct def { /* for ordinary tags */
struct def *next;
/* $Id$ */
/* PREPROCESSOR: CONTROLLINE INTERPRETER */
-#include "debug.h"
+#include <stdlib.h>
+#include "parameters.h"
+#include "idf.h"
#include "arith.h"
#include "LLlex.h"
#include "Lpars.h"
-#include "idf.h"
#include "input.h"
-#include "nopp.h"
-#include "lint.h"
+#include "replace.h"
#ifndef NOPP
-#include "ifdepth.h"
-#include "botch_free.h"
-#include "nparams.h"
-#include "parbufsize.h"
-#include "textsize.h"
-#include "idfsize.h"
#include "assert.h"
#include <alloc.h>
#include "class.h"
#include "macro.h"
-#include "macbuf.h"
-#include "replace.h"
-#include "dbsymtab.h"
#ifdef DBSYMTAB
#include <stb.h>
#include <em.h>
/* $Id$ */
/* DUMP ROUTINES */
-#include "debug.h"
#ifdef DEBUG
+#include "parameters.h"
#include <alloc.h>
-#include "nopp.h"
-#include "nobitfield.h"
#include <flt_arith.h>
#include "arith.h"
#include "stack.h"
-#include "idf.h"
#include "def.h"
#include "type.h"
#include "proto.h"
/* $Id$ */
/* E R R O R A N D D I A G N O S T I C R O U T I N E S */
-#include "lint.h"
+#include "parameters.h"
#if __STDC__
#include <stdarg.h>
#else
#include "l_em.h"
#endif /* LINT */
-#include "debug.h"
-#include "lint.h"
-#include "nopp.h"
-#include "errout.h"
-
#include "tokenname.h"
#include <flt_arith.h>
#include "arith.h"
/* $Id$ */
/* EXPRESSION-CODE GENERATOR */
-#include "lint.h"
+#include "parameters.h"
#ifndef LINT
#include <em.h>
#include <em_reg.h>
#include <alloc.h>
-#include "debug.h"
-#include "nobitfield.h"
-#include "dataflow.h"
#include <flt_arith.h>
+#include "idf.h"
#include "arith.h"
#include "type.h"
-#include "idf.h"
#include "label.h"
#include "code.h"
#include "assert.h"
extern int err_occurred; /* error.c */
/* EVAL() is the main expression-tree evaluator, which turns
- any legal expression tree into EM code. Parameters:
+ any legal expression tree into EM code. parameters.h:
struct expr *expr
pointer to root of the expression tree to be evaluated
/* $Id$ */
/* EXPRESSION TREE HANDLING */
-#include "lint.h"
-#include "debug.h"
+#include <stdlib.h>
+#include "parameters.h"
#include "assert.h"
-#include "botch_free.h"
#include <alloc.h>
-#include "idf.h"
#include <flt_arith.h>
+#include "idf.h"
#include "arith.h"
#include "def.h"
#include "type.h"
#include "declar.h"
#include "sizes.h"
#include "level.h"
-#include "use_tmp.h"
extern char *symbol2str();
extern char options[];
{
#include <alloc.h>
-#include "lint.h"
-#include "debug.h"
+#include "parameters.h"
#include <flt_arith.h>
#include "arith.h"
#include "LLlex.h"
#include "type.h"
-#include "idf.h"
#include "label.h"
#include "expr.h"
#include "code.h"
/* $Id$ */
/* BITFIELD EXPRESSION EVALUATOR */
-#include "lint.h"
+#include "parameters.h"
#ifndef LINT
-#include "nobitfield.h"
#ifndef NOBITFIELD
#include <em.h>
#include <em_reg.h>
-#include "debug.h"
#include <flt_arith.h>
#include "arith.h"
#include "type.h"
-#include "idf.h"
#include "label.h"
#include "code.h"
#include "assert.h"
/* C O N S T A N T E X P R E S S I O N H A N D L I N G */
/* F O R F L O A T I N G P O I N T N U M B E R S */
-#include "debug.h"
+#include "parameters.h"
#include "assert.h"
#include <alloc.h>
-#include "trgt_sizes.h"
-#include "idf.h"
#include <flt_arith.h>
#include "arith.h"
#include "type.h"
#include <stdlib.h>
#include <string.h>
-#include "lint.h"
+#include "parameters.h"
#include <em_reg.h>
-#include "debug.h"
-#include "idfsize.h"
-#include "botch_free.h"
-#include "nopp.h"
-#include "nparams.h"
#include <alloc.h>
+#include "idf.h"
#include "arith.h"
#include "align.h"
#include "LLlex.h"
#include "level.h"
#include "stack.h"
-#include "idf.h"
#include "label.h"
#include "def.h"
#include "type.h"
/* $Id$ */
/* IDENTIFIER DESCRIPTOR */
-#include "nopp.h"
+#include "parameters.h"
struct id_u {
#ifndef NOPP
#include <stdlib.h>
#include <string.h>
-#include "nopp.h"
+#include "parameters.h"
#ifndef NOPP
#include <system.h>
#include <alloc.h>
#include <time.h>
+#include "idf.h"
#include "class.h"
#include "macro.h"
-#include "idf.h"
extern char *sprint();
*/
/* $Id$ */
+#include "parameters.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include "inputtype.h"
#include "file_info.h"
#include "input.h"
#define INP_TYPE struct file_info
#define INP_VAR finfo
struct file_info finfo;
-#include "nopp.h"
#include <inp_pkg.body>
#include <alloc.h>
-#include "dbsymtab.h"
-#include "lint.h"
#ifndef NOPP
#ifdef DBSYMTAB
#include <stb.h>
/* CODE FOR THE INITIALISATION OF GLOBAL VARIABLES */
{
-#include "lint.h"
+#include <stdlib.h>
+#include "parameters.h"
#ifndef LINT
#include <em.h>
#else
#include "l_em.h"
#include "l_lint.h"
#endif /* LINT */
-#include "debug.h"
#include <alloc.h>
#include <assert.h>
-#include "nobitfield.h"
#include <flt_arith.h>
+#include "idf.h"
#include "arith.h"
#include "label.h"
#include "expr.h"
#include "Lpars.h"
#include "sizes.h"
#include "align.h"
-#include "idf.h"
#include "level.h"
#include "def.h"
#include "LLlex.h"
#include "estack.h"
+#include "stack.h"
#define con_nullbyte() C_con_ucon("0", (arith)1)
#define aggregate_type(tp) ((tp)->tp_fund == ARRAY || (tp)->tp_fund == STRUCT)
/* $Id$ */
/* Lint-specific comment handling */
+#include "parameters.h"
#include <ctype.h>
-#include "lint.h"
-
#ifdef LINT
#include <alloc.h>
/* $Id$ */
/* Lint evaluation order checking */
-#include "lint.h"
+#include "parameters.h"
#ifdef LINT
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
-#include "idf.h"
#include "def.h"
#include "code.h" /* RVAL etc */
#include "LLlex.h"
/* $Id$ */
/* Lint main routines */
-#include "lint.h"
+#include "parameters.h"
#ifdef LINT
#include <alloc.h> /* for st_free */
-#include "debug.h"
#include "interface.h"
#include "assert.h"
#ifdef ANSI
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
-#include "idf.h"
#include "def.h"
#include "code.h" /* RVAL etc */
#include "LLlex.h"
/* $Id$ */
/* Lint miscellaneous routines */
-#include "lint.h"
+#include "parameters.h"
#ifdef LINT
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
-#include "idf.h"
#include "def.h"
#include "code.h" /* RVAL etc */
#include "LLlex.h"
/* $Id$ */
/* Lint outdef construction */
-#include "lint.h"
+#include "parameters.h"
#ifdef LINT
#include "def.h"
#include "struct.h"
#include "field.h"
-#include "idf.h"
#include "level.h"
#include "label.h"
#include "code.h"
/* $Id$ */
/* Lint status checking */
-#include "lint.h"
+#include "parameters.h"
#ifdef LINT
#include <alloc.h> /* for st_free */
#include "interface.h"
#include "assert.h"
-#include "debug.h"
#ifdef ANSI
#include <flt_arith.h>
#endif /* ANSI */
#include "arith.h"
#include "label.h"
#include "expr.h"
-#include "idf.h"
#include "def.h"
#include "code.h" /* RVAL etc */
#include "LLlex.h"
/* $Id$ */
/* L A B E L H A N D L I N G */
+#include "parameters.h"
+#include "idf.h"
#include "Lpars.h"
#include "level.h"
-#include "idf.h"
#include "label.h"
#include "arith.h"
#include "def.h"
/* $Id$ */
/* PREPROCESSOR: DEFINITION OF MACRO DESCRIPTOR */
-#include "nopp.h"
+#include "parameters.h"
#ifndef NOPP
/* The flags of the mc_flag field of the macro structure. Note that
/* $Id$ */
/* MAIN PROGRAM */
-#include "lint.h"
+#include "parameters.h"
#include <system.h>
-#include "debug.h"
-#include "nopp.h"
-#include "trgt_sizes.h"
-#include "use_tmp.h"
-#include "inputtype.h"
+#include "idf.h"
#include "input.h"
#include "level.h"
-#include "idf.h"
#include "arith.h"
#include "type.h"
#include "proto.h"
#include "LLlex.h"
#include <alloc.h>
#include "specials.h"
-#include "nocross.h"
#include "sizes.h"
#include "align.h"
#include "macro.h"
#!/bin/sh
-echo '#include "debug.h"'
+echo '#include "parameters.h"'
sed -n '
s:^.*ALLOCDEF.*"\(.*\)".*$:struct \1 *h_\1 = 0;\
#ifdef DEBUG\
/* $Id$ */
/* U S E R O P T I O N - H A N D L I N G */
+#include "parameters.h"
#include <stdlib.h>
#include <string.h>
-#include "lint.h"
-#include "botch_free.h"
#include <alloc.h>
-#include "nopp.h"
-#include "idfsize.h"
-#include "nobitfield.h"
#include "class.h"
#include "macro.h"
-#include "idf.h"
#include "arith.h"
#include "sizes.h"
#include "align.h"
-#include "use_tmp.h"
-#include "dataflow.h"
-#include "dbsymtab.h"
#ifndef NOPP
extern char **inctable;
/* $Id$ */
/* PREPROCESSOR: PRAGMA INTERPRETER */
-#include "debug.h"
-#include "idf.h"
+#include "parameters.h"
#define P_UNKNOWN 0
#define NR_PRAGMAS 0
%start If_expr, control_if_expression;
{
-#include "lint.h"
-#include "nopp.h"
-#include "debug.h"
+#include "parameters.h"
#include <flt_arith.h>
#include "arith.h"
#include "LLlex.h"
-#include "idf.h"
#include "label.h"
#include "type.h"
#include "declar.h"
#include "code.h"
#include "expr.h"
#include "def.h"
+#include "stack.h"
#ifdef LINT
#include "l_lint.h"
#endif /* LINT */
/* $Id$ */
/* P R O T O T Y P E F I D D L I N G */
-#include "lint.h"
-#include "debug.h"
-#include "idfsize.h"
-#include "nparams.h"
-#include "botch_free.h"
+#include "parameters.h"
#include <alloc.h>
+#include "idf.h"
#include "Lpars.h"
#include "level.h"
#include <flt_arith.h>
#include "arith.h"
#include "align.h"
#include "stack.h"
-#include "idf.h"
#include "def.h"
#include "type.h"
#include "struct.h"
#include <stdlib.h>
#include <string.h>
-#include "nopp.h"
+#include "parameters.h"
#ifndef NOPP
-#include "debug.h"
-#include "pathlength.h"
-#include "strsize.h"
-#include "nparams.h"
-#include "idfsize.h"
-#include "numsize.h"
#include <alloc.h>
-#include "idf.h"
+#include "idf.h"
#include "input.h"
#include "macro.h"
#include "arith.h"
#include "LLlex.h"
#include "class.h"
#include "assert.h"
-#include "static.h"
-#include "macbuf.h"
#include "replace.h"
extern struct idf *GetIdentifier();
/* $Id$ */
/* VARIOUS TARGET MACHINE SIZE DESCRIPTORS */
-#include "nocross.h"
-#include "trgt_sizes.h"
+#include "parameters.h"
#ifndef NOCROSS
extern arith
/* $Id$ */
/* PREPROCESSOR: INPUT SKIP FUNCTIONS */
-#include "nopp.h"
+#include "parameters.h"
#include "arith.h"
#include "LLlex.h"
#include "class.h"
/* $Id$ */
-#include "dbsymtab.h"
+#include "parameters.h"
#ifdef DBSYMTAB
#include <flt_arith.h>
#include <stb.h>
+#include "idf.h"
#include "LLlex.h"
#include "stack.h"
#include "def.h"
#include "type.h"
#include "struct.h"
#include "field.h"
-#include "idf.h"
#include "Lpars.h"
#include "level.h"
/* $Id$ */
/* S T A C K / U N S T A C K R O U T I N E S */
-#include "lint.h"
+#include "parameters.h"
#include <system.h>
#ifndef LINT
#include <em.h>
#else
#include "l_em.h"
#endif /* LINT */
-#include "debug.h"
-#include "botch_free.h"
#include <alloc.h>
+#include "idf.h"
#include "Lpars.h"
#include "arith.h"
#include "stack.h"
#include "type.h"
-#include "idf.h"
#include "def.h"
#include "struct.h"
#include "level.h"
/* STATEMENT SYNTAX PARSER */
{
-#include "lint.h"
+#include "parameters.h"
#ifndef LINT
#include <em.h>
#else
#include "l_lint.h"
#endif /* LINT */
-#include "debug.h"
-#include "botch_free.h"
-#include "dbsymtab.h"
-
#include <flt_arith.h>
+#include "idf.h"
#include "arith.h"
#include "LLlex.h"
#include "type.h"
-#include "idf.h"
#include "label.h"
#include "expr.h"
#include "code.h"
/* $Id$ */
/* ADMINISTRATION OF STRUCT AND UNION DECLARATIONS */
-#include "nobitfield.h"
-#include "debug.h"
-#include "botch_free.h"
+#include "parameters.h"
#include <alloc.h>
+#include "idf.h"
#include "arith.h"
#include "stack.h"
-#include "idf.h"
#include "def.h"
#include "type.h"
#include "proto.h"
/* $Id$ */
/* S W I T C H - S T A T E M E N T A D M I N I S T R A T I O N */
-#include "lint.h"
+#include "parameters.h"
#ifndef LINT
#include <em.h>
#else
#include "l_em.h"
#endif /* LINT */
-#include "debug.h"
-#include "botch_free.h"
#include <alloc.h>
-#include "density.h"
#include "Lpars.h"
-#include "idf.h"
#include "label.h"
#include <flt_arith.h>
#include "arith.h"
/* $Id$ */
/* TOKEN NAME DEFINITIONS */
-#include "idf.h"
+#include "parameters.h"
+#include "idf.h"
#include "arith.h"
#include "LLlex.h"
#include "tokenname.h"
/* $Id$ */
/* T Y P E D E F I N I T I O N M E C H A N I S M */
-#include "nobitfield.h"
-#include "debug.h"
-#include "botch_free.h"
+#include "parameters.h"
#include <alloc.h>
+#include "idf.h"
#include "Lpars.h"
#include "arith.h"
#include "type.h"
-#include "idf.h"
#include "def.h"
#include "proto.h"
#include "sizes.h"
/* $Id$ */
/* TYPE DESCRIPTOR */
-#include "nobitfield.h"
-#include "dbsymtab.h"
+#include "parameters.h"
struct type {
struct type *next; /* used for ARRAY and for qualifiers */
allowing re-use.
*/
-#include "lint.h"
+#include "parameters.h"
#ifndef LINT
#include <em.h>
#else
#include <alloc.h>
#include <em_mes.h>
-#include "debug.h"
#include "util.h"
-#include "use_tmp.h"
-#include "regcount.h"
#include "sizes.h"
#include "align.h"
#include "stack.h"
#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, REGISTER)
/* EVAL() is the main expression-tree evaluator, which turns
- any legal expression tree into EM code. Parameters:
+ any legal expression tree into EM code. parameters.h:
struct expr *expr
pointer to root of the expression tree to be evaluated
return 0;
}
if (++mac->mc_count > 100) {
- /* 100 must be some number in Parameters */
+ /* 100 must be some number in parameters.h */
lexwarning("macro %s is assumed recursive",
idef->id_text);
return 0;
/* $Id$ */
/* L E X I C A L A N A L Y Z E R */
-#include "idfsize.h"
-#include "numsize.h"
-#include "strsize.h"
+#include "parameters.h"
#include <alloc.h>
#include "input.h"
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Id$ */
-#include "dobits.h"
+#include "parameters.h"
#ifdef DOBITS
#define bit0 0x01
#define bit1 0x02
--- /dev/null
+D := lang/cem/cpp.ansi
+
+define build-cpp-ansi-allocd-header
+$1: $2 $D/make.allocd
+ @echo ALLOCD $1
+ @mkdir -p $(dir $1)
+ $(hide) $D/make.allocd < $2 > $1
+
+$(eval CLEANABLES += $1)
+endef
+
+define build-cpp-ansi-tokfile
+$(OBJDIR)/$D/tokenfile.g: $D/make.tokfile $D/tokenname.c
+ @echo TOKENFILE $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) sh $D/make.tokfile < $D/tokenname.c > $$@
+
+$(eval CLEANABLES += $(OBJDIR)/$D/tokenfile.g)
+endef
+
+define build-cpp-ansi-tokcase
+$(OBJDIR)/$D/symbol2str.c: $D/make.tokcase $D/tokenname.c
+ @echo TOKCASE $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) sh $D/make.tokcase < $D/tokenname.c > $$@
+
+$(eval CLEANABLES += $(OBJDIR)/$D/symbol2str.c)
+endef
+
+define build-cpp-ansi-next
+$(OBJDIR)/$D/next.c: $D/make.next $D/macro.str $D/replace.str
+ @echo NEXT $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) sh $D/make.next $D/macro.str $D/replace.str > $$@
+
+$(eval CLEANABLES += $(OBJDIR)/$D/next.c)
+endef
+
+define build-cpp-ansi-impl
+ $(eval $(call build-cpp-ansi-next))
+ $(eval $(call build-cpp-ansi-tokcase))
+ $(eval $(call build-cpp-ansi-tokfile))
+ $(eval $(call build-cpp-ansi-allocd-header, \
+ $(OBJDIR)/$D/macro.h, $D/macro.str \
+ ))
+ $(eval $(call build-cpp-ansi-allocd-header, \
+ $(OBJDIR)/$D/replace.h, $D/replace.str \
+ ))
+
+ $(call reset)
+ $(eval cflags += -I$(OBJDIR)/$D -I$D)
+
+ $(call cfile, $D/LLlex.c)
+ $(call cfile, $D/LLmessage.c)
+ $(call cfile, $D/ch3bin.c)
+ $(call cfile, $D/ch3mon.c)
+ $(call cfile, $D/domacro.c)
+ $(call cfile, $D/error.c)
+ $(call cfile, $D/idf.c)
+ $(call cfile, $D/init.c)
+ $(call cfile, $D/input.c)
+ $(call cfile, $D/main.c)
+ $(call cfile, $D/options.c)
+ $(call cfile, $D/preprocess.c)
+ $(call cfile, $D/replace.c)
+ $(call cfile, $D/skip.c)
+ $(call cfile, $D/tokenname.c)
+ $(call cfile, $D/expr.c)
+ $(call cfile, $(OBJDIR)/$D/symbol2str.c)
+ $(call cfile, $(OBJDIR)/$D/next.c)
+
+ $(call llgen, $(OBJDIR)/$D, $(OBJDIR)/$D/tokenfile.g $D/expression.g)
+
+ $(call file, $(LIBINPUT))
+ $(call file, $(LIBASSERT))
+ $(call file, $(LIBALLOC))
+ $(call file, $(LIBPRINT))
+ $(call file, $(LIBSYSTEM))
+ $(call file, $(LIBSTRING))
+
+ $(call tabgen, $D/char.tab)
+
+ $(eval $q: \
+ $(OBJDIR)/$D/macro.h \
+ $(OBJDIR)/$D/Lpars.h \
+ $(INCDIR)/alloc.h \
+ $(INCDIR)/inp_pkg.spec \
+ $(INCDIR)/idf_pkg.spec \
+ $(OBJDIR)/$D/replace.h \
+ $(INCDIR)/system.h \
+ $(INCDIR)/inp_pkg.body \
+ $(INCDIR)/inp_pkg.spec \
+ $(INCDIR)/idf_pkg.body)
+
+ $(call cprogram, $(BINDIR)/cpp.ansi)
+ $(call installto, $(PLATDEP)/cpp.ansi)
+ $(eval CPPANSI := $o)
+
+ $(call reset)
+ $(eval q := $D/ncpp.6)
+ $(call installto, $(INSDIR)/share/man/man6/cpp.ansi.6)
+endef
+
+$(eval $(build-cpp-ansi-impl))
/* $Id$ */
/* PREPROCESSOR: CONTROLLINE INTERPRETER */
+#include <stdlib.h>
#include "arith.h"
#include "LLlex.h"
#include "Lpars.h"
#include "idf.h"
#include "input.h"
-#include "ifdepth.h"
-#include "botch_free.h"
-#include "nparams.h"
-#include "parbufsize.h"
-#include "textsize.h"
-#include "idfsize.h"
-#include "debug.h"
+#include "parameters.h"
#include <assert.h>
#include <alloc.h>
#include "class.h"
#include "macro.h"
#include "bits.h"
-#include "macbuf.h"
#include "replace.h"
extern char options[];
#include <varargs.h>
#endif
+#include "parameters.h"
#include "arith.h"
-#include "errout.h"
#include "LLlex.h"
/* This file contains the (non-portable) error-message and diagnostic
*/
/* $Id$ */
#define INP_PUSHBACK 3
-#include "inputtype.h"
#include <inp_pkg.spec>
/* Note: The following macro only garuantees one PushBack.
/* $Id$ */
/* MAIN PROGRAM */
-#include "debug.h"
+#include <stdlib.h>
+#include "parameters.h"
#include <alloc.h>
#include <assert.h>
#include <system.h>
#include "arith.h"
#include "file_info.h"
-#include "idfsize.h"
#include "idf.h"
#include "macro.h"
+++ /dev/null
-#!/bin/sh
-: Update Files from database
-
-PATH=/bin:/usr/bin
-
-case $# in
-1) ;;
-*) echo use: $0 file >&2
- exit 1
-esac
-
-(
-IFCOMMAND="if [ -r \$FN ] ;\
- then if cmp -s \$FN \$TMP;\
- then rm \$TMP;\
- else mv \$TMP \$FN;\
- echo update \$FN;\
- fi;\
- else mv \$TMP \$FN;\
- echo create \$FN;\
- fi"
-echo 'TMP=.uf$$'
-echo 'FN=$TMP'
-echo 'cat >$TMP <<\!EOF!'
-sed -n '/^!File:/,${
-/^$/d
-/^!File:[ ]*\(.*\)$/s@@!EOF!\
-'"$IFCOMMAND"'\
-FN=\1\
-cat >$TMP <<\\!EOF!@
-p
-}' $1
-echo '!EOF!'
-echo $IFCOMMAND
-) | eval "$(cat)"
#include <stdlib.h>
#include <string.h>
#include "alloc.h"
-#include "idfsize.h"
+#include "parameters.h"
#include "class.h"
#include "macro.h"
#include "idf.h"
-!File: pathlength.h
+#ifndef PARAMETERS_H
+#define PARAMETERS_H
+
#define PATHLENGTH 1024 /* max. length of path to file */
-!File: errout.h
#define ERROUT STDERR /* file pointer for writing messages */
#define MAXERR_LINE 5 /* maximum number of error messages given
on the same input line. */
-!File: idfsize.h
#define IDFSIZE 64 /* maximum significant length of an identifier */
-!File: numsize.h
#define NUMSIZE 256 /* maximum length of a numeric constant */
-!File: nparams.h
#define NPARAMS 32 /* maximum number of parameters of macros */
#define STDC_NPARAMS 31 /* ANSI limit on number of parameters */
-!File: ifdepth.h
#define IFDEPTH 256 /* maximum number of nested if-constructions */
-!File: macbuf.h
#define LAPBUF 128 /* initial size of macro replacement buffer */
#define ARGBUF 128 /* initial size of macro parameter buffer(s) */
-!File: strsize.h
#define ISTRSIZE 16 /* minimum number of bytes allocated for
storing a string */
-!File: botch_free.h
-/*#define BOTCH_FREE 1 /* botch freed memory, as a check */
+#if 0
+#define BOTCH_FREE 1 /* botch freed memory, as a check */
+#endif
-!File: debug.h
-/*#define DEBUG 1 /* perform various self-tests */
+#if 0
+#define DEBUG 1 /* perform various self-tests */
+#endif
#define NDEBUG 1 /* disable assertions */
-!File: parbufsize.h
#define PARBUFSIZE 1024
-!File: textsize.h
#define ITEXTSIZE 16 /* 1st piece of memory for repl. text */
-!File: inputtype.h
-/*#define INP_READ_IN_ONE 1 /* read input file in one. */
+#if 0
+#define INP_READ_IN_ONE 1 /* read input file in one. */
/* If defined, we cannot read from a pipe */
+#endif
-!File: obufsize.h
#define OBUFSIZE 8192 /* output buffer size */
-!File: dobits.h
#define DOBITS 1 /* use trick to reduce symboltable accesses */
-!File: ln_prefix.h
#define LINE_PREFIX "#" /* prefix for generated line directives,
either "#" or "#line"
*/
+#endif
+
#include <system.h>
#include <alloc.h>
#include "input.h"
-#include "obufsize.h"
+#include "parameters.h"
#include "arith.h"
#include "LLlex.h"
#include "class.h"
#include "macro.h"
#include "idf.h"
-#include "idfsize.h"
#include "bits.h"
-#include "ln_prefix.h"
-#include "textsize.h"
char _obuf[OBUFSIZE];
#ifdef DOBITS
#include <stdio.h>
#include <string.h>
-#include "pathlength.h"
-#include "strsize.h"
-#include "nparams.h"
-#include "idfsize.h"
-#include "numsize.h"
+#include "parameters.h"
#include "alloc.h"
#include "idf.h"
#include "input.h"
#include "arith.h"
#include "LLlex.h"
#include "class.h"
-#include "debug.h"
#include "assert.h"
-#include "macbuf.h"
#include "replace.h"
extern char *GetIdentifier();
--- /dev/null
+define build-libcc-ansi-headers-install-one-impl
+ $(call reset)
+ $(eval q := lang/cem/libcc.ansi/headers/$(strip $1))
+ $(call installto, $(PLATIND)/include/ansi/$(strip $1))
+ $(eval LIBCCANSIHEADERS += $o)
+endef
+
+define build-libcc-ansi-headers-impl
+ $(eval g := \
+ sys/time.h \
+ sys/ioctl.h \
+ assert.h \
+ ctype.h \
+ errno.h \
+ float.h \
+ limits.h \
+ math.h \
+ setjmp.h \
+ signal.h \
+ stdarg.h \
+ stddef.h \
+ stdint.h \
+ stdio.h \
+ stdlib.h \
+ string.h \
+ time.h \
+ iso646.h \
+ stdbool.h \
+ locale.h \
+ tgmath.h)
+
+ $(eval LIBCCANSIHEADERS :=)
+ $(foreach f,$g,$(call build-libcc-ansi-headers-install-one-impl,$f))
+endef
+
+$(eval $(build-libcc-ansi-headers-impl))
register struct node *fpl;
struct paramlist **parlist;
{
- /* Parameters in heading of procedural and functional
+ /* parameters.h in heading of procedural and functional
parameters (only types are important, not the names).
*/
register arith nb_pars = 0;
# Don't generate line updating code by default (i.e.: -L flag provided to cem).
# To put it on again: use -NL
var LFLAG=-L
-var MODULA2_INCLUDES=-I{EM}/include/m2
-var OCCAM_INCLUDES=-I{EM}/include/occam
-var C_INCLUDES=-I{EM}/include/ansi
+var MODULA2_INCLUDES=-I{EM}/share/ack/include/m2
+var OCCAM_INCLUDES=-I{EM}/share/ack/include/occam
+var C_INCLUDES=-I{EM}/share/ack/include/ansi
callname ack
name cpp
# no from, this is a preprocessor
to .i
- program {EM}/lib.bin/cpp.ansi
+ program {EM}/lib/ack/cpp.ansi
mapflag -I* CPP_F={CPP_F?} -I*
mapflag -U* CPP_F={CPP_F?} -U*
mapflag -D* CPP_F={CPP_F?} -D*
name f77
from .f
to .c
- program {EM}/lib.bin/f2c
+ program {EM}/lib/ack/f2c
mapflag -ansi F2_F={F2_F?} -A
mapflag -w* F2_F={F2_F?} -w*
args \
name cem
from .c
to .k
- program {EM}/lib.bin/em_cemcom.ansi
+ program {EM}/lib/ack/em_cemcom.ansi
# mapflag -I* CPP_F={CPP_F?} -I*
# mapflag -U* CPP_F={CPP_F?} -U*
# mapflag -D* CPP_F={CPP_F?} -D*
name pc
from .p
to .k
- program {EM}/lib.bin/em_pc
+ program {EM}/lib/ack/em_pc
mapflag -L PC_F={PC_F?} -L
# mapflag -s PC_F={PC_F?} -s
mapflag -_ PC_F={PC_F?} -U
name m2
from .mod.def
to .k
- program {EM}/lib.bin/em_m2
+ program {EM}/lib/ack/em_m2
mapflag -I* M2_INCL={M2_INCL?} -I*
mapflag -L M2_F={M2_F?} -L
mapflag -g* M2_F={M2_F?} -g*
name ocm
from .ocm
to .k
- program {EM}/lib.bin/em_occam
+ program {EM}/lib/ack/em_occam
mapflag -L OCM_F={OCM_F?} -L
mapflag -V* OCM_F={OCM_F?} -V*
args -Vw{w}p{p}l{l} {OCM_F?}
need .b
callname abc
end
-var A68INIT={EM}/lib.bin/em_a68s_init
+var A68INIT={EM}/lib/ack/em_a68s_init
name a68s
from .8.a68
to .k
name encode
from .e
to .k
- program {EM}/lib.bin/em_encode
+ program {EM}/lib/ack/em_encode
args <
prep cond
stdout
name opt
from .k
to .m
- program {EM}/lib.bin/em_opt
+ program {EM}/lib/ack/em_opt
mapflag -LIB OPT_F={OPT_F?} -L
# when running the global optimizer, no multiplication optimization here.
mapflag -O2 OPT2_F=-m0
name ego
from .m.ma
to .gk
- program {EM}/lib.bin/em_ego
+ program {EM}/lib/ack/em_ego
mapflag -EGO-* EGO_F={EGO_F?} -*
# The following lines are obsolete, but here for backwards compatibility.
# They should be removed some day.
# of the em peephole optimizer
from .gk
to .g
- program {EM}/lib.bin/em_opt2
+ program {EM}/lib/ack/em_opt2
# mapflag -LIB OPT_F={OPT_F?} -L
args {OPT_F?} {MACHOPT_F?} <
optimizer
name decode
from .k.m.g.gk
to .e
- program {EM}/lib.bin/em_decode
+ program {EM}/lib/ack/em_decode
args <
stdout
end
--- /dev/null
+define build-as-impl
+ $(call reset)
+
+ $(eval cflags += -Imach/$(ARCH)/as -I$(OBJDIR)/$D)
+ $(eval objdir := $D)
+
+ $(call cfile, mach/proto/as/comm3.c)
+ $(call dependson, $(OBJDIR)/$D/y.tab.h)
+
+ $(call cfile, mach/proto/as/comm4.c)
+ $(call dependson, $(OBJDIR)/$D/y.tab.h)
+
+ $(call cfile, mach/proto/as/comm5.c)
+ $(call dependson, $(OBJDIR)/$D/y.tab.h)
+
+ $(call cfile, mach/proto/as/comm6.c)
+ $(call dependson, $(OBJDIR)/$D/y.tab.h)
+
+ $(call cfile, mach/proto/as/comm7.c)
+ $(call dependson, $(OBJDIR)/$D/y.tab.h)
+
+ $(call cfile, mach/proto/as/comm8.c)
+ $(call dependson, $(OBJDIR)/$D/y.tab.h)
+
+ $(call yacc, $(OBJDIR)/$D, $(OBJDIR)/$D/preprocessed-comm2.y)
+
+$(eval CLEANABLES += $(OBJDIR)/$D/preprocessed-comm2.y)
+$(OBJDIR)/$D/preprocessed-comm2.y: mach/proto/as/comm2.y $(CPPANSI)
+ @echo PREPROCESS $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) $(CPPANSI) -P \
+ -Imach/$(ARCH)/as \
+ -Imach/proto/as \
+ -Ih \
+ mach/proto/as/comm2.y > $$@
+
+ $(call file, $(LIBOBJECT))
+ $(call cprogram, $(BINDIR)/$(PLATFORM)/as)
+ $(call installto, $(PLATDEP)/$(PLATFORM)/as)
+endef
+
+build-as = $(eval $(build-as-impl))
+
--- /dev/null
+define build-ncg-impl
+
+$(call reset)
+
+$(eval cflags += -Imach/$(ARCH)/ncg -I$(OBJDIR)/$D -Imach/proto/ncg)
+$(eval objdir := $D/ncg)
+
+$(call cfile, mach/proto/ncg/codegen.c)
+$(call cfile, mach/proto/ncg/compute.c)
+$(call cfile, mach/proto/ncg/equiv.c)
+$(call cfile, mach/proto/ncg/fillem.c)
+$(call cfile, mach/proto/ncg/gencode.c)
+$(call cfile, mach/proto/ncg/glosym.c)
+$(call cfile, mach/proto/ncg/label.c)
+$(call cfile, mach/proto/ncg/main.c)
+$(call cfile, mach/proto/ncg/move.c)
+$(call cfile, mach/proto/ncg/nextem.c)
+$(call cfile, mach/proto/ncg/reg.c)
+$(call cfile, mach/proto/ncg/regvar.c)
+$(call cfile, mach/proto/ncg/salloc.c)
+$(call cfile, mach/proto/ncg/state.c)
+$(call cfile, mach/proto/ncg/subr.c)
+$(call cfile, mach/proto/ncg/var.c)
+
+$(eval $q: $(OBJDIR)/$D/tables.h)
+$(eval CLEANABLES += $(OBJDIR)/$D/tables.h $(OBJDIR)/$D/table.c)
+$(OBJDIR)/$D/tables.c: $(OBJDIR)/$D/tables.h
+$(OBJDIR)/$D/tables.h: $(NCGG) $(CPPANSI) mach/$(ARCH)/ncg/table
+ @echo NCGG $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) cd $$(dir $$@) && \
+ $(abspath $(CPPANSI)) $(abspath mach/$(ARCH)/ncg/table) | $(abspath $(NCGG))
+ $(hide) mv $(OBJDIR)/$D/tables.H $(OBJDIR)/$D/tables.h
+
+$(call cfile, $(OBJDIR)/$D/tables.c)
+
+$(call file, $(LIBEM_DATA))
+$(call file, $(LIBFLT_ARITH))
+
+$(call cprogram, $(BINDIR)/$(PLATFORM)/ncg)
+$(call installto, $(PLATDEP)/$(PLATFORM)/ncg)
+
+endef
+
+build-ncg = $(eval $(build-ncg-impl))
+
--- /dev/null
+D := modules/src/alloc
+
+define build-liballoc-impl
+ $(call reset)
+ $(call cfile, $D/Malloc.c)
+ $(call cfile, $D/Salloc.c)
+ $(call cfile, $D/Srealloc.c)
+ $(call cfile, $D/Realloc.c)
+ $(call cfile, $D/botch.c)
+ $(call cfile, $D/clear.c)
+ $(call cfile, $D/st_alloc.c)
+ $(call cfile, $D/std_alloc.c)
+ $(call cfile, $D/No_Mem.c)
+ $(call clibrary, $(LIBDIR)/liballoc.a)
+ LIBALLOC := $o
+
+ $(call reset)
+ $(eval q := $D/alloc.h)
+ $(call copyto, $(INCDIR)/alloc.h)
+endef
+
+$(eval $(build-liballoc-impl))
+
--- /dev/null
+D := modules/src/em_code
+
+# $1 = capital letter for library specialisation (E or K)
+# $2 = lowercase letter for library specialisation (e or k)
+# $3 = cflags that specalise this library
+
+define build-em_code-impl
+ $(call reset)
+ $(eval cflags += $3)
+ $(eval objdir := $D/$1)
+ $(call cfile, $D/bhcst.c)
+ $(call cfile, $D/bhdlb.c)
+ $(call cfile, $D/bhdnam.c)
+ $(call cfile, $D/bhfcon.c)
+ $(call cfile, $D/bhicon.c)
+ $(call cfile, $D/bhilb.c)
+ $(call cfile, $D/bhpnam.c)
+ $(call cfile, $D/bhucon.c)
+ $(call cfile, $D/crcst.c)
+ $(call cfile, $D/crdlb.c)
+ $(call cfile, $D/crdnam.c)
+ $(call cfile, $D/crxcon.c)
+ $(call cfile, $D/crilb.c)
+ $(call cfile, $D/crpnam.c)
+ $(call cfile, $D/crscon.c)
+ $(call cfile, $D/cst.c)
+ $(call cfile, $D/dfdlb.c)
+ $(call cfile, $D/dfdnam.c)
+ $(call cfile, $D/dfilb.c)
+ $(call cfile, $D/dlb.c)
+ $(call cfile, $D/dnam.c)
+ $(call cfile, $D/end.c)
+ $(call cfile, $D/endarg.c)
+ $(call cfile, $D/exc.c)
+ $(call cfile, $D/fcon.c)
+ $(call cfile, $D/getid.c)
+ $(call cfile, $D/icon.c)
+ $(call cfile, $D/ilb.c)
+ $(call cfile, $D/insert.c)
+ $(call cfile, $D/internerr.c)
+ $(call cfile, $D/msend.c)
+ $(call cfile, $D/op.c)
+ $(call cfile, $D/opcst.c)
+ $(call cfile, $D/opdlb.c)
+ $(call cfile, $D/opdnam.c)
+ $(call cfile, $D/opilb.c)
+ $(call cfile, $D/opnarg.c)
+ $(call cfile, $D/oppnam.c)
+ $(call cfile, $D/pnam.c)
+ $(call cfile, $D/pro.c)
+ $(call cfile, $D/pronarg.c)
+ $(call cfile, $D/msstart.c)
+ $(call cfile, $D/psdlb.c)
+ $(call cfile, $D/psdnam.c)
+ $(call cfile, $D/pspnam.c)
+ $(call cfile, $D/scon.c)
+ $(call cfile, $D/ucon.c)
+ $(call cfile, $D/C_out.c)
+ $(call cfile, $D/failed.c)
+ $(call cfile, $D/em.c)
+
+ $(eval $q: $(INCDIR)/em_codeEK.h)
+
+ $(call clibrary, $(LIBDIR)/libem$2.a)
+ $(eval LIBEM$1 := $o)
+endef
+
+define build-em_code-header-impl
+$(OBJDIR)/$D/em_codeEK.h: $D/make.em.gen $D/em.nogen h/em_table
+ @echo MAKE_EM_GEN $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) $D/make.em.gen h/em_table > $$@
+ $(hide) cat $D/em.nogen >> $$@
+
+$(call reset)
+$(eval q := $(OBJDIR)/$D/em_codeEK.h)
+$(eval CLEANABLES += $q)
+$(call copyto, $(INCDIR)/em_codeEK.h)
+
+$(eval CLEANABLES += $o)
+$(eval $o: $(INCDIR)/em_pseu.h)
+
+endef
+
+$(eval $(call build-em_code-header-impl))
+$(eval $(call build-em_code-impl,E,e, -DREADABLE_EM))
+$(eval $(call build-em_code-impl,K,k, ))
+
+
they can be written immediately.
*/
+#include <stdlib.h>
#include <em_path.h>
#include <alloc.h>
#include "insert.h"
--- /dev/null
+D := modules/src/em_mes
+
+define build-em_mes-impl
+ $(call reset)
+ $(call cfile, $D/C_ms_err.c)
+ $(call cfile, $D/C_ms_opt.c)
+ $(call cfile, $D/C_ms_emx.c)
+ $(call cfile, $D/C_ms_reg.c)
+ $(call cfile, $D/C_ms_src.c)
+ $(call cfile, $D/C_ms_flt.c)
+ $(call cfile, $D/C_ms_com.c)
+ $(call cfile, $D/C_ms_par.c)
+ $(call cfile, $D/C_ms_ego.c)
+ $(call cfile, $D/C_ms_gto.c)
+ $(call cfile, $D/C_ms_stb.c)
+ $(call cfile, $D/C_ms_std.c)
+
+ $(eval $q: $(INCDIR)/em_codeEK.h)
+
+ $(call clibrary, $(LIBDIR)/libem_mes.a)
+ $(eval LIBEM_MES := $o)
+endef
+
+$(eval $(call build-em_mes-impl))
+
+
--- /dev/null
+D := modules/src/flt_arith
+
+define build-libflt_arith-impl
+ $(call reset)
+ $(call cfile, $D/flt_ar2flt.c)
+ $(call cfile, $D/flt_div.c)
+ $(call cfile, $D/flt_flt2ar.c)
+ $(call cfile, $D/flt_modf.c)
+ $(call cfile, $D/flt_str2fl.c)
+ $(call cfile, $D/flt_cmp.c)
+ $(call cfile, $D/flt_add.c)
+ $(call cfile, $D/b64_add.c)
+ $(call cfile, $D/flt_mul.c)
+ $(call cfile, $D/flt_nrm.c)
+ $(call cfile, $D/b64_sft.c)
+ $(call cfile, $D/flt_umin.c)
+ $(call cfile, $D/flt_chk.c)
+ $(call cfile, $D/split.c)
+ $(call cfile, $D/ucmp.c)
+ $(call clibrary, $(LIBDIR)/libflt_arith.a)
+ LIBFLT_ARITH := $o
+
+ $(call reset)
+ $(eval q := $D/flt_arith.h)
+ $(call copyto, $(INCDIR)/flt_arith.h)
+endef
+
+$(eval $(build-libflt_arith-impl))
+
--- /dev/null
+D := modules/src/idf
+
+define build-libidf-impl
+ $(call reset)
+ $(eval q := $D/idf_pkg.body)
+ $(call copyto, $(INCDIR)/idf_pkg.body)
+
+ $(call reset)
+ $(eval q := $D/idf_pkg.spec)
+ $(call copyto, $(INCDIR)/idf_pkg.spec)
+endef
+
+$(eval $(build-libidf-impl))
+
--- /dev/null
+D := modules/src/input
+
+define build-libinput-impl
+ $(call reset)
+ $(call cfile, $D/AtEoIF.c)
+ $(call cfile, $D/AtEoIT.c)
+ $(call clibrary, $(LIBDIR)/libinput.a)
+ $(eval LIBINPUT := $o)
+
+ $(call reset)
+ $(eval q := $D/inp_pkg.body)
+ $(call copyto, $(INCDIR)/inp_pkg.body)
+
+ $(call reset)
+ $(eval q := $D/inp_pkg.spec)
+ $(call copyto, $(INCDIR)/inp_pkg.spec)
+endef
+
+$(eval $(build-libinput-impl))
+
--- /dev/null
+D := modules/src/object
+
+define build-libobject-impl
+ $(call reset)
+ $(call cfile, $D/rd.c)
+ $(call cfile, $D/rd_arhdr.c)
+ $(call cfile, $D/rd_bytes.c)
+ $(call cfile, $D/rd_int2.c)
+ $(call cfile, $D/rd_long.c)
+ $(call cfile, $D/rd_ranlib.c)
+ $(call cfile, $D/rd_unsig2.c)
+ $(call cfile, $D/wr.c)
+ $(call cfile, $D/wr_arhdr.c)
+ $(call cfile, $D/wr_bytes.c)
+ $(call cfile, $D/wr_int2.c)
+ $(call cfile, $D/wr_long.c)
+ $(call cfile, $D/wr_putc.c)
+ $(call cfile, $D/wr_ranlib.c)
+
+ $(eval $q: $(INCDIR)/local.h)
+
+ $(call clibrary, $(LIBDIR)/libobject.a)
+ LIBOBJECT := $o
+endef
+
+$(eval $(build-libobject-impl))
+
--- /dev/null
+D := modules/src/print
+
+define build-libprint-impl
+ $(call reset)
+ $(call cfile, $D/doprnt.c)
+ $(call cfile, $D/fprint.c)
+ $(call cfile, $D/print.c)
+ $(call cfile, $D/sprint.c)
+ $(call cfile, $D/format.c)
+
+ $(eval $q: $(INCDIR)/system.h)
+
+ $(call clibrary, $(LIBDIR)/libprint.a)
+ LIBPRINT := $o
+
+ $(call reset)
+ $(eval q := $D/print.h)
+ $(call copyto, $(INCDIR)/print.h)
+endef
+
+$(eval $(build-libprint-impl))
+
--- /dev/null
+D := modules/src/string
+
+define build-libstring-impl
+ $(call reset)
+ $(call cfile, $D/bts2str.c)
+ $(call cfile, $D/btscat.c)
+ $(call cfile, $D/btscmp.c)
+ $(call cfile, $D/btscpy.c)
+ $(call cfile, $D/btszero.c)
+ $(call cfile, $D/long2str.c)
+ $(call cfile, $D/str2bts.c)
+ $(call cfile, $D/str2long.c)
+ $(call cfile, $D/strzero.c)
+ $(call clibrary, $(LIBDIR)/libstring.a)
+ LIBSTRING := $o
+endef
+
+$(eval $(build-libstring-impl))
+
--- /dev/null
+D := modules/src/system
+
+define build-libsystem-impl
+ $(call reset)
+ $(call cfile, $D/access.c)
+ $(call cfile, $D/break.c)
+ $(call cfile, $D/chmode.c)
+ $(call cfile, $D/close.c)
+ $(call cfile, $D/create.c)
+ $(call cfile, $D/filesize.c)
+ $(call cfile, $D/open.c)
+ $(call cfile, $D/read.c)
+ $(call cfile, $D/remove.c)
+ $(call cfile, $D/stop.c)
+ $(call cfile, $D/system.c)
+ $(call cfile, $D/time.c)
+ $(call cfile, $D/write.c)
+ $(call cfile, $D/seek.c)
+ $(call cfile, $D/rename.c)
+ $(call clibrary, $(LIBDIR)/libsystem.a)
+ LIBSYSTEM := $o
+
+ $(call reset)
+ $(eval q := $D/system.h)
+ $(call copyto, $(INCDIR)/system.h)
+endef
+
+$(eval $(build-libsystem-impl))
+
--- /dev/null
+
+define build-platform-headers
+$(call reset)
+$(eval q := $D/include/$(strip $1))
+$(call installto, $(PLATIND)/$(PLATFORM)/include/$(strip $1))
+$(eval PLATFORM_HEADERS_$(PLATFORM) += $q)
+endef
+
+define build-platform-impl
+ $(call reset)
+ $(eval q := $D/descr)
+ $(call installto, $(PLATIND)/descr/$(PLATFORM))
+
+ $(foreach f, $1, $(call build-platform-headers, $f))
+
+ $(eval PLATFORM_$(PLATFORM) := \
+ $(PLATFORM_HEADERS_$(PLATFORM)) \
+ $(PLATDEP)/$(PLATFORM)/ncg)
+
+ $(call build-as)
+ $(call build-ncg)
+endef
+
+build-platform = $(eval $(call build-platform-impl, $1))
+
+
--- /dev/null
+ARCH := i80
+PLATFORM := cpm
+OPTIMISATION := -O
+
+D := plat/cpm
+
+$(eval $(call build-platform, \
+ ack/config.h \
+ cpm.h \
+ unistd.h \
+))
+
+include plat/cpm/libsys/build.mk
+
var d=8
var ARCH=i80
var PLATFORM=cpm
-var PLATFORMDIR={EM}/lib/{PLATFORM}
+var PLATFORMDIR={EM}/lib/ack/{PLATFORM}
var CPP_F=-D__unix
var ALIGN=-a0:1 -a1:1 -a2:1 -a3:1 -b0:0x0100
var MACHOPT_F=-m8
# Override the setting in fe so that files compiled for linux386 can see
# the platform-specific headers.
-var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/include/ansi
+var C_INCLUDES=-I{EM}/share/ack/{PLATFORM}/include -I{EM}/share/ack/include/ansi
name be
from .m.g
to .s
- program {EM}/lib.bin/{PLATFORM}/ncg
+ program {EM}/lib/ack/{PLATFORM}/ncg
args <
stdout
need .e
name asopt
from .s
to .so
- program {EM}/lib.bin/{PLATFORM}/top
+ program {EM}/lib/ack/{PLATFORM}/top
args
optimizer
stdin
name as
from .s.so
to .o
- program {EM}/lib.bin/{PLATFORM}/as
+ program {EM}/lib/ack/{PLATFORM}/as
args - -o > <
prep cond
end
name led
from .o.a
to .out
- program {EM}/lib.bin/em_led
+ program {EM}/lib/ack/em_led
mapflag -l* LNAME={PLATFORMDIR}/lib*
mapflag -i SEPID=-b1:0
mapflag -fp FLOATS={EM}/{ILIB}fp
--- /dev/null
+D := plat/cpm/libsys
+
+define build-cpm-libsys-impl
+ $(call reset)
+ $(call ackfile, $D/_bdos.s)
+ $(call ackfile, $D/_hol0.s)
+ $(call ackfile, $D/_inn2.s)
+ $(call ackfile, $D/_trap.s)
+ $(call ackfile, $D/brk.c)
+ $(call ackfile, $D/close.c)
+ $(call ackfile, $D/creat.c)
+ $(call ackfile, $D/errno.s)
+ $(call ackfile, $D/getpid.c)
+ $(call ackfile, $D/isatty.c)
+ $(call ackfile, $D/kill.c)
+ $(call ackfile, $D/lseek.c)
+ $(call ackfile, $D/open.c)
+ $(call ackfile, $D/read.c)
+ $(call ackfile, $D/signal.c)
+ $(call ackfile, $D/time.c)
+ $(call ackfile, $D/write.c)
+
+ $(call acklibrary, $(LIBDIR)/$(PLATFORM)/libsys.a)
+ $(call installto, $(PLATIND)/$(PLATFORM)/libsys.a)
+endef
+
+$(eval $(build-cpm-libsys-impl))
+
--- /dev/null
+ARCH := i86
+PLATFORM := pc86
+OPTIMISATION := -O
+
+D := plat/pc86/
+
+$(eval $(call build-platform, \
+ ack/config.h \
+ unistd.h \
+))
+
+include plat/pc86/libsys/build.mk
+
+
var d=8
var ARCH=i86
var PLATFORM=pc86
-var PLATFORMDIR={EM}/lib/{PLATFORM}
+var PLATFORMDIR={EM}/share/ack/{PLATFORM}
var CPP_F=-D__unix
var ALIGN=-a0:1 -a1:1 -a2:1 -a3:1
var MACHOPT_F=-m8
-# Override the setting in fe so that files compiled for linux386 can see
+# Override the setting in fe so that files compiled for this platform can see
# the platform-specific headers.
-var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/include/ansi
+var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi
name be
from .m.g
to .s
- program {EM}/lib.bin/{PLATFORM}/ncg
+ program {EM}/lib/ack/{PLATFORM}/ncg
args <
stdout
need .e
name as
from .s.so
to .o
- program {EM}/lib.bin/{PLATFORM}/as
+ program {EM}/lib/ack/{PLATFORM}/as
args - -o > <
prep cond
end
name led
from .o.a
to .out
- program {EM}/lib.bin/em_led
+ program {EM}/lib/ack/em_led
mapflag -l* LNAME={PLATFORMDIR}/lib*
mapflag -i SEPID=-b1:0
mapflag -fp FLOATS={EM}/{ILIB}fp
--- /dev/null
+D := plat/pc86/libsys
+
+define build-pc86-libsys-impl
+ $(call reset)
+ $(call ackfile, $D/errno.s)
+ $(call ackfile, $D/_hol0.s)
+ $(call ackfile, $D/_sys_rawread.s)
+ $(call ackfile, $D/_sys_rawwrite.s)
+ $(call ackfile, $D/open.c)
+ $(call ackfile, $D/creat.c)
+ $(call ackfile, $D/close.c)
+ $(call ackfile, $D/read.c)
+ $(call ackfile, $D/write.c)
+ $(call ackfile, $D/brk.c)
+ $(call ackfile, $D/getpid.c)
+ $(call ackfile, $D/kill.c)
+ $(call ackfile, $D/isatty.c)
+ $(call ackfile, $D/lseek.c)
+ $(call ackfile, $D/time.c)
+ $(call ackfile, $D/signal.c)
+ $(call acklibrary, $(LIBDIR)/$(PLATFORM)/libsys.a)
+ $(call installto, $(PLATIND)/$(PLATFORM)/libsys.a)
+endef
+
+$(eval $(build-pc86-libsys-impl))
+
--- /dev/null
+D := util/LLgen
+
+# Rule to build LLgen.
+
+define build-llgen-impl
+ $(call reset)
+ $(eval cflags += -DNON_CORRECTING -DLIBDIR=\"$(abspath $D/lib)\")
+ $(call cfile, $D/src/main.c)
+ $(call cfile, $D/src/gencode.c)
+ $(call cfile, $D/src/compute.c)
+ $(call cfile, $D/src/check.c)
+ $(call cfile, $D/src/reach.c)
+ $(call cfile, $D/src/global.c)
+ $(call cfile, $D/src/name.c)
+ $(call cfile, $D/src/sets.c)
+ $(call cfile, $D/src/alloc.c)
+ $(call cfile, $D/src/machdep.c)
+ $(call cfile, $D/src/cclass.c)
+ $(call cfile, $D/src/savegram.c)
+
+ # These use pre-LLgen'd version of the files. If LLgen.g gets updated,
+ # they need rebuilding. Use the bootstrap script to do this.
+
+ $(call cfile, $D/src/LLgen.c)
+ $(call cfile, $D/src/Lpars.c)
+ $(call cfile, $D/src/tokens.c)
+
+ $(call cprogram, $(BINDIR)/LLgen)
+ LLGEN := $o
+endef
+
+$(eval $(build-llgen-impl))
+
+# Rule to invoke to *use* LLgen.
+#
+# $1: directory to put output files
+# $2: input files
+#
+# Output files are compiled via cfile and queued.
+
+define llgen-impl
+$(eval o := $1/Lpars.c $(patsubst %.g, $(strip $1)/%.c, $(notdir $2)))
+$(eval CLEANABLES += $o $1/Lpars.h)
+
+$o: $1/Lpars.h
+$1/Lpars.h: $2 $(LLGEN)
+ @echo LLGEN $1/Lpars.c
+ @mkdir -p $(dir $o)
+ $(hide) cd $(dir $o) && $(LLGEN) $(abspath $2)
+
+$(foreach f,$o,$(call cfile,$f))
+
+endef
+
+llgen = $(eval $(call llgen-impl,$1,$2))
* Also checks the continuation grammar from the specified grammar.
*/
+# include <stdlib.h>
# include "types.h"
# include "extern.h"
# include "sets.h"
* This file is a mess, it should be cleaned up some time.
*/
+#include <stdlib.h>
# include "types.h"
# include "io.h"
# include "extern.h"
*/
+#include <stdlib.h>
# include "types.h"
# include "extern.h"
# include "io.h"
--- /dev/null
+D := util/ack
+
+define util-ack-makeheaders-rule
+$(eval g := $(OBJDIR)/$D/dmach.c $(OBJDIR)/$D/intable.c)
+$(wordlist 2, $(words $g), $g): $(firstword $g)
+$(firstword $g): $(util-ack-mktables)
+ @echo MKTABLES
+ @mkdir -p $(dir $g)
+ $(hide) cd $(dir $g) && $(util-ack-mktables) $(INSDIR)/share
+
+$(eval CLEANABLES += $g)
+endef
+
+define build-ack-impl
+ $(call reset)
+ $(call cfile, $D/mktables.c)
+ $(call cprogram, $(OBJDIR)/$D/mktables)
+ $(eval util-ack-mktables := $o)
+
+ $(call reset)
+ $(eval cflags += -I$D)
+ $(call cfile, $D/list.c)
+ $(call cfile, $D/data.c)
+ $(call cfile, $D/main.c)
+ $(call cfile, $D/scan.c)
+ $(call cfile, $D/svars.c)
+ $(call cfile, $D/trans.c)
+ $(call cfile, $D/util.c)
+
+ $(call cfile, $D/rmach.c)
+ $(call dependson, $(INCDIR)/em_path.h)
+
+ $(call cfile, $D/run.c)
+ $(call cfile, $D/grows.c)
+
+ $(call cfile, $D/files.c)
+ $(call dependson, $(INCDIR)/em_path.h)
+
+ $(eval $(util-ack-makeheaders-rule))
+ $(call cfile, $(OBJDIR)/$D/dmach.c)
+ $(call cfile, $(OBJDIR)/$D/intable.c)
+
+ $(call cprogram, $(BINDIR)/ack)
+ $(call installto, $(INSDIR)/bin/ack)
+ $(eval ACK := $o)
+
+ $(call reset)
+ $(eval q := lib/descr/fe)
+ $(call installto, $(PLATIND)/descr/fe)
+ $(eval $(ACK): $o)
+
+ $(call reset)
+ $(eval q := $D/ack.1.X)
+ $(call installto, $(INSDIR)/share/man/man1/ack.1)
+endef
+
+$(eval $(build-ack-impl))
*
*/
+#include <stdlib.h>
#include "ack.h"
#include "list.h"
#include "trans.h"
/* */
/**************************************************************************/
+#include <stdlib.h>
#include "ack.h"
#include "grows.h"
*
*/
+#include <stdlib.h>
#include "ack.h"
#include "list.h"
*
*/
+#include <stdlib.h>
+#include <stdio.h>
#include "ack.h"
#include <em_path.h>
#include "list.h"
#include "grows.h"
#include "dmach.h"
#include "data.h"
-#include <stdio.h>
#ifndef NORCSID
static char rcs_id[] = "$Id$" ;
--- /dev/null
+
+define build-simple-tool-impl
+ $(call reset)
+ $(call cfile, util/amisc/$1.c)
+ $(call file, $(LIBOBJECT))
+ $(call cprogram, $(BINDIR)/$1)
+ $(eval INSTALLABLES += $o)
+ $(call installto, $(INSDIR)/bin/$1)
+
+ $(call reset)
+ $(eval q := util/amisc/$1.1)
+ $(call installto, $(INSDIR)/share/man/man1/$1.1)
+endef
+
+build-simple-tool = $(eval $(build-simple-tool-impl))
+
+$(call build-simple-tool,anm)
+$(call build-simple-tool,ashow)
+$(call build-simple-tool,asize)
+$(call build-simple-tool,aslod)
+$(call build-simple-tool,astrip)
+
--- /dev/null
+D := util/arch
+
+define build-aal-impl
+ $(call reset)
+ $(eval cflags += -DAAL)
+
+ $(call cfile, $D/archiver.c)
+
+ $(call file, $(LIBOBJECT))
+ $(call file, $(LIBPRINT))
+ $(call file, $(LIBSTRING))
+ $(call file, $(LIBSYSTEM))
+
+ $(call cprogram, $(BINDIR)/aal)
+ $(call installto, $(INSDIR)/bin/aal)
+ $(eval AAL := $o)
+
+ $(call reset)
+ $(eval q := $D/aal.1)
+ $(call installto, $(INSDIR)/share/man/man1/aal.1)
+endef
+
+$(eval $(build-aal-impl))
--- /dev/null
+# Building tabgen.
+
+define build-tabgen-impl
+ $(call reset)
+ $(call cfile, util/cmisc/tabgen.c)
+ $(call cprogram, $(BINDIR)/tabgen)
+ $(eval TABGEN := $o)
+endef
+
+$(eval $(build-tabgen-impl))
+
+# Using tabgen.
+#
+# $1 = input file
+#
+# Output file is compiled with cfile and queued.
+
+define tabgen-impl
+$(eval g := $(OBJDIR)/$(strip $1).c)
+
+$g: $1 $(TABGEN)
+ @echo TABGEN $g
+ @mkdir -p $(dir $g)
+ $(hide) $(TABGEN) -f$(strip $1) > $g || $(RM) $g
+
+$(eval CLEANABLES += $g)
+$(call cfile,$g)
+endef
+
+tabgen = $(eval $(call tabgen-impl,$1))
+
return 0;
}
if (++mac->mc_count > 100) {
- /* 100 must be some number in Parameters */
+ /* 100 must be some number in parameters.h */
warning("macro %s is assumed recursive",
idef->id_text);
return 0;
--- /dev/null
+D := util/data
+
+define util-data-impl
+
+$(eval g := \
+ $(INCDIR)/em_spec.h \
+ $(INCDIR)/em_pseu.h \
+ $(INCDIR)/em_mnem.h \
+ $(OBJDIR)/$D/em_flag.c \
+ $(OBJDIR)/$D/em_pseu.c \
+ $(OBJDIR)/$D/em_mnem.c)
+
+$(eval CLEANABLES += $g)
+$g: $D/new_table h/em_table
+ @echo DATA
+ @mkdir -p $(dir $g)
+ $(hide) $D/new_table h/em_table $(INCDIR) $(OBJDIR)/$D
+
+$(call reset)
+$(call cfile, $(OBJDIR)/$D/em_flag.c)
+$(call cfile, $(OBJDIR)/$D/em_pseu.c)
+$(call cfile, $(OBJDIR)/$D/em_mnem.c)
+$(call cfile, $D/em_ptyp.c)
+$(call clibrary, $(LIBDIR)/libem_data.a)
+$(eval LIBEM_DATA := $q)
+
+endef
+
+$(eval $(util-data-impl))
#define LP_HEADER lp_extend->lpx_sr.lpx_header
#define LP_INSTR lp_extend->lpx_sr.lpx_instr
-/* Parameters to be provided by environment: */
+/* parameters.h to be provided by environment: */
extern int ovfl_harmful; /* Does overflow during multiplication
* cause a trap ?
--- /dev/null
+D := util/ncgg
+
+define build-ncgg-impl
+
+$(call reset)
+$(eval cflags += -I$D)
+
+$(call yacc, $(OBJDIR)/$D, $D/cgg.y)
+
+$(call flex, $(OBJDIR)/$D, $D/scan.l)
+$(call dependson, $(OBJDIR)/$D/y.tab.h)
+
+$(call cfile, $D/subr.c)
+$(call cfile, $D/main.c)
+$(call cfile, $D/coerc.c)
+$(call cfile, $D/error.c)
+$(call cfile, $D/emlookup.c)
+$(call cfile, $D/expr.c)
+$(call cfile, $D/instruct.c)
+$(call cfile, $D/iocc.c)
+$(call cfile, $D/lookup.c)
+$(call cfile, $D/output.c)
+$(call cfile, $D/set.c)
+$(call cfile, $D/strlookup.c)
+$(call cfile, $D/var.c)
+$(call cfile, $D/hall.c)
+
+$(eval CLEANABLES += $(OBJDIR)/$D/enterkeyw.c)
+$(OBJDIR)/$D/enterkeyw.c: $D/cvtkeywords $D/keywords
+ @echo KEYWORDS $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) cd $$(dir $$@) && sh $(abspath $D/cvtkeywords) $(abspath $D/keywords)
+$(call cfile, $(OBJDIR)/$D/enterkeyw.c)
+
+$(call file, $(LIBEM_DATA))
+$(call cprogram, $(BINDIR)/ncgg)
+$(eval NCGG := $o)
+
+endef
+
+$(eval $(build-ncgg-impl))
{ $$ = $2; }
;
%%
-#include "scan.c"
static char rcsid2[]= "$Id$";
#endif
+#include "param.h"
+#include "varinfo.h"
+#include "lookup.h"
+#include "set.h"
+#include "iocc.h"
+#include "instruct.h"
+#include "expr.h"
+#include "extern.h"
+#include <cgg_cg.h>
+#include <em_reg.h>
+#include "y.tab.h"
+
+extern int emhere;
+
char *mystrcpy();
int myatoi();
--- /dev/null
+D := util/opt
+
+define build-opt-mktab-impl
+
+$(call reset)
+$(eval cflags += -I$D)
+
+$(call yacc, $(OBJDIR)/$D, $D/mktab.y)
+
+$(call flex, $(OBJDIR)/$D, $D/scan.l)
+$(call dependson, $(OBJDIR)/$D/y.tab.h)
+
+$(call file, $(LIBEM_DATA))
+$(call file, -lfl)
+$(call cprogram, $D/mktab)
+
+endef
+
+define build-opt-impl
+
+$(call reset)
+$(eval cflags += -I$D)
+$(call cfile, $D/main.c)
+$(call cfile, $D/getline.c)
+$(call cfile, $D/lookup.c)
+$(call cfile, $D/var.c)
+$(call cfile, $D/process.c)
+$(call cfile, $D/backward.c)
+$(call cfile, $D/util.c)
+$(call cfile, $D/alloc.c)
+$(call cfile, $D/putline.c)
+$(call cfile, $D/cleanup.c)
+$(call cfile, $D/peephole.c)
+$(call cfile, $D/flow.c)
+$(call cfile, $D/tes.c)
+$(call cfile, $D/reg.c)
+
+$(eval CLEANABLES += $(OBJDIR)/$D/pop_push.c)
+$(OBJDIR)/$D/pop_push.c: $D/pop_push.awk h/em_table
+ @echo POP_PUSH $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) awk -f $D/pop_push.awk < h/em_table > $$@
+$(call cfile, $(OBJDIR)/$D/pop_push.c)
+
+$(eval CLEANABLES += $(OBJDIR)/$D/pattern.c)
+$(OBJDIR)/$D/pattern.c: $D/mktab $(OBJDIR)/$D/patterns
+ @echo PATTERNS $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) $D/mktab < $(OBJDIR)/$D/patterns > $$@
+$(call cfile, $(OBJDIR)/$D/pattern.c)
+
+$(eval CLEANABLES += $(OBJDIR)/$D/patterns)
+$(OBJDIR)/$D/patterns: $(CPPANSI) $D/patterns
+ @echo PREPROCESS $$@
+ @mkdir -p $$(dir $$@)
+ $(hide) $(CPPANSI) < $D/patterns > $$@
+
+$(call file, $(LIBEM_DATA))
+$(call file, $(LIBASSERT))
+$(call file, $(LIBPRINT))
+$(call file, $(LIBALLOC))
+$(call file, $(LIBSYSTEM))
+$(call file, $(LIBSTRING))
+
+$(eval $q: $(INCDIR)/em_spec.h)
+
+$(call cprogram, $(BINDIR)/em_opt)
+$(call installto, $(PLATDEP)/em_opt)
+$(eval EM_OPT := $o)
+
+$(call reset)
+$(eval q := $D/em_opt.6)
+$(call installto, $(INSDIR)/share/man/man6/em_opt.6)
+
+endef
+
+$(eval $(build-opt-mktab-impl))
+$(eval $(build-opt-impl))
*/
extern long atol();
+extern char patid[128];
+extern int lino;
+
+#include "y.tab.h"
+
%}
%%
\"[^"]*\" { strncpy(patid,yytext,sizeof(patid)); return(STRING); }