Updated to the version 0.1 of Prime Mover (which involves some syntax changes).

This commit is contained in:
dtrg 2006-10-15 00:28:12 +00:00
parent 708a83ef22
commit dbe10d2c19
34 changed files with 299 additions and 222 deletions

View file

@ -11,7 +11,7 @@ ackfile = simple_with_clike_dependencies {
class = "ackfile", class = "ackfile",
CINCLUDES = {REDIRECT, "ACKINCLUDES"}, CINCLUDES = {REDIRECT, "ACKINCLUDES"},
command = { command = {
"%BINDIR%bin/ack %ACKBUILDFLAGS% %ACKINCLUDES% %ACKDEFINES% -c -o %out% %in%" "%BINDIR%bin/ack %ACKBUILDFLAGS% %ACKINCLUDES:cincludes% %ACKDEFINES:cdefines% -c -o %out% %in%"
}, },
outputs = {"%U%-%I%.o"}, outputs = {"%U%-%I%.o"},
} }

View file

@ -1,3 +1,7 @@
-- $Id$
-- $HeadURL: https://svn.sourceforge.net/svnroot/primemover/pm/lib/c.pm $
-- $LastChangedDate: 2006-10-12 20:17:52Z $
-- pm includefile to compile *host* C programs. -- pm includefile to compile *host* C programs.
-- Standard Lua boilerplate. -- Standard Lua boilerplate.
@ -13,9 +17,13 @@ local filetime = pm.filetime
-- Define some variables. -- Define some variables.
CCOMPILER = "gcc" CCOMPILER = "gcc"
CC = "%CCOMPILER% %CBUILDFLAGS% %CDYNINCLUDES% %CINCLUDES% %CDEFINES% %CEXTRAFLAGS% -c -o %out% %in%" CXXCOMPILER = "g++"
CPROGRAM = "%CCOMPILER% %CBUILDFLAGS% %CLINKFLAGS% %CEXTRAFLAGS% -o %out% %in% %CLIBRARIES%" CC = "%CCOMPILER% %CBUILDFLAGS% %CDYNINCLUDES:cincludes% %CINCLUDES:cincludes% %CDEFINES:cdefines% %CEXTRAFLAGS% -c -o %out% %in%"
AR = "%RM% %out% && ar cr %out% %in% && ranlib %out%" CXX = "%CXXCOMPILER% %CBUILDFLAGS% %CDYNINCLUDES:cincludes% %CINCLUDES:cincludes% %CDEFINES:cdefines% %CEXTRAFLAGS% -c -o %out% %in%"
CPROGRAM = "%CCOMPILER% %CBUILDFLAGS% %CLINKFLAGS% %CEXTRAFLAGS% -o %out% %in% %CLIBRARIES:clibraries%"
CXXPROGRAM = "%CXXCOMPILER% %CBUILDFLAGS% %CLINKFLAGS% %CEXTRAFLAGS% -o %out% %in% %CLIBRARIES:clibraries%"
CLIBRARY = "rm -f %out% && ar cr %out% %in% && ranlib %out%"
CBUILDFLAGS = {"-g"} CBUILDFLAGS = {"-g"}
CINCLUDES = EMPTY CINCLUDES = EMPTY
@ -25,6 +33,44 @@ CLINKFLAGS = EMPTY
CDYNINCLUDES = EMPTY CDYNINCLUDES = EMPTY
CLIBRARIES = EMPTY CLIBRARIES = EMPTY
--- Custom string modifiers -------------------------------------------------
local function prepend(rule, arg, prefix)
if (arg == EMPTY) then
return EMPTY
end
local t = {}
for i, j in ipairs(arg) do
t[i] = prefix..j
end
return t
end
function pm.stringmodifier.cincludes(rule, arg)
return prepend(rule, arg, "-I")
end
function pm.stringmodifier.cdefines(rule, arg)
return prepend(rule, arg, "-D")
end
function pm.stringmodifier.clibraries(rule, arg)
if (arg == EMPTY) then
return EMPTY
end
local t = {}
for i, j in ipairs(arg) do
if string_find(j, "%.a$") then
t[i] = j
else
t[i] = "-l"..j
end
end
return t
end
--- Manage C file dependencies ---------------------------------------------- --- Manage C file dependencies ----------------------------------------------
local dependency_cache = {} local dependency_cache = {}
@ -41,7 +87,7 @@ local function calculate_dependencies(filename, includes)
local calcdeps = 0 local calcdeps = 0
calcdeps = function(filename, file) calcdeps = function(filename, file)
file = file or io.open(filename) file = file or io_open(filename)
if not file then if not file then
return return
end end
@ -58,7 +104,7 @@ local function calculate_dependencies(filename, includes)
if f then if f then
for _, path in ipairs(localincludes) do for _, path in ipairs(localincludes) do
local subfilename = path.."/"..f local subfilename = path.."/"..f
local subfile = io.open(subfilename) local subfile = io_open(subfilename)
if subfile then if subfile then
if not deps[subfilename] then if not deps[subfilename] then
deps[subfilename] = true deps[subfilename] = true
@ -116,41 +162,44 @@ simple_with_clike_dependencies = simple {
end, end,
__dependencies = function(self, inputs, outputs) __dependencies = function(self, inputs, outputs)
local cincludes = self.CINCLUDES local cincludes = self:__index("CINCLUDES")
if (type(cincludes) == "string") then if (type(cincludes) == "string") then
cincludes = {cincludes} cincludes = {cincludes}
end end
local includes = {} local includes = {}
for _, i in ipairs(cincludes) do for _, i in ipairs(cincludes) do
local _, _, p = string_find(i, "^-I[ \t]*(.+)$") table_insert(includes, self:__expand(i))
if p then
table_insert(includes, p)
end
end end
local depends = calculate_dependencies(inputs[1], includes) local input = self:__expand(inputs[1])
local depends = calculate_dependencies(input, includes)
if not depends then if not depends then
self:__error("could not determine the dependencies for ", self:__error("could not determine the dependencies for ",
pm.rendertable(inputs)) pm.rendertable({input}))
end end
if pm.verbose then if pm.verbose then
pm.message('"', inputs[1], '" appears to depend on ', pm.message('"', input, '" appears to depend on ',
pm.rendertable(depends)) pm.rendertable(depends))
end end
return depends return depends
end, end,
__buildadditionalchildren = function(self) __buildadditionalchildren = function(self)
self.CDYNINCLUDES = "" self.CDYNINCLUDES = {}
if self.dynamicheaders then if self.dynamicheaders then
for _, i in ipairs(self.dynamicheaders) do for _, i in ipairs(self.dynamicheaders) do
local o = i:__build() local o = i:__build()
if o[1] then if o[1] then
self.CDYNINCLUDES = self.CDYNINCLUDES..' "-I'..string_gsub(o[1], "/[^/]*$", "")..'"' table_insert(self.CDYNINCLUDES, (string_gsub(o[1], "/[^/]*$", "")))
end end
end end
end end
-- If no paths on the list, replace the list with EMPTY so it doesn't
-- expand to anything.
if (table_getn(self.CDYNINCLUDES) == 0) then
self.CDYNINCLUDES = EMPTY
end
end end
} }
@ -162,16 +211,28 @@ cfile = simple_with_clike_dependencies {
outputs = {"%U%-%I%.o"}, outputs = {"%U%-%I%.o"},
} }
cxxfile = simple_with_clike_dependencies {
class = "cxxfile",
command = {"%CXX%"},
outputs = {"%U%-%I%.o"},
}
cprogram = simple { cprogram = simple {
class = "cprogram", class = "cprogram",
command = {"%CPROGRAM%"}, command = {"%CPROGRAM%"},
outputs = {"%U%-%I%"}, outputs = {"%U%-%I%"},
} }
cxxprogram = simple {
class = "cxxprogram",
command = {"%CXXPROGRAM%"},
outputs = {"%U%-%I%"},
}
clibrary = simple { clibrary = simple {
class = "clibrary", class = "clibrary",
command = { command = {
"%AR%" "%CLIBRARY%"
}, },
outputs = {"%U%-%I%.a"}, outputs = {"%U%-%I%.a"},
} }

