Files
mcde/util/tradcpp/Makefile.am
T
lotherkandIceman Contributor Free c004331d56 mcde: tradcpp is linked by the build host's compiler
tradcpp_CC/CFLAGS/LDFLAGS are not per-target variables automake honours,
so the generated Makefile still used the target compiler: the tool was a
NetBSD ELF and every build stopped at
'/bin/sh: ../../../../util/tradcpp/tradcpp: not found'
(build/logs/userland-2026-11-14k.log:7697).  Override the generated CC,
CPPFLAGS, CFLAGS and LDFLAGS for this build-tool sub-make with the
*_FOR_BUILD values the top Makefile.am already forwards.

Verified in the work directory: automake emits CC = $(CC_FOR_BUILD); a
host-cc build of the same objects is a Linux ELF and preprocesses -DX=1
to 1.

Fixes the remaining wm/mcde build stop (tasksd t0170).

Co-authored-by: Iceman Contributor Free <noreply@opencode.ai>
2026-11-14 06:57:33 +00:00

27 lines
1.2 KiB
Makefile

MAINTAINERCLEANFILES = Makefile.in
noinst_PROGRAMS = tradcpp
tradcpp_SOURCES = array.c directive.c files.c macro.h output.h \
utils.c array.h directive.h files.h main.c place.c utils.h \
bool.h eval.c inlinedefs.h mode.h place.h version.h config.h \
eval.h macro.c output.c union.h
# tradcpp is a build tool: it must run on the machine that builds MCDE, so it is
# compiled by the build host's compiler, not the target's (the values come from
# AM_MAKEFLAGS in the top Makefile.am and the pkgsrc recipe). Built for the
# target it cannot execute here: "/bin/sh: ../../../../util/tradcpp/tradcpp: not
# found" (build/logs/userland-2026-11-14j.log:7715ff).
# automake has no per-target CC/CFLAGS/LDFLAGS override that replaces the
# generated values (tradcpp_CC was ignored: the binary was still linked by the
# target compiler, an ELF for NetBSD that cannot run here,
# build/logs/userland-2026-11-14k.log:7697). The whole program is a build
# tool, so replace the generated variables for this sub-make only; the top
# Makefile.am forwards them through AM_MAKEFLAGS.
CC = $(CC_FOR_BUILD)
CPPFLAGS = $(CPPFLAGS_FOR_BUILD)
CFLAGS = $(CFLAGS_FOR_BUILD)
LDFLAGS = $(LDFLAGS_FOR_BUILD)