Merge pull request #99 from davidgiven/dtrg-ass

Bodge together a buildable em22 plat for use with int.
This commit is contained in:
David Given 2018-06-14 10:08:17 +09:00 committed by GitHub
commit c9e5190a12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
120 changed files with 427 additions and 165 deletions

View file

@ -24,7 +24,7 @@ BUILDDIR = $(ACK_TEMP_DIR)/ack-build
# What build flags do you want to use for native code?
CFLAGS = -g -Og -Wno-return-type
CFLAGS = -g -Wno-return-type
LDFLAGS =
# Various commands.
@ -72,7 +72,7 @@ BUILDSYSTEM = make
endif
build-file = $(BUILDDIR)/build.$(BUILDSYSTEM)
lua-files = $(shell find * -name '*.lua')
lua-files = $(shell find * -name 'build*.lua')
our-lua = $(BUILDDIR)/lua
# GNU make sets MAKECMDGOALS to the list of targets from the command
@ -109,6 +109,7 @@ $(build-file): first/ackbuilder.lua Makefile $(lua-files) $(our-lua)
@$(our-lua) first/ackbuilder.lua \
first/build.lua build.lua \
--$(BUILDSYSTEM) \
LUA=$(our-lua) \
DEFAULT_PLATFORM=$(DEFAULT_PLATFORM) \
OBJDIR=$(OBJDIR) \
BINDIR=$(BINDIR) \

View file

@ -16,6 +16,7 @@ vars.plats = {
"pc86",
"rpi",
"pdpv7",
"em22",
}
vars.plats_with_tests = {
"linux68k",

View file

@ -150,6 +150,7 @@ definerule("clibrary",
hdrs = { type="targets", default={} },
deps = { type="targets", default={} },
_cfile = { type="object", default=cfile },
suffix = { type="string", default=".o" },
commands = {
type="strings",
default={
@ -167,6 +168,7 @@ definerule("clibrary",
cwd = e.cwd,
srcs = {src},
deps = e.deps,
suffix = e.suffix,
vars = {
["+cflags"] = { "-I"..e.cwd, },
},

View file

@ -123,7 +123,7 @@ int _ioeof(int channel)
return (0);
}
void _close(void)
void _closeall(void)
{
/* close all open files */
int i;

View file

@ -207,7 +207,7 @@ clearstmt { int exp; }
;
closestmt: filelist
| /* empty */ { C_cal("_close"); }
| /* empty */ { C_cal("_closeall"); }
;
filelist { int intv; }

View file

@ -71,11 +71,12 @@ for _, plat in ipairs(vars.plats) do
}
}
local suffix = plat:find("^em") and "m" or "o"
installable {
name = "pkg_"..plat,
map = {
"lang/cem/libcc.ansi/headers+pkg",
["$(PLATIND)/"..plat.."/c-ansi.o"] = "+crt_"..plat,
["$(PLATIND)/"..plat.."/c-ansi."..suffix] = "+crt_"..plat,
["$(PLATIND)/"..plat.."/libc.a"] = "+lib_"..plat,
}
}

View file

@ -18,7 +18,7 @@ extern void _close(int);
#define FAIL 127
extern const char **_penvp;
extern const char **environ;
static const char *exec_tab[] = {
"sh", /* argv[0] */
"-c", /* argument to the shell */
@ -39,7 +39,7 @@ system(const char *str)
_close(i);
if (!str) str = "cd ."; /* just testing for a shell */
exec_tab[2] = str; /* fill in command */
_execve("/bin/sh", exec_tab, _penvp);
_execve("/bin/sh", exec_tab, environ);
/* get here if execve fails ... */
_exit(FAIL); /* see manual page */
}

View file

@ -1,91 +0,0 @@
tail_mon.a
exit.c
gtty.c
signal.c
stty.c
tell.c
time.c
cleanup.c
access.e
acct.e
alarm.e
brk.e
chdir.e
chmod.e
chown.e
chroot.e
close.e
creat.e
dup.e
dup2.e
execl.e
execle.e
execv.e
execve.e
fork.e
fstat.e
ftime.e
getegid.e
geteuid.e
getgid.e
getpid.e
getuid.e
ioctl.e
kill.e
link.e
lock.e
lseek.e
mknod.e
mount.e
mpxcall.e
nice.e
open.e
pause.e
pipe.e
prof.e
ptrace.e
read.e
sbrk.e
setgid.e
setuid.e
setsig.e
sigtrp.e
stat.e
stime.e
sync.e
times.e
umask.e
umount.e
unlink.e
utime.e
wait.e
write.e
errno.e
_alarm.e
_brk.e
_close.e
_creat.e
_dup.e
_dup2.e
_execl.e
_execve.e
_exit.e
_fork.e
_fstat.e
_ftime.e
_getpid.e
_gtty.c
_stty.c
_ioctl.e
_kill.e
_link.e
_lseek.e
_open.e
_pause.e
_pipe.e
_read.e
_sbrk.e
_times.e
_unlink.e
_wait.e
_write.e

View file

@ -1,2 +0,0 @@
/* $Id$ */
_cleanup(){}

View file

@ -45,10 +45,11 @@ for _, plat in ipairs(vars.plats) do
}
}
local suffix = plat:find("^em") and "m" or "o"
installable {
name = "pkg_"..plat,
map = {
["$(PLATIND)/"..plat.."/modula2.o"] = "+mrt_"..plat,
["$(PLATIND)/"..plat.."/modula2."..suffix] = "+mrt_"..plat,
["$(PLATIND)/"..plat.."/libmodula2.a"] = "+lib_"..plat,
"+headers",
}

View file

@ -93,6 +93,6 @@ killbss()
extern int catch();
int (*handler)() = catch;
char **argv = 0, **environ = 0;
char **argv = 0;
int argc = 0;
char *MainLB = 0;

View file

@ -33,10 +33,11 @@ for _, plat in ipairs(vars.plats) do
}
}
local suffix = plat:find("^em") and "m" or "o"
installable {
name = "pkg_"..plat,
map = {
["$(PLATIND)/"..plat.."/pascal.o"] = "+prt_"..plat,
["$(PLATIND)/"..plat.."/pascal."..suffix] = "+prt_"..plat,
["$(PLATIND)/"..plat.."/libpascal.a"] = "+lib_"..plat,
}
}

