Files
lotherk b41be1885a MCDE: the dthelp parser generators build for the host (t0230, block 1)
Inventory of build/logs/mcde-allerrors-2026-11-14.log (the last docs-enabled
cross build): 826 error lines, 774 of them Error 127 (a target binary run on
the build host).  The tools that were not found: instant 654 calls,
dtcodegen 44, tt_type_comp 18, dtdocbook2infolib 14; 50 Error 1 come from the
parser's missing context.h (the generators had not run), 2 from XDONE.
instant is the SGML converter for both help volumes and man pages, so it is
the next block.

This block is the dthelp parser's own generators: pass1, canon1 and pass2
run "build" and "eltdef" while the parser is compiled, and they must run on
the build host.  Each of their directories now compiles for the host (CC,
CPPFLAGS, CFLAGS, LDFLAGS from the *_FOR_BUILD values AM_MAKEFLAGS forwards,
the same pattern as util/tradcpp and dtinfo/tools/misc), and links a new
libutil_host.a built in util/ with CC_FOR_BUILD from the same sources as the
target libutil.a (context/fclndir had that already; libutil.a stays target
for the installed parser programs).

Measured: make -C build/mcde-linux/programs/dthelp/parser clean, then
make mcde-linux MCDE_DIRS="programs/dthelp/parser": exit=0, 0 Error lines;
the log shows "ar cru libutil_host.a", "./build < .../hptag.dtd",
"./eltdef ../helptag/help.if"; BDONE and EDONE are written; file(1) says
pass1/build/build, pass1/eltdef/eltdef, pass2/build/build and
pass2/eltdef/eltdef are x86-64 Linux ELF; the generated Makefile carries
"CC = $(CC_FOR_BUILD)" after the configured CC.

Still open for t0230: instant, dtdocbook2infolib and the pass1/2 parser
(dthelp_htag2, run by dtdocbook2sdl) as host tools, then turn docs on in
tools/pkgsrc-cross.mk.conf; man pages follow instant; dtappbuilder's
dtcodegen and tt_type_comp are their own blocks.
2026-11-16 15:06:08 +00:00

64 lines
1.6 KiB
Makefile

MAINTAINERCLEANFILES = Makefile.in
.NOTPARALLEL:
noinst_PROGRAMS = eltdef
# eltdef runs while the parser is built: it must run on the build host, so
# the whole sub-make compiles for the host (the same as util/tradcpp; the
# values come from AM_MAKEFLAGS in the top Makefile.am). t0230
CC = $(CC_FOR_BUILD)
CPPFLAGS = $(CPPFLAGS_FOR_BUILD)
CFLAGS = $(CFLAGS_FOR_BUILD)
LDFLAGS = $(LDFLAGS_FOR_BUILD)
HTAG2 = ..
HTAG2SRC = $(HTAG2)/htag2
SDLPARSERSRC = $(HTAG2)/parser
SDLELTDEFSRC = $(HTAG2)/eltdef
SDLDTDFILE = $(HTAG2SRC)/sdl.dtd
SDLUTILSRC = $(HTAG2)/util
SDLBUILDSRC = $(HTAG2)/build
SDLUTILLIB = $(HTAG2)/util/libutil.a
SDLIFFILE = $(HTAG2SRC)/sdl.if
eltdef_LDADD = $(SDLUTILSRC)/libutil_host.a
eltdef_DEPENDENCIES = $(SDLUTILSRC)/libutil_host.a
eltdef_CFLAGS = $(CFLAGS_FOR_BUILD) -I$(SDLUTILSRC) -I$(SDLBUILDSRC)
eltdef_SOURCES = eltdef.c eltutil.c entity.c scan.c
CCPRODS = case.c
ECPRODS = efile.c entfile.c pfile.c sfile.c stfile.c tfile.c
CHPRODS = context.h delim.h
EHPRODS = entity2.h globdec.h globdef.h if.h pval.h signon.h signonx.h
CPRODS = $(CCPRODS) $(CHPRODS)
EPRODS = $(ECPRODS) $(EHPRODS)
CTRASH = delim.dat error
ETRASH = estring.h error
TRASH = delim.dat estring.h error
BUILT_SOURCES = $(CPRODS) $(EPRODS)
CLEANFILES = $(BUILT_SOURCES) $(TRASH) CDONE EDONE
$(CPRODS): CDONE
$(EPRODS): EDONE
EDONE: eltdef $(SDLIFFILE)
$(RM) $(EPRODS) $(ETRASH)
./eltdef $(SDLIFFILE)
touch EDONE
CDONE: $(SDLUTILSRC)/context $(HTAG2SRC)/delim.elt context.dat
$(RM) $(CPRODS) $(CTRASH)
$(CP) $(HTAG2SRC)/delim.elt delim.dat # appl.-specific delim.dat
$(SDLUTILSRC)/context
touch CDONE