Files
ackandClaude Fable 5.1 ed7bedf5a7 Images in plain text and the terminal; bounded build parallelism (from dev 16f82cc887af)
- @image under txt and ansi is a picture in characters, in five styles
  (Image_txt_style: halfblock the default, shade, ascii, quadrant,
  braille), sized to the terminal's width less a margin when ktext runs
  in one, every cell in its own colours under ansi; a figure's caption
  is centred under it and no txt caption is ruled off any more.
- The build compiles as many files at once as the machine has cores
  (JOBS; make -C com JOBS=1 for a small machine): the sub-makes' bare -j
  meant unlimited parallelism and exhausted 8 GB machines. The three
  install pages say "make -C com".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-30 16:13:23 +02:00

57 lines
1.6 KiB
Makefile

# Klammertext sks/ Makefile
# Builds all the DSOs (document$(DSO): .so, on Windows .dll) in sks/
# subdirectories
K := $(KLAMMERTEXT_HOME)
KS := $(K)/sks
KM := $(K)/mac
include $(K)/env/makefile.env
# Shared library that all the DSOs depend on
LIBRARY := $(K)/lib/$(KLAMMERTEXT_LIBFILE)
# Support directories (build .o files used by other sks/ components)
SUPPORT_DIRS := kutil target
# Excluded directories:
# kutil, target - support directories that build .o files, not a DSO
# book, phase - obsolete, not updated for the shared library
# Directories that build a DSO (excluding support and obsolete directories):
# every subdirectory whose Makefile names its product with makefile.env's
# $(DSO) suffix ("document$(DSO) :", "all : document$(DSO)").
SO_DIRS := $(shell for dir in $(KS)/*/; do \
if [ -f "$${dir}Makefile" ] && grep -qE '\$$\(DSO\)' "$${dir}Makefile" 2>/dev/null; then \
basename "$$dir"; \
fi; done | grep -v -E '^(kutil|target|book|phase)$$')
.PHONY: all clean support $(SUPPORT_DIRS) $(SO_DIRS)
# Default target: build support first, then every DSO
all : support $(SO_DIRS)
# Build support directories
support : $(SUPPORT_DIRS)
kutil :
$(MAKE) -j$(JOBS) -C $(KS)/kutil
target : kutil
$(MAKE) -j$(JOBS) -C $(KS)/target
# Pattern rule for the DSO directories
# Each depends on the library and support directories
$(SO_DIRS) : support $(LIBRARY)
$(MAKE) -j$(JOBS) -C $(KS)/$@
# Clean all subdirectories
clean :
@for dir in $(SUPPORT_DIRS) $(SO_DIRS); do \
echo "Cleaning $$dir..."; \
$(MAKE) -C $(KS)/$$dir clean; \
done
# Rebuild everything
redo : clean all