Files
klammertext/sks/document/Makefile
T
ack fe475e774a Klammertext runs natively on Windows; a Windows source-install guide; the bundled sh for @eval :shell
Assembled from klammertext-dev f344a37d0f6e. The commands, the library,
the Standard Klammer Set, the reflection klammerset and the Python
binding build and run natively on Windows (MSYS2 UCRT64 gcc, python.org
Python), and both test tiers pass there. doc/install/windows_source_install.md
is the fifth install guide: a source install parallel to the Linux and
macOS ones, verified by following it on a pristine Windows 11.

Behaviour on every system: paths Klammertext prints use forward slashes;
output is LF; the command line is UTF-8 on Windows; @eval :shell is a
POSIX shell command everywhere -- on Windows it runs the sh Klammertext
ships, BusyBox for Windows (win/busybox/, GPLv2, with its licence and the
source pointer). KLAMMERTEXT_FONTS and KLAMMERTEXT_KLAMMERSETS are lists in
the system's PATH convention (';' on Windows). On Linux and macOS nothing
observable changes.
2026-09-25 00:32:55 +02:00

61 lines
1.8 KiB
Makefile

# Klammertext sks/document/ Makefile
# Improved version with automatic header dependency tracking
K := $(KLAMMERTEXT_HOME)
KS := $(K)/sks
KM := $(K)/mac
include $(K)/env/makefile.env
# Additional include paths for sks components
LOCAL_CPPFLAGS := -I$(KM) -I$(KS)/kutil -I$(KS)/target
# Shared library location
LIBDIR := $(K)/lib
LIBRARY := $(LIBDIR)/libklammertext.so
# Linker flags for document.so
DOC_LDFLAGS := $(SHARED) $(EXPORT_DYNAMIC) -Wl,-rpath,'$(ORIGIN)/../../lib' -L$(LIBDIR)
# Local object files
LOCAL_OBJECTS := document_class.o document_html.o document_latex.o heading.o reference.o
LOCAL_DEPFILES := document_class.d document_html.d document_latex.d heading.d reference.d document.d
# External object files from sks/ (mac/*.o now in libklammertext.so)
SKS_OBJECTS := $(KS)/kutil/kutil.o $(KS)/kutil/klammer_base.o \
$(KS)/target/html_util.o $(KS)/target/latex_util.o
ALL_OBJECTS := $(LOCAL_OBJECTS) $(SKS_OBJECTS)
# Compiler flags for dependency generation
DEPFLAGS = -MMD -MP -MF $(@:.o=.d)
.PHONY: all clean deps
# Default target
all : document.so
# Build external dependencies first
deps :
$(MAKE) -C $(KS)/kutil
$(MAKE) -C $(KS)/target
# Pattern rule for object files
%.o : %.cpp
@echo Compiling $<
$(CXX) -c $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CXXFLAGS) $(DEPFLAGS) $< -o $@
# Shared object - link against libklammertext.so
document.so : $(LOCAL_OBJECTS) $(SKS_OBJECTS) $(LIBRARY) document.cpp | deps
$(CXX) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CXXFLAGS) $(DOC_LDFLAGS) $(LDFLAGS) \
document.cpp -o $@ $(ALL_OBJECTS) $(KLAMMERTEXT_LIB) $(LDLIBS)
clean :
rm -f $(LOCAL_OBJECTS) $(LOCAL_DEPFILES) *.so *~
# document_txt.py is imported at render time (2026-09-18), so this
# directory now exists here; rm -f refused it and failed every clean.
rm -rf __pycache__
# Include generated dependency files (if they exist)
-include $(LOCAL_DEPFILES)