Basic compiler now runs.

--HG--
branch : dtrg-buildsystem
This commit is contained in:
David Given 2013-05-14 18:01:38 +01:00
parent d5f0107746
commit a6ebaeabd0
6 changed files with 49 additions and 6 deletions

View file

@ -1,4 +1,3 @@
include lang/basic/lib/build.mk include lang/basic/lib/build.mk
#include lang/cem/cemcom.ansi/build.mk include lang/basic/src/build.mk
#include lang/cem/libcc.ansi/build.mk

View file

@ -237,7 +237,7 @@ File *stream;
extern char *strchr(); extern char *strchr();
getline() getinputline()
{ {
/* get next input line */ /* get next input line */

44
lang/basic/src/build.mk Normal file
View file

@ -0,0 +1,44 @@
D := lang/basic/src
define build-bem-impl
$(call reset)
$(eval cflags += -I$(OBJDIR)/$D -I$D)
$(call cfile, $D/bem.c)
$(call cfile, $D/symbols.c)
$(call cfile, $D/initialize.c)
$(call cfile, $D/compile.c)
$(call cfile, $D/parsepar.c)
$(call cfile, $D/gencode.c)
$(call cfile, $D/util.c)
$(call cfile, $D/graph.c)
$(call cfile, $D/eval.c)
$(call cfile, $D/func.c)
$(call llgen, $(OBJDIR)/$D, $D/basic.g)
$(eval g := $(OBJDIR)/$D/token.h)
$(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)
$(call file, $(LIBEM_MES))
$(call file, $(LIBEMK))
$(call file, $(LIBEM_DATA))
$(call file, $(LIBALLOC))
$(call file, $(LIBPRINT))
$(call file, $(LIBSTRING))
$(call file, $(LIBSYSTEM))
$(call cprogram, $(BINDIR)/em_bem)
$(call installto, $(PLATDEP)/em_bem)
endef
$(eval $(build-bem-impl))

View file

@ -23,7 +23,7 @@ compileprogram()
prolog2(); /* Some statements are moved from prolog2 to prolog2(); /* Some statements are moved from prolog2 to
epilogcode in the new version of the compiler */ epilogcode in the new version of the compiler */
while( basicline = 0, getline()) while( basicline = 0, getinputline())
(void) LLparse(); (void) LLparse();
epilogcode(); epilogcode();
sys_close(yyin); sys_close(yyin);

View file

@ -644,7 +644,7 @@ prolog2()
C_loi((arith) BEMPTRSIZE); C_loi((arith) BEMPTRSIZE);
C_exa_dnam("trpbuf"); C_exa_dnam("trpbuf");
C_lae_dnam("trpbuf",(arith)0); C_lae_dnam("trpbuf",(arith)0);
C_cal("setjmp"); C_cal("__setjmp");
C_df_ilb(l); C_df_ilb(l);
C_asp((arith)(BEMPTRSIZE+BEMPTRSIZE)); C_asp((arith)(BEMPTRSIZE+BEMPTRSIZE));
C_lfr((arith)BEMINTSIZE); C_lfr((arith)BEMINTSIZE);

View file

@ -156,7 +156,7 @@ end
name abc name abc
from .b from .b
to .k to .k
program {EM}/lib.bin/em_bem program {EM}/lib/ack/em_bem
mapflag -h ABC_F={ABC_F?} -h mapflag -h ABC_F={ABC_F?} -h
mapflag -w ABC_F={ABC_F?} -w mapflag -w ABC_F={ABC_F?} -w
mapflag -L ABC_F={ABC_F?} -L mapflag -L ABC_F={ABC_F?} -L