View file

@ -1,43 +0,0 @@
# $Revision$
var w=2
var p=2
var s=2
var l=4
var f=4
var d=8
var M=em22
var NAME=em22
var LIB=lib/em22/tail_
var RT=lib/em22/head_
var SIZE_FLAG=
var CPP_F=-D__unix
var INCLUDES=-I{EM}/include/_tail_mon
var C_LIB={EM}/{LIB}cc.1s {EM}/{LIB}cc.2g
var OLD_C_LIB={C_LIB}
name asld
from .k.m.a.g
to .out
outfile e.out
program {EM}/lib.bin/em_ass
mapflag -l* LNAME={EM}/{LIB}*
mapflag -+* ASS_F={ASS_F?} -+*
mapflag --* ASS_F={ASS_F?} --*
mapflag -s* SIZE_FLAG=-s*
mapflag -ansi C_LIB={EM}/{LIB}ac
args {SIZE_FLAG} \
({RTS}:.ocm.bas={EM}/{RT}cc) \
({RTS}{ANSI?}:.c={EM}/{RT}cc) \
({RTS}{ANSI?}:.cansi={EM}/{RT}ac) \
({RTS}:.mod={EM}/{RT}m2) \
({RTS}:.p={EM}/{RT}pc) \
-o > < \
(.p:{TAIL}={EM}/{LIB}pc) \
(.bas:{TAIL}={EM}/{LIB}bc) \
(.ocm:{TAIL}={EM}/{LIB}ocm) \
(.mod:{TAIL}={EM}/{LIB}m2) \
(.ocm.bas:{TAIL}={OLD_C_LIB}) \
(.c:{TAIL}={C_LIB}) \
(.b.c.ocm.mod.p.e:{TAIL}={EM}/{LIB}mon) \
({RTS}{ANSI?}:.cansi={EM}/lib/em22/end_em)
linker
end

