104 lines
2.4 KiB
Plaintext
104 lines
2.4 KiB
Plaintext
|
-- $Id$
|
||
|
--
|
||
|
-- This is the build file used to compile LLgen. It should be run through
|
||
|
-- Prime Mover (copy supplied). See the READ_ME file for more information.
|
||
|
|
||
|
include "c.pm"
|
||
|
|
||
|
-- Where is LLgen going to be installed eventually? (Needs trailing slash.)
|
||
|
|
||
|
PREFIX = PREFIX or "/usr/local/"
|
||
|
|
||
|
-- Where's LLgen's staging area? (Don't change. Needs trailing slash.)
|
||
|
|
||
|
INSTALLPATH = "bin/"
|
||
|
|
||
|
LLgen = cprogram {
|
||
|
CEXTRAFLAGS = '-DLIBDIR=\\"'..PREFIX..'share/LLgen\\" -DNON_CORRECTING',
|
||
|
|
||
|
cfile "src/main.c",
|
||
|
cfile "src/gencode.c",
|
||
|
cfile "src/compute.c",
|
||
|
cfile "src/check.c",
|
||
|
cfile "src/reach.c",
|
||
|
cfile "src/global.c",
|
||
|
cfile "src/name.c",
|
||
|
cfile "src/sets.c",
|
||
|
cfile "src/alloc.c",
|
||
|
cfile "src/machdep.c",
|
||
|
cfile "src/cclass.c",
|
||
|
cfile "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.
|
||
|
|
||
|
cfile "src/LLgen.c",
|
||
|
cfile "src/Lpars.c",
|
||
|
cfile "src/tokens.c",
|
||
|
|
||
|
outputs = {"%U%/LLgen"},
|
||
|
install = pm.install( INSTALLPATH.."bin/LLgen")
|
||
|
}
|
||
|
|
||
|
library = group {
|
||
|
install = {
|
||
|
pm.install("lib/rec", INSTALLPATH.."share/LLgen/rec"),
|
||
|
pm.install("lib/incl", INSTALLPATH.."share/LLgen/incl"),
|
||
|
pm.install("lib/nc_incl", INSTALLPATH.."share/LLgen/nc_incl"),
|
||
|
pm.install("lib/nc_rec", INSTALLPATH.."share/LLgen/nc_rec"),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
manpage = group {
|
||
|
install = {
|
||
|
pm.install("doc/LLgen.1", INSTALLPATH.."man/man1/LLgen.1"),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
documentation = group {
|
||
|
simple {
|
||
|
outputs = {"%U%-%I%.ps.gz"},
|
||
|
command = "refer -sA+T -p %in[1]% %in[2]% | groff -Tps -e -t -ms "..
|
||
|
"| gzip -c9 > %out[1]%",
|
||
|
|
||
|
file "doc/LLgen.refs",
|
||
|
file "doc/LLgen.n",
|
||
|
|
||
|
install = {
|
||
|
pm.install(INSTALLPATH.."share/doc/LLgen/LLgen.ps.gz")
|
||
|
}
|
||
|
},
|
||
|
|
||
|
simple {
|
||
|
outputs = {"%U%-%I%.ps.gz"},
|
||
|
command = "groff -Tps -e -t -p -ms %in% | gzip -c9 > %out[1]%",
|
||
|
|
||
|
file "doc/LLgen_NCER.n",
|
||
|
|
||
|
install = {
|
||
|
pm.install(INSTALLPATH.."share/doc/LLgen/NCER.ps.gz")
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
|
||
|
-- Default rule: builds everything into the staging area, but does nothing
|
||
|
-- else.
|
||
|
|
||
|
default = group {
|
||
|
LLgen, -- build LLgen itself
|
||
|
library, -- copy over the library
|
||
|
manpage, -- copy over the man page
|
||
|
documentation, -- build the two white papers
|
||
|
}
|
||
|
|
||
|
-- This rule will build everything, and then install it to its final location.
|
||
|
|
||
|
install = group {
|
||
|
default,
|
||
|
|
||
|
install = {
|
||
|
"mkdir -p %PREFIX%",
|
||
|
"(cd bin && tar cf - .) | (cd %PREFIX% && tar xvf -)"
|
||
|
}
|
||
|
}
|