View file

@ -3,8 +3,8 @@ yacc = simple {
outputs = {"%U%/%I%.c"}, outputs = {"%U%/%I%.c"},
command = { command = {
"yacc -t -b %{return posix.dirname(self.out[1])}%/y -d %in%", "yacc -t -b %out[1]:dirname%/y -d %in%",
"mv %{return posix.dirname(self.out[1])}%/y.tab.c %out%" "mv %out[1]:dirname%/y.tab.c %out[1]%"
} }
} }

View file

@ -4,7 +4,7 @@
local d = ROOTDIR.."lang/basic/lib/" local d = ROOTDIR.."lang/basic/lib/"
lang_basic_runtime = acklibrary { lang_basic_runtime = acklibrary {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I%ROOTDIR%include/_tail_cc"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"},
ackfile (d.."fif.e"), ackfile (d.."fif.e"),
ackfile (d.."fef.e"), ackfile (d.."fef.e"),

View file

@ -156,7 +156,7 @@ lang_cem_ansi_compiler = cprogram {
}, },
cfile_with_headers { cfile_with_headers {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
tabgen (d.."char.tab") tabgen (d.."char.tab")
}, },

View file

@ -156,7 +156,7 @@ lang_cem_compiler = cprogram {
}, },
cfile_with_headers { cfile_with_headers {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
tabgen (d.."char.tab") tabgen (d.."char.tab")
}, },

View file

@ -99,7 +99,7 @@ tool_cpp_ansi = cprogram {
}, },
cfile_with_headers { cfile_with_headers {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
tabgen (d.."char.tab") tabgen (d.."char.tab")
}, },

View file