View file

@ -0,0 +1,8 @@
for _, plat in ipairs(vars.plats) do
acklibrary {
name = "lib_"..plat,
srcs = { "./*.e" },
vars = { plat = plat },
}
end

7
mach/em22/libem/dummy.e Normal file
View file

@ -0,0 +1,7 @@
#
mes 2,_EM_WSIZE,_EM_PSIZE
pro $__this_function_is_never_called,0
end 0

View file

@ -1,5 +0,0 @@
end_e.a
edata.e
em_end.e
end.e
etext.e

View file

@ -0,0 +1,8 @@
for _, plat in ipairs(vars.plats) do
acklibrary {
name = "lib_"..plat,
srcs = { "./*.e" },
vars = { plat = plat },
}
end

View file

@ -8,10 +8,12 @@ definerule("ackfile",
{
srcs = { type="targets" },
deps = { type="targets", default={} },
suffix = { type="string", default=".o" },
suffix = { type="string", optional=true },
},
function (e)
local c = (e.suffix == ".o" and "-c" or "-c"..e.suffix)
local em = e.vars.plat:find("^em")
local suffix = e.suffix or (em and ".m" or ".o")
local c = "-c"..suffix
local plat = e.vars.plat
return cfile {
@ -30,7 +32,7 @@ definerule("ackfile",
"util/misc+pkg",
e.deps
},
suffix = e.suffix,
suffix = suffix,
commands = {
"ACKDIR=$(INSDIR) $(INSDIR)/bin/ack -m%{plat} "..c.." -o %{outs} %{ins} %{hdrpaths} %{ackcflags}"
}
@ -45,6 +47,7 @@ definerule("acklibrary",
deps = { type="targets", default={} },
},
function (e)
local em = e.vars.plat:find("^em")
return clibrary {
name = e.name,
srcs = e.srcs,
@ -54,6 +57,7 @@ definerule("acklibrary",
e.deps
},
_cfile = ackfile,
suffix = em and ".m" or ".o",
commands = {
"rm -f %{outs[1]}",
"ACKDIR=$(INSDIR) $(INSDIR)/bin/aal qc %{outs[1]} %{ins}"
@ -101,6 +105,7 @@ definerule("build_plat_libs",
{
arch = { type="string" },
plat = { type="string" },
em = { type="boolean", default=false },
},
function(e)
local installmap = {

View file

@ -2,7 +2,7 @@
mes 2,EM_WSIZE,EM_PSIZE
exp $_execl
pro $_execl,0
lae _penvp
lae environ
loi EM_PSIZE
lal EM_PSIZE
lal 0

View file

@ -2,7 +2,7 @@
mes 2,EM_WSIZE,EM_PSIZE
exp $execl
pro $execl,0
lae _penvp
lae environ
loi EM_PSIZE
lal EM_PSIZE
lal 0

View file

@ -2,7 +2,7 @@
mes 2,EM_WSIZE,EM_PSIZE
exp $execv
pro $execv,0
lae _penvp
lae environ
loi EM_PSIZE
lal 0
loi 2*EM_PSIZE

12
plat/em/libsys/isatty.c Normal file
View file

@ -0,0 +1,12 @@
/* $Id$ */
isatty(f)
{
char buf[128];
/* not a sgttyb struct; it might not be large enough;
I know for a fact that it is'nt large enough on PC/IX,
where gtty is an ioctl(..., TCGETA, ...)
*/
if (gtty(f, buf) < 0) return 0;
return 1;
}

Some files were not shown because too many files have changed in this diff Show more