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

68 lines
1.8 KiB
Makefile

MAINTAINERCLEANFILES = Makefile.in
.NOTPARALLEL:
noinst_PROGRAMS = build
# build 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)/help.if
build_CFLAGS = $(CFLAGS_FOR_BUILD) -I$(SDLUTILSRC)
build_LDADD = $(SDLUTILSRC)/libutil_host.a
build_DEPENDENCIES = $(SDLUTILSRC)/libutil_host.a
build_SOURCES = build.c buildutl.c eltree.c except.c fsa.c out.c param.c \
scan.c sref.c tree.c
CHPRODS = context.h delim.h
CCPRODS = case.c
BHPRODS = dtd.h entity.h arc.h
BCPRODS =
CTRASH = error delim.dat
BTRASH = error template
CPRODS = $(CHPRODS) $(CCPRODS)
BPRODS = $(BHPRODS) $(BCPRODS)
TRASH = error delim.dat template
BUILT_SOURCES = $(CPRODS) $(BPRODS)
CLEANFILES = $(BUILT_SOURCES) $(TRASH) BDONE CDONE
# We want the commands that actually create BPRODS and CPRODS to only
# run once during a make so we gate them using these CDONE and BDONE
# targets. This allows us to enable parallel building too.
$(BPRODS): BDONE
$(CPRODS): CDONE
# build the BRPODS
BDONE: ./build $(SDLDTDFILE)
$(RM) $(BPRODS) $(BTRASH) && ./build < $(SDLDTDFILE) && touch BDONE
# build the CRPODS
CDONE: $(SDLUTILSRC)/context $(HTAG2SRC)/delim.bld context.dat
$(RM) $(CPRODS) $(CTRASH)
$(CP) $(HTAG2SRC)/delim.bld delim.dat # appl.-specific delim.dat
$(SDLUTILSRC)/context sparse
touch CDONE