2006-10-15 00:28:12 +00:00
|
|
|
-- $Id$
|
2006-07-20 22:57:46 +00:00
|
|
|
-- $Source$
|
|
|
|
-- $State$
|
|
|
|
|
|
|
|
include "first/c.pm"
|
|
|
|
include "first/yacc.pm"
|
|
|
|
include "first/llgen.pm"
|
|
|
|
include "config.pm"
|
2006-07-27 21:58:13 +00:00
|
|
|
include "first/ack.pm"
|
2007-02-20 00:46:10 +00:00
|
|
|
include "first/ack-custom.pm"
|
2006-07-20 22:57:46 +00:00
|
|
|
|
|
|
|
CINCLUDES = {
|
2006-10-15 00:28:12 +00:00
|
|
|
ROOTDIR.."h",
|
|
|
|
ROOTDIR.."modules/h",
|
|
|
|
HEADERDIR,
|
2006-07-20 22:57:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
-- Load the pmfiles for the various modules.
|
|
|
|
|
|
|
|
include "util/data/pmfile"
|
|
|
|
|
2007-02-20 00:46:10 +00:00
|
|
|
include "util/LLgen/pmfile-ack"
|
|
|
|
|
2006-07-20 22:57:46 +00:00
|
|
|
include "modules/src/alloc/pmfile"
|
|
|
|
include "modules/src/assert/pmfile"
|
|
|
|
include "modules/src/system/pmfile"
|
|
|
|
include "modules/src/string/pmfile"
|
|
|
|
include "modules/src/read_em/pmfile"
|
|
|
|
include "modules/src/em_code/pmfile"
|
|
|
|
include "modules/src/em_mes/pmfile"
|
|
|
|
include "modules/src/print/pmfile"
|
|
|
|
include "modules/src/object/pmfile"
|
|
|
|
include "modules/src/idf/pmfile"
|
|
|
|
include "modules/src/input/pmfile"
|
|
|
|
include "modules/src/flt_arith/pmfile"
|
|
|
|
|
|
|
|
include "util/amisc/pmfile"
|
|
|
|
include "util/cmisc/pmfile"
|
|
|
|
include "util/ack/pmfile"
|
|
|
|
include "util/arch/pmfile"
|
2007-04-24 20:45:58 +00:00
|
|
|
-- include "util/cpp/pmfile"
|
2006-07-30 23:45:18 +00:00
|
|
|
include "lang/cem/cpp.ansi/pmfile"
|
2006-07-20 22:57:46 +00:00
|
|
|
include "util/cgg/pmfile"
|
|
|
|
include "util/ncgg/pmfile"
|
2006-10-15 00:28:12 +00:00
|
|
|
-- include "util/ceg/pmfile"
|
2006-07-20 22:57:46 +00:00
|
|
|
include "util/misc/pmfile"
|
|
|
|
include "util/opt/pmfile"
|
2006-07-22 00:52:01 +00:00
|
|
|
include "util/ego/pmfile"
|
2006-07-22 12:31:19 +00:00
|
|
|
include "util/topgen/pmfile"
|
2006-07-22 20:04:41 +00:00
|
|
|
include "util/led/pmfile"
|
2006-07-20 22:57:46 +00:00
|
|
|
|
2006-07-27 22:51:38 +00:00
|
|
|
include "lang/cem/pmfile"
|
2006-07-22 21:03:07 +00:00
|
|
|
include "lang/pc/pmfile"
|
2006-07-26 17:12:19 +00:00
|
|
|
include "lang/m2/pmfile"
|
2007-04-24 20:45:58 +00:00
|
|
|
-- include "lang/occam/pmfile"
|
|
|
|
-- include "lang/basic/pmfile"
|
2006-07-20 22:57:46 +00:00
|
|
|
|
|
|
|
include "mach/proto/pmfile"
|
2007-02-20 00:46:10 +00:00
|
|
|
|
|
|
|
--[[
|
2007-02-25 12:53:17 +00:00
|
|
|
include "mach/i386/pmfile"
|
2006-07-20 22:57:46 +00:00
|
|
|
include "mach/6500/pmfile"
|
|
|
|
include "mach/6800/pmfile"
|
|
|
|
include "mach/6805/pmfile"
|
|
|
|
include "mach/6809/pmfile"
|
|
|
|
include "mach/arm/pmfile"
|
|
|
|
include "mach/i80/pmfile"
|
|
|
|
include "mach/m68020/pmfile"
|
|
|
|
include "mach/m68k2/pmfile"
|
|
|
|
include "mach/m68k4/pmfile"
|
|
|
|
include "mach/ns/pmfile"
|
|
|
|
include "mach/pdp/pmfile"
|
|
|
|
include "mach/s2650/pmfile"
|
|
|
|
include "mach/vax4/pmfile"
|
|
|
|
include "mach/z80/pmfile"
|
|
|
|
include "mach/z8000/pmfile"
|
2007-02-20 00:46:10 +00:00
|
|
|
--]]
|
2006-07-20 22:57:46 +00:00
|
|
|
|
2006-07-27 21:58:13 +00:00
|
|
|
-- This is the list of language runtimes that is built for each architecture.
|
|
|
|
|
|
|
|
lang_runtimes = group {
|
2007-04-23 23:41:50 +00:00
|
|
|
-- lang_cem_runtime, -- K&R C (obsolete and useless)
|
|
|
|
lang_cem_ansi_runtime, -- ANSI C
|
|
|
|
lang_pc_runtime, -- Pascal
|
|
|
|
lang_m2_runtime, -- Modula-2
|
|
|
|
-- lang_occam_runtime, -- Occam 1 (obsolete and useless)
|
|
|
|
-- lang_basic_runtime, -- Basic
|
2006-07-27 21:58:13 +00:00
|
|
|
}
|
|
|
|
|
2007-02-20 00:46:10 +00:00
|
|
|
-- Include the platform descriptions.
|
|
|
|
|
|
|
|
include "mach/i86/pmfile" -- generic i86
|
|
|
|
include "plat/pc86/pmfile" -- PC standalone
|
|
|
|
|
2007-04-23 23:41:50 +00:00
|
|
|
include "mach/i386/pmfile" -- generic i386
|
|
|
|
include "plat/linux386/pmfile" -- Linux executables
|
|
|
|
|
2006-07-20 22:57:46 +00:00
|
|
|
default = group {
|
2007-02-20 00:46:10 +00:00
|
|
|
-- Lots of things use LLgen, so we need to build it first.
|
|
|
|
|
|
|
|
tool_LLgen,
|
|
|
|
|
2006-07-20 22:57:46 +00:00
|
|
|
-- Some of the dependency management across modules isn't entirely
|
|
|
|
-- complete, for simplicity; as a result, the order here is important.
|
|
|
|
-- In particular, referencing a library does not cause the library to
|
|
|
|
-- be built, hence the reason why the modules must be built first. Also,
|
|
|
|
-- some of these generate header files...
|
|
|
|
|
|
|
|
module_em_data,
|
|
|
|
module_system,
|
|
|
|
module_alloc,
|
|
|
|
module_assert,
|
|
|
|
module_string,
|
|
|
|
module_em_code,
|
|
|
|
module_read_em,
|
|
|
|
module_em_mes,
|
|
|
|
module_print,
|
|
|
|
module_object,
|
|
|
|
module_idf,
|
|
|
|
module_print,
|
|
|
|
module_input,
|
|
|
|
module_flt_arith,
|
|
|
|
|
|
|
|
tool_tabgen,
|
|
|
|
tool_aal,
|
|
|
|
tool_ack,
|
2007-04-23 23:41:50 +00:00
|
|
|
-- tool_cpp, -- K&R C
|
|
|
|
tool_cpp_ansi, -- ANSI C
|
2006-07-20 22:57:46 +00:00
|
|
|
tool_cgg,
|
|
|
|
tool_ncgg,
|
2006-07-22 00:52:01 +00:00
|
|
|
-- tool_ceg,
|
2006-07-20 22:57:46 +00:00
|
|
|
tool_em_decode,
|
|
|
|
tool_em_encode,
|
2006-07-22 20:10:41 +00:00
|
|
|
tool_esize,
|
2006-07-20 22:57:46 +00:00
|
|
|
tool_opt,
|
2006-07-22 00:52:01 +00:00
|
|
|
tool_ego,
|
2006-07-22 12:31:19 +00:00
|
|
|
tool_topgen,
|
2006-07-22 20:04:41 +00:00
|
|
|
tool_led,
|
2006-10-16 23:25:56 +00:00
|
|
|
tool_anm,
|
|
|
|
tool_ashow,
|
|
|
|
tool_asize,
|
|
|
|
tool_astrip,
|
|
|
|
tool_aslod,
|
2007-04-23 23:41:50 +00:00
|
|
|
tool_aelflod,
|
2006-07-20 22:57:46 +00:00
|
|
|
|
2007-04-23 23:41:50 +00:00
|
|
|
-- lang_cem_compiler,
|
2006-07-27 22:51:38 +00:00
|
|
|
lang_cem_ansi_compiler,
|
2006-07-27 22:07:38 +00:00
|
|
|
lang_pc_compiler,
|
2006-07-27 22:14:55 +00:00
|
|
|
lang_m2_compiler,
|
2007-04-23 23:41:50 +00:00
|
|
|
-- lang_occam_compiler,
|
|
|
|
-- lang_basic_compiler,
|
2006-07-20 22:57:46 +00:00
|
|
|
|
2007-02-20 00:46:10 +00:00
|
|
|
-- Build the code generators and the architecture-independent
|
|
|
|
-- libraries.
|
|
|
|
|
|
|
|
--[[
|
2006-10-15 00:28:12 +00:00
|
|
|
mach_6500,
|
|
|
|
lang_runtimes { ARCH="6500", OPTIMISATION="-O" },
|
|
|
|
|
2006-07-20 22:57:46 +00:00
|
|
|
mach_6800,
|
|
|
|
mach_6805,
|
|
|
|
mach_6809,
|
2006-07-27 21:58:13 +00:00
|
|
|
mach_arm, lang_runtimes { ARCH="arm", OPTIMISATION="-O" },
|
2006-07-27 22:51:38 +00:00
|
|
|
mach_i386, lang_runtimes { ARCH="i386", OPTIMISATION="-O" },
|
2006-07-27 21:58:13 +00:00
|
|
|
mach_i80, lang_runtimes { ARCH="i80", OPTIMISATION="-O" },
|
2006-10-15 00:28:12 +00:00
|
|
|
|
2006-07-27 22:51:38 +00:00
|
|
|
mach_m68020, lang_runtimes { ARCH="m68020", OPTIMISATION="-O" },
|
2006-07-27 21:58:13 +00:00
|
|
|
-- mach_m68k2, lang_runtimes { ARCH="m68k2", OPTIMISATION="-O" },
|
2006-07-27 22:51:38 +00:00
|
|
|
-- mach_m68k4, lang_runtimes { ARCH="m68k4", OPTIMISATION="-O" },
|
2006-07-27 21:58:13 +00:00
|
|
|
mach_ns, lang_runtimes { ARCH="ns", OPTIMISATION="-O" },
|
2006-07-27 22:51:38 +00:00
|
|
|
-- mach_pdp, lang_runtimes { ARCH="pdp", OPTIMISATION="-O" },
|
2006-07-20 22:57:46 +00:00
|
|
|
mach_s2650,
|
2006-07-27 21:58:13 +00:00
|
|
|
-- mach_vax4, lang_runtimes { ARCH="vax4", OPTIMISATION="-O" },
|
|
|
|
mach_z80, lang_runtimes { ARCH="z80", OPTIMISATION="-O" },
|
|
|
|
mach_z8000, lang_runtimes { ARCH="z8000", OPTIMISATION="-O" },
|
2007-02-20 00:46:10 +00:00
|
|
|
--]]
|
|
|
|
|
2007-04-23 23:41:50 +00:00
|
|
|
-- Build the platforms.
|
2007-02-20 00:46:10 +00:00
|
|
|
|
2007-04-23 23:41:50 +00:00
|
|
|
platform_pc86,
|
|
|
|
platform_linux386
|
2006-07-20 22:57:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
-- Ensure that the work directories exist.
|
|
|
|
|
|
|
|
posix.mkdir(TEMPDIR)
|
|
|
|
posix.mkdir(HEADERDIR)
|
|
|
|
|
2007-02-25 12:53:17 +00:00
|
|
|
-- When doing the build, we want to ensure that the ACK looks in the staging
|
|
|
|
-- area for its files, and not in the final installation directory (because
|
|
|
|
-- we haven't been installed yet).
|
|
|
|
|
2007-02-25 20:59:21 +00:00
|
|
|
posix.putenv("ACKDIR="..BINDIR)
|
2007-02-25 12:53:17 +00:00
|
|
|
|
2006-07-20 22:57:46 +00:00
|
|
|
-- Build the configuration headers, rather crudely. FIXME.
|
|
|
|
|
|
|
|
configure = simple {
|
|
|
|
outputs = {HEADERDIR.."local.h", HEADERDIR.."em_path.h"},
|
|
|
|
command = "",
|
|
|
|
__dobuild = function(self, inputs, outputs)
|
|
|
|
-- Build 'local.h', rather crudely
|
|
|
|
|
|
|
|
local f = io.open(HEADERDIR.."local.h", "w")
|
|
|
|
f:write("#define VERSION 3\n") -- EM byte-code version
|
2007-02-25 12:53:17 +00:00
|
|
|
f:write("#define ACKM \"", DEFAULT_PLATFORM, "\"\n")
|
2006-07-20 22:57:46 +00:00
|
|
|
f:write("#define BIGMACHINE 1\n") -- No, we don't have a 16-bit architecture
|
|
|
|
f:write("#define SYS_5\n")
|
|
|
|
f:close()
|
|
|
|
|
|
|
|
-- Build 'em_path.h', rather crudely
|
|
|
|
|
|
|
|
local f = io.open(HEADERDIR.."em_path.h", "w")
|
|
|
|
f:write("#define TMP_DIR \"", ACK_TEMP_DIR, "\"\n")
|
|
|
|
f:write("#define EM_DIR \"", PREFIX, "\"\n")
|
|
|
|
f:write("#define ACK_PATH \"", PLATIND, "/descr\"\n")
|
|
|
|
f:close()
|
|
|
|
end
|
|
|
|
}
|
2007-02-25 12:53:17 +00:00
|
|
|
|
|
|
|
-- Once built, do the installation, rather crudely. FIXME.
|
|
|
|
|
|
|
|
install = simple {
|
|
|
|
outputs = {"dummy"},
|
|
|
|
command = "",
|
|
|
|
__dobuild = function(self, inputs, outputs)
|
|
|
|
os.execute("mkdir -p "..PREFIX)
|
|
|
|
os.execute("(cd "..BINDIR.." && tar chf - .) | (cd "..PREFIX.." && tar xvf -)")
|
|
|
|
end
|
|
|
|
}
|