@ -4,14 +4,14 @@
local d = ROOTDIR.."lang/cem/libcc.ansi/" local d = ROOTDIR.."lang/cem/libcc.ansi/"
local crt = ackfile { local crt = ackfile {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h"},
file (d.."head_ac.e"), file (d.."head_ac.e"),
install = pm.install("%BINDIR%%PLATIND%/%ARCH%/head_ac") install = pm.install("%BINDIR%%PLATIND%/%ARCH%/head_ac")
} }
local libc = acklibrary { local libc = acklibrary {
ACKBUILDFLAGS = {PARENT, "-ansi"}, ACKBUILDFLAGS = {PARENT, "-ansi"},
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I"..d.."headers", "-I%ROOTDIR%include/_tail_cc"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h", d.."headers", "%ROOTDIR%include/_tail_cc"},
outputs = {"%U%/tail_ac.a"}, outputs = {"%U%/tail_ac.a"},
-- assert -- assert
@ -99,7 +99,7 @@ local libc = acklibrary {
ackfile (d.."misc/fdopen.c"), ackfile (d.."misc/fdopen.c"),
ackfile (d.."misc/closedir.c"), ackfile (d.."misc/closedir.c"),
group { group {
ACKINCLUDES = {PARENT, "-DUFS"}, ACKDEFINES = {PARENT, "UFS"},
ackfile (d.."misc/getdents.c") ackfile (d.."misc/getdents.c")
}, },
ackfile (d.."misc/opendir.c"), ackfile (d.."misc/opendir.c"),

View file

@ -4,7 +4,7 @@
local d = ROOTDIR.."lang/cem/libcc/gen/" local d = ROOTDIR.."lang/cem/libcc/gen/"
lang_cem_gen_runtime = acklibrary { lang_cem_gen_runtime = acklibrary {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I%ROOTDIR%include/_tail_cc"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"},
ackfile (d.."abs.c"), ackfile (d.."abs.c"),
ackfile (d.."atof.c"), ackfile (d.."atof.c"),

View file

@ -4,7 +4,7 @@
local d = ROOTDIR.."lang/cem/libcc/math/" local d = ROOTDIR.."lang/cem/libcc/math/"
lang_cem_math_runtime = acklibrary { lang_cem_math_runtime = acklibrary {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I%ROOTDIR%include/_tail_cc"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"},
ackfile (d.."asin.c"), ackfile (d.."asin.c"),
ackfile (d.."atan2.c"), ackfile (d.."atan2.c"),

View file

@ -4,8 +4,8 @@
local d = ROOTDIR.."lang/cem/libcc/mon/" local d = ROOTDIR.."lang/cem/libcc/mon/"
lang_cem_mon_runtime = acklibrary { lang_cem_mon_runtime = acklibrary {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I%ROOTDIR%include/_tail_cc", ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc",
"-I%ROOTDIR%include/_tail_mon"}, "%ROOTDIR%include/_tail_mon"},
ackfile (d.."exit.c"), ackfile (d.."exit.c"),
ackfile (d.."gtty.c"), ackfile (d.."gtty.c"),

View file

@ -4,7 +4,7 @@
local d = ROOTDIR.."lang/cem/libcc/stdio/" local d = ROOTDIR.."lang/cem/libcc/stdio/"
lang_cem_stdio_runtime = acklibrary { lang_cem_stdio_runtime = acklibrary {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I%ROOTDIR%include/_tail_cc"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"},
ackfile (d.."vsprintf.c"), ackfile (d.."vsprintf.c"),
ackfile (d.."vfprintf.c"), ackfile (d.."vfprintf.c"),

View file

@ -69,7 +69,7 @@ local cfile_with_headers = cfile {
} }
lang_m2_compiler = cprogram { lang_m2_compiler = cprogram {
CDEFINES = {PARENT, "-DSTATIC=static"}, CDEFINES = {PARENT, "STATIC=static"},
cfile_with_headers (d.."LLlex.c"), cfile_with_headers (d.."LLlex.c"),
cfile_with_headers (d.."LLmessage.c"), cfile_with_headers (d.."LLmessage.c"),
@ -112,7 +112,7 @@ lang_m2_compiler = cprogram {
}, },
cfile_with_headers { cfile_with_headers {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
tabgen (d.."char.tab") tabgen (d.."char.tab")
}, },
@ -167,7 +167,10 @@ lang_m2_compiler = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.2 2006-07-26 18:19:15 dtrg -- Revision 1.3 2006-10-15 00:28:11 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.2 2006/07/26 18:19:15 dtrg
-- Tweaked the CVS settings. -- Tweaked the CVS settings.
-- --
-- Revision 1.1 2006/07/26 17:12:19 dtrg -- Revision 1.1 2006/07/26 17:12:19 dtrg

View file

@ -4,7 +4,7 @@
local d = ROOTDIR.."lang/m2/libm2/" local d = ROOTDIR.."lang/m2/libm2/"
lang_m2_runtime = acklibrary { lang_m2_runtime = acklibrary {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I%ROOTDIR%include/_tail_cc"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"},
ackfile (d.."Termcap.mod"), ackfile (d.."Termcap.mod"),
ackfile (d.."CSP.mod"), ackfile (d.."CSP.mod"),

View file

@ -16,7 +16,7 @@ local cfile_with_headers = cfile {
} }
lang_occam_compiler = cprogram { lang_occam_compiler = cprogram {
CLIBRARIES = {PARENT, "-lfl"}, CLIBRARIES = {PARENT, "fl"},
cfile_with_headers (d.."builtin.c"), cfile_with_headers (d.."builtin.c"),
cfile_with_headers (d.."code.c"), cfile_with_headers (d.."code.c"),
@ -54,6 +54,9 @@ lang_occam_compiler = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-26 18:23:32 dtrg -- Revision 1.2 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.1 2006/07/26 18:23:32 dtrg
-- Added support for the Occam compiler. -- Added support for the Occam compiler.
-- --

View file

@ -4,7 +4,7 @@
local d = ROOTDIR.."lang/occam/lib/" local d = ROOTDIR.."lang/occam/lib/"
lang_occam_runtime = acklibrary { lang_occam_runtime = acklibrary {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I%ROOTDIR%include/_tail_cc"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"},
ackfile (d.."builtin.c"), ackfile (d.."builtin.c"),
ackfile (d.."chan_strct.c"), ackfile (d.."chan_strct.c"),

View file

@ -64,7 +64,7 @@ local cfile_with_headers = cfile {
} }
lang_pc_compiler = cprogram { lang_pc_compiler = cprogram {
CDEFINES = {PARENT, "-DSTATIC=static"}, CDEFINES = {PARENT, "STATIC=static"},
cfile_with_headers (d.."LLlex.c"), cfile_with_headers (d.."LLlex.c"),
cfile_with_headers (d.."LLmessage.c"), cfile_with_headers (d.."LLmessage.c"),
@ -110,7 +110,7 @@ lang_pc_compiler = cprogram {
}, },
cfile_with_headers { cfile_with_headers {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
tabgen (d.."char.tab") tabgen (d.."char.tab")
}, },
@ -161,6 +161,9 @@ lang_pc_compiler = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-22 21:03:07 dtrg -- Revision 1.2 2006-10-15 00:28:11 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.1 2006/07/22 21:03:07 dtrg
-- Added support for the Pascal compiler. -- Added support for the Pascal compiler.
-- --

View file

@ -4,7 +4,7 @@
local d = ROOTDIR.."lang/pc/libpc/" local d = ROOTDIR.."lang/pc/libpc/"
lang_pc_runtime = acklibrary { lang_pc_runtime = acklibrary {
ACKINCLUDES = {PARENT, "-I%ROOTDIR%h", "-I%ROOTDIR%include/_tail_cc"}, ACKINCLUDES = {PARENT, "%ROOTDIR%h", "%ROOTDIR%include/_tail_cc"},
ackfile (d.."abi.c"), ackfile (d.."abi.c"),
ackfile (d.."abl.c"), ackfile (d.."abl.c"),

View file

@ -3,101 +3,96 @@
local d = ROOTDIR.."mach/6500/libem/" local d = ROOTDIR.."mach/6500/libem/"
proto_libem = aal { libem_6500 = acklibrary {
outputs = {"%U%/libem-%ARCH%.a"}, outputs = {"%U%/libem-%ARCH%.a"},
ackfile (d.."adi4.s"),
ackfile (d.."cmi.s"),
ackfile (d.."cmi4.s"),
ackfile (d.."sbi4.s"),
ackfile (d.."addsub.s"),
ackfile (d.."cmu4.s"),
ackfile (d.."dum_float.s"),
ackfile (d.."dvi4.s"),
ackfile (d.."dvu4.s"),
ackfile (d.."lar.s"),
ackfile (d.."lol.s"),
ackfile (d.."los.s"),
ackfile (d.."loil.s"),
ackfile (d.."loi1.s"),
ackfile (d.."loi.s"),
ackfile (d.."mli4.s"),
ackfile (d.."mlu.s"),
ackfile (d.."mlu4.s"),
ackfile (d.."mul4.s"),
ackfile (d.."rmi.s"),
ackfile (d.."rmi4.s"),
ackfile (d.."div4.s"),
ackfile (d.."rmu.s"),
ackfile (d.."dvi.s"),
ackfile (d.."rmu4.s"),
ackfile (d.."duv4.s"),
ackfile (d.."ngi4.s"),
ackfile (d.."rtt.s"),
ackfile (d.."ret.s"),
ackfile (d.."sar.s"),
ackfile (d.."aar.s"),
ackfile (d.."adi.s"),
ackfile (d.."sbi.s"),
ackfile (d.."mli.s"),
ackfile (d.."ngi.s"),
ackfile (d.."set.s"),
ackfile (d.."zer.s"),
ackfile (d.."stl.s"),
ackfile (d.."sts.s"),
ackfile (d.."sdl.s"),
ackfile (d.."sti.s"),
ackfile (d.."stil.s"),
ackfile (d.."blm.s"),
ackfile (d.."sti1.s"),
ackfile (d.."test2.s"),
ackfile (d.."testFFh.s"),
ackfile (d.."trap.s"),
ackfile (d.."ldi.s"),
ackfile (d.."data.s"),
ackfile (d.."zri.s"),
ackfile (d.."locaddr.s"),
ackfile (d.."and.s"),
ackfile (d.."asp.s"),
ackfile (d.."cii.s"),
ackfile (d.."cms.s"),
ackfile (d.."cmu.s"),
ackfile (d.."com.s"),
ackfile (d.."csa.s"),
ackfile (d.."csb.s"),
ackfile (d.."dup.s"),
ackfile (d.."dvu.s"),
ackfile (d.."exg.s"),
ackfile (d.."exg2.s"),
ackfile (d.."gto.s"),
ackfile (d.."indir.s"),
ackfile (d.."inn.s"),
ackfile (d.."ior.s"),
ackfile (d.."lcs.s"),
ackfile (d.."lxa1.s"),
ackfile (d.."lxa2.s"),
ackfile (d.."lxl.s"),
ackfile (d.."pro.s"),
ackfile (d.."rol.s"),
ackfile (d.."rol4.s"),
ackfile (d.."ror.s"),
ackfile (d.."ror4.s"),
ackfile (d.."sli.s"),
ackfile (d.."sli4.s"),
ackfile (d.."sri.s"),
ackfile (d.."sri4.s"),
ackfile (d.."teq.s"),
ackfile (d.."tge.s"),
ackfile (d.."tgt.s"),
ackfile (d.."tle.s"),
ackfile (d.."tlt.s"),
ackfile (d.."tne.s"),
ackfile (d.."xor.s"),
install = pm.install("%BINDIR%lib/%ARCH%/tail_em"), install = pm.install("%BINDIR%lib/%ARCH%/tail_em"),
as (d.."adi4.s"),
as (d.."cmi.s"),
as (d.."cmi4.s"),
as (d.."sbi4.s"),
as (d.."addsub.s"),
as (d.."cmu4.s"),
as (d.."dum_float.s"),
as (d.."dvi4.s"),
as (d.."dvu4.s"),
as (d.."lar.s"),
as (d.."lol.s"),
as (d.."los.s"),
as (d.."loil.s"),
as (d.."loi1.s"),
as (d.."loi.s"),
as (d.."mli4.s"),
as (d.."mlu.s"),
as (d.."mlu4.s"),
as (d.."mul4.s"),
as (d.."rmi.s"),
as (d.."rmi4.s"),
as (d.."div4.s"),
as (d.."rmu.s"),
as (d.."dvi.s"),
as (d.."rmu4.s"),
as (d.."duv4.s"),
as (d.."ngi4.s"),
as (d.."rtt.s"),
as (d.."ret.s"),
as (d.."sar.s"),
as (d.."aar.s"),
as (d.."adi.s"),
as (d.."sbi.s"),
as (d.."mli.s"),
as (d.."ngi.s"),
as (d.."set.s"),
as (d.."zer.s"),
as (d.."stl.s"),
as (d.."sts.s"),
as (d.."sdl.s"),
as (d.."sti.s"),
as (d.."stil.s"),
as (d.."blm.s"),
as (d.."sti1.s"),
as (d.."test2.s"),
as (d.."testFFh.s"),
as (d.."trap.s"),
as (d.."ldi.s"),
as (d.."data.s"),
as (d.."zri.s"),
as (d.."locaddr.s"),
as (d.."and.s"),
as (d.."asp.s"),
as (d.."cii.s"),
as (d.."cms.s"),
as (d.."cmu.s"),
as (d.."com.s"),
as (d.."csa.s"),
as (d.."csb.s"),
as (d.."dup.s"),
as (d.."dvu.s"),
as (d.."exg.s"),
as (d.."exg2.s"),
as (d.."gto.s"),
as (d.."indir.s"),
as (d.."inn.s"),
as (d.."ior.s"),
as (d.."lcs.s"),
as (d.."lxa1.s"),
as (d.."lxa2.s"),
as (d.."lxl.s"),
as (d.."pro.s"),
as (d.."rol.s"),
as (d.."rol4.s"),
as (d.."ror.s"),
as (d.."ror4.s"),
as (d.."sli.s"),
as (d.."sli4.s"),
as (d.."sri.s"),
as (d.."sri4.s"),
as (d.."teq.s"),
as (d.."tge.s"),
as (d.."tgt.s"),
as (d.."tle.s"),
as (d.."tlt.s"),
as (d.."tne.s"),
as (d.."xor.s"),
} }
-- Revision history
-- $Log$
-- Revision 1.1 2006-07-20 23:18:18 dtrg
-- First version in CVS.
--

View file

@ -4,7 +4,7 @@
local d = ROOTDIR.."mach/6500/" local d = ROOTDIR.."mach/6500/"
include (d.."dl/pmfile") include (d.."dl/pmfile")
--include (d.."libem/pmfile") include (d.."libem/pmfile")
mach_6500 = group { mach_6500 = group {
ARCH = "6500", ARCH = "6500",
@ -16,8 +16,18 @@ mach_6500 = group {
install = pm.install("%ROOTDIR%/lib/%ARCH%/descr", "%BINDIR%%PLATIND%/%ARCH%/descr") install = pm.install("%ROOTDIR%/lib/%ARCH%/descr", "%BINDIR%%PLATIND%/%ARCH%/descr")
} }
support_6500 = group {
ARCH = "6500",
OPTIMISATION = "-O",
libem_6500,
}
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-20 23:18:18 dtrg -- Revision 1.2 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.1 2006/07/20 23:18:18 dtrg
-- First version in CVS. -- First version in CVS.
-- --

View file

@ -8,7 +8,7 @@ local parser = yacc {
outputs = {"%U%-%I%.y"}, outputs = {"%U%-%I%.y"},
command = { command = {
"cd %out[1]:dirname% && ".. "cd %out[1]:dirname% && "..
"%BINDIR%%PLATDEP%/cpp -P -I%ROOTDIR%mach/%ARCH%/as -I"..d.." %CINCLUDES% %in[1]% > %out[1]%" "%BINDIR%%PLATDEP%/cpp -P -I%ROOTDIR%mach/%ARCH%/as -I"..d.." %CINCLUDES:cincludes% %in[1]% > %out[1]%"
}, },
file (d.."comm2.y"), file (d.."comm2.y"),
@ -45,7 +45,10 @@ proto_as = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.2 2006-07-30 23:41:16 dtrg -- Revision 1.3 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.2 2006/07/30 23:41:16 dtrg
-- Broke dependency on tool_cpp in order to speed up the build. -- Broke dependency on tool_cpp in order to speed up the build.
-- --
-- Revision 1.1 2006/07/20 23:18:19 dtrg -- Revision 1.1 2006/07/20 23:18:19 dtrg

View file

@ -51,47 +51,10 @@ proto_cg = cprogram {
install = pm.install("%BINDIR%%PLATDEP%/%ARCH%/cg") install = pm.install("%BINDIR%%PLATDEP%/%ARCH%/cg")
} }
--[[
# genmakefile
# This genmakefile doesn't have a real comment yet.
#
# $Source$
# $State$
codegenerator() {
push
addinclude $SRCDIR/src/arch/$1/cg
addinclude $OBJDIR/src/arch/$1/cg
addincludeq src/arch/proto/cg
hostcdyn src/arch/$1/cg/tables.c
hostprogram $DESTDIR/lib/$1/cg $OBJS \
$DESTDIR/lib/libem_data.a \
$DESTDIR/lib/libflt_arith.a
cat <<EOF
$OBJDIR/src/arch/$1/cg/tables.c: \
$SRCDIR/src/arch/$1/cg/table \
$DESTDIR/bin/cpp \
$DESTDIR/bin/cgg
@echo HOSTCGG $SRCDIR/src/arch/$1/cg/table
@mkdir -p \$(dir \$@)
@(cd $OBJDIR/src/arch/$1/cg && $DESTDIR/bin/cpp -P -I$SRCDIR/src/arch/$1/cg $SRCDIR/src/arch/$1/cg/table | \
$DESTDIR/bin/cgg) > /dev/null
EOF
pop
}
# Revision history
# $Log$
# Revision 1.1 2006-07-20 23:18:19 dtrg
# First version in CVS.
#
--]]
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-20 23:18:19 dtrg -- Revision 1.2 2006-10-15 00:28:12 dtrg
-- First version in CVS. -- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
-- --
-- Revision 1.1 2006/07/20 23:18:19 dtrg
-- First version in CVS.

View file

@ -17,9 +17,9 @@ local cfile_with_tables = cfile {
proto_top = cprogram { proto_top = cprogram {
CINCLUDES = { CINCLUDES = {
PARENT, PARENT,
"-Imach/%ARCH%/ncg", "mach/%ARCH%/ncg",
"-Imach", "mach",
"-I"..d d
}, },
cfile_with_tables (d.."queue.c"), cfile_with_tables (d.."queue.c"),
@ -33,7 +33,10 @@ proto_top = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-22 12:31:19 dtrg -- Revision 1.2 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.1 2006/07/22 12:31:19 dtrg
-- Added support for the top target peephole optimiser. -- Added support for the top target peephole optimiser.
-- --
-- Revision 1.1 2006/07/20 23:18:18 dtrg -- Revision 1.1 2006/07/20 23:18:18 dtrg

View file

@ -76,7 +76,7 @@ local library_core = group {
} }
module_eme = clibrary { module_eme = clibrary {
CEXTRAFLAGS = "-DREADABLE_EM", CDEFINES = {PARENT, "READABLE_EM"},
library_core, library_core,
outputs = {"%U%/libeme.a"}, outputs = {"%U%/libeme.a"},
@ -101,6 +101,9 @@ module_em_code = group {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-20 23:18:18 dtrg -- Revision 1.2 2006-10-15 00:28:11 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.1 2006/07/20 23:18:18 dtrg
-- First version in CVS. -- First version in CVS.
-- --

View file

@ -29,10 +29,10 @@ local withdynamic = cfile {
} }
module_read_emk = clibrary { module_read_emk = clibrary {
CEXTRAFLAGS = "-DPRIVATE=static -DEXPORT= -DNDEBUG", CDEFINES = {PARENT, "PRIVATE=static", "EXPORT=", "NDEBUG"},
cfile (d.."EM_vars.c"), cfile (d.."EM_vars.c"),
cfile { cfile {
CEXTRAFLAGS = "-DPRIVATE=static -DEXPORT= -DNDEBUG -DCOMPACT", CDEFINES = {PARENT, "COMPACT"},
(d.."read_em.c") (d.."read_em.c")
}, },
withdynamic (d.."mkcalls.c"), withdynamic (d.."mkcalls.c"),
@ -42,14 +42,14 @@ module_read_emk = clibrary {
} }
module_read_emkV = clibrary { module_read_emkV = clibrary {
CEXTRAFLAGS = "-DPRIVATE=static -DEXPORT= -DNDEBUG", CDEFINES = {PARENT, "PRIVATE=static", "EXPORT=", "NDEBUG"},
cfile (d.."EM_vars.c"), cfile (d.."EM_vars.c"),
cfile { cfile {
CEXTRAFLAGS = "-DPRIVATE=static -DEXPORT= -DNDEBUG -DCOMPACT -DCHECKING", CDEFINES = {PARENT, "COMPACT", "CHECKING"},
(d.."read_em.c") (d.."read_em.c")
}, },
withdynamic { withdynamic {
CEXTRAFLAGS = "-DPRIVATE=static -DEXPORT= -DNDEBUG -DCHECKING", CDEFINES = {PARENT, "CHECKING"},
(d.."mkcalls.c"), (d.."mkcalls.c"),
}, },
@ -58,14 +58,14 @@ module_read_emkV = clibrary {
} }
module_read_emeV = clibrary { module_read_emeV = clibrary {
CEXTRAFLAGS = "-DPRIVATE=static -DEXPORT= -DNDEBUG", CDEFINES = {PARENT, "PRIVATE=static", "EXPORT=", "NDEBUG"},
cfile (d.."EM_vars.c"), cfile (d.."EM_vars.c"),
cfile { cfile {
CEXTRAFLAGS = "-DPRIVATE=static -DEXPORT= -DNDEBUG -DCHECKING", CDEFINES = {PARENT, "CHECKING"},
(d.."read_em.c") (d.."read_em.c")
}, },
withdynamic { withdynamic {
CEXTRAFLAGS = "-DPRIVATE=static -DEXPORT= -DNDEBUG -DCHECKING", CDEFINES = {PARENT, "CHECKING"},
(d.."mkcalls.c"), (d.."mkcalls.c"),
}, },
@ -85,6 +85,9 @@ module_read_em = group {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-20 23:18:18 dtrg -- Revision 1.2 2006-10-15 00:28:11 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.1 2006/07/20 23:18:18 dtrg
-- First version in CVS. -- First version in CVS.
-- --

BIN
pm

Binary file not shown.

18
pmfile
View file

@ -1,3 +1,4 @@
-- $Id$
-- $Source$ -- $Source$
-- $State$ -- $State$
@ -8,9 +9,9 @@ include "config.pm"
include "first/ack.pm" include "first/ack.pm"
CINCLUDES = { CINCLUDES = {
"-I"..ROOTDIR.."h", ROOTDIR.."h",
"-I"..ROOTDIR.."modules/h", ROOTDIR.."modules/h",
"-I"..HEADERDIR, HEADERDIR,
} }
-- Load the pmfiles for the various modules. -- Load the pmfiles for the various modules.
@ -40,7 +41,7 @@ include "util/cpp/pmfile"
include "lang/cem/cpp.ansi/pmfile" include "lang/cem/cpp.ansi/pmfile"
include "util/cgg/pmfile" include "util/cgg/pmfile"
include "util/ncgg/pmfile" include "util/ncgg/pmfile"
include "util/ceg/pmfile" -- include "util/ceg/pmfile"
include "util/misc/pmfile" include "util/misc/pmfile"
include "util/opt/pmfile" include "util/opt/pmfile"
include "util/ego/pmfile" include "util/ego/pmfile"
@ -128,14 +129,19 @@ default = group {
lang_occam_compiler, lang_occam_compiler,
lang_basic_compiler, lang_basic_compiler,
mach_6500, lang_runtimes { ARCH="6500", OPTIMISATION="-O" }, mach_6500,
lang_runtimes { ARCH="6500", OPTIMISATION="-O" },
mach_6800, mach_6800,
mach_6805, mach_6805,
mach_6809, mach_6809,
mach_arm, lang_runtimes { ARCH="arm", OPTIMISATION="-O" }, mach_arm, lang_runtimes { ARCH="arm", OPTIMISATION="-O" },
mach_i386, lang_runtimes { ARCH="i386", OPTIMISATION="-O" }, mach_i386, lang_runtimes { ARCH="i386", OPTIMISATION="-O" },
mach_i80, lang_runtimes { ARCH="i80", OPTIMISATION="-O" }, mach_i80, lang_runtimes { ARCH="i80", OPTIMISATION="-O" },
mach_i86, lang_runtimes { ARCH="i86", OPTIMISATION="-O" },
mach_i86, support_i86,
lang_runtimes { ARCH="i86", OPTIMISATION="-O" },
mach_m68020, lang_runtimes { ARCH="m68020", OPTIMISATION="-O" }, mach_m68020, lang_runtimes { ARCH="m68020", OPTIMISATION="-O" },
-- mach_m68k2, lang_runtimes { ARCH="m68k2", OPTIMISATION="-O" }, -- mach_m68k2, lang_runtimes { ARCH="m68k2", OPTIMISATION="-O" },
-- mach_m68k4, lang_runtimes { ARCH="m68k4", OPTIMISATION="-O" }, -- mach_m68k4, lang_runtimes { ARCH="m68k4", OPTIMISATION="-O" },

View file

@ -30,11 +30,11 @@ tool_ack = cprogram {
cfile (d.."files.c"), cfile (d.."files.c"),
cfile { cfile {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
ith { makeheaders, i = 1 } ith { makeheaders, i = 1 }
}, },
cfile { cfile {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
ith { makeheaders, i = 2 } ith { makeheaders, i = 2 }
}, },
@ -49,6 +49,9 @@ tool_ack = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-20 23:18:18 dtrg -- Revision 1.2 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.1 2006/07/20 23:18:18 dtrg
-- First version in CVS. -- First version in CVS.
-- --

View file

@ -4,7 +4,7 @@
local d = "util/arch/" local d = "util/arch/"
tool_aal = cprogram { tool_aal = cprogram {
CEXTRAFLAGS = "-DAAL", CDEFINES = {PARENT, "AAL"},
cfile (d.."archiver.c"), cfile (d.."archiver.c"),
lib_print, lib_print,
@ -20,7 +20,10 @@ tool_aal = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.2 2006-07-30 23:45:35 dtrg -- Revision 1.3 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.2 2006/07/30 23:45:35 dtrg
-- Modified to install aal's manpage. -- Modified to install aal's manpage.
-- --
-- Revision 1.1 2006/07/20 23:18:18 dtrg -- Revision 1.1 2006/07/20 23:18:18 dtrg

View file

@ -16,8 +16,8 @@ local cfile_with_headers = cfile {
} }
tool_ceg_as_parser = cprogram { tool_ceg_as_parser = cprogram {
CEXTRAFLAGS = "-DFLEX", CDEFINES = {PARENT, "FLEX"},
CLIBRARIES = "-lfl", CLIBRARIES = {PARENT, "fl"},
cfile_with_headers (d.."conversion.c"), cfile_with_headers (d.."conversion.c"),
cfile_with_headers (d.."help.c"), cfile_with_headers (d.."help.c"),
@ -51,6 +51,9 @@ tool_ceg_as_parser_eval = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.1 2006-07-20 23:18:18 dtrg -- Revision 1.2 2006-10-15 00:28:11 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.1 2006/07/20 23:18:18 dtrg
-- First version in CVS. -- First version in CVS.
-- --

View file

@ -11,12 +11,12 @@ tool_cgg = cprogram {
cfile (d.."main.c"), cfile (d.."main.c"),
cfile { cfile {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
yacc_bootgram, yacc_bootgram,
}, },
cfile { cfile {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
flex { flex {
file (d.."bootlex.l") file (d.."bootlex.l")
}, },
@ -24,7 +24,7 @@ tool_cgg = cprogram {
dynamicheaders = yacc_bootgram dynamicheaders = yacc_bootgram
}, },
CLIBRARIES = {"-lfl"}, CLIBRARIES = {PARENT, "fl"},
lib_em_data, lib_em_data,
lib_assert, lib_assert,
lib_system, lib_system,
@ -43,7 +43,10 @@ cgg = simple {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.2 2006-07-22 20:58:27 dtrg -- Revision 1.3 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.2 2006/07/22 20:58:27 dtrg
-- cpp now gets installed in the right place. -- cpp now gets installed in the right place.
-- --
-- Revision 1.1 2006/07/20 23:21:17 dtrg -- Revision 1.1 2006/07/20 23:21:17 dtrg

View file

@ -91,7 +91,7 @@ tool_cpp = cprogram {
}, },
cfile_with_headers { cfile_with_headers {
CEXTRAFLAGS = "-I"..d, CINCLUDES = {PARENT, d},
tabgen (d.."char.tab") tabgen (d.."char.tab")
}, },
@ -110,7 +110,10 @@ tool_cpp = cprogram {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.3 2006-07-22 20:58:27 dtrg -- Revision 1.4 2006-10-15 00:28:11 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.3 2006/07/22 20:58:27 dtrg
-- cpp now gets installed in the right place. -- cpp now gets installed in the right place.
-- --
-- Revision 1.2 2006/07/22 12:27:31 dtrg -- Revision 1.2 2006/07/22 12:27:31 dtrg

View file

@ -57,7 +57,7 @@ local ego_core = cprogram {
} }
tool_ego = group { tool_ego = group {
CDEFINES = {PARENT, "-DVERBOSE", "-DNOTCOMPACT"}, CDEFINES = {PARENT, "VERBOSE", "NOTCOMPACT"},
ego_core { ego_core {
cfile_with_headers (d.."bo/bo.c"), cfile_with_headers (d.."bo/bo.c"),
@ -235,7 +235,10 @@ ego_descr = simple {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.2 2006-07-23 17:52:23 dtrg -- Revision 1.3 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.2 2006/07/23 17:52:23 dtrg
-- cpp now gets installed in the right place. -- cpp now gets installed in the right place.
-- --
-- Revision 1.1 2006/07/22 00:52:01 dtrg -- Revision 1.1 2006/07/22 00:52:01 dtrg

View file

@ -48,7 +48,7 @@ local local_tool_opt = cprogram {
}, },
cprogram { cprogram {
CLIBRARIES = {"-lfl"}, CLIBRARIES = {PARENT, "fl"},
cfile { cfile {
yacc { yacc {
@ -87,7 +87,7 @@ tool_opt = group {
}, },
group { group {
CEXTRAFLAGS = "-DGLOBAL_OPT", CDEFINES = {PARENT, "GLOBAL_OPT"},
local_tool_opt, local_tool_opt,
install = pm.install(BINDIR.."lib.bin/em_opt2") install = pm.install(BINDIR.."lib.bin/em_opt2")
}, },
@ -95,6 +95,9 @@ tool_opt = group {
-- Revision history -- Revision history
-- $Log$ -- $Log$
-- Revision 1.2 2006-07-20 23:10:07 dtrg -- Revision 1.3 2006-10-15 00:28:12 dtrg
-- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
--
-- Revision 1.2 2006/07/20 23:10:07 dtrg
-- Fixed revision history. -- Fixed revision history.
-- --