Assembled from development commit c3c40f6c8fca. Since 830b193: on Windows the
products carry Windows names (ktext.exe, klammertext.dll, document.dll,
reflect.dll) and the console's output code page is UTF-8 for a run; the
editor tooling works on Windows (VS Code, Sublime Text, Vim, with the
interpreter's name chosen by platform) and Notepad++ joins it
(doc/edit/notepadpp: a User Defined Language and two Run-menu commands);
a sixth install page, doc/install/windows_wsl_install.md, for Linux
inside WSL; the Windows page opens with the three routes and gains its
editor section, the PowerShell quoting and Path notes; the Linux page
installs OpenImageIO from the python3-openimageio package and verifies
with kdiag --machine; the README lists all six install pages. Linux and
macOS behaviour is unchanged.
88 lines
2.5 KiB
Makefile
88 lines
2.5 KiB
Makefile
# Klammertext mac/ Makefile
|
|
# Improved version with automatic header dependency tracking
|
|
|
|
K := $(KLAMMERTEXT_HOME)
|
|
KS := $(K)/sks
|
|
|
|
include $(K)/env/makefile.env
|
|
|
|
# Source files
|
|
BASENAMES := util error locator file argv character ktype katom katom_process \
|
|
katomize katom_rewrite_rules katom_matching \
|
|
log show command argument argument_set argtype argtype_registry \
|
|
state eval eval_python eval_cpp klammer klammer_registry klammerset klammerset_registry \
|
|
option_set option_set_registry deftype \
|
|
target target_registry machine font_store check coverage
|
|
|
|
SOURCES := $(addsuffix .cpp,$(BASENAMES))
|
|
OBJECTS := $(addsuffix .o,$(BASENAMES))
|
|
HEADERS := $(addsuffix .h,$(BASENAMES))
|
|
DEPFILES := $(addsuffix .d,$(BASENAMES))
|
|
|
|
# Shared library
|
|
LIBDIR := ../lib
|
|
LIBRARY := $(LIBDIR)/$(KLAMMERTEXT_LIBFILE)
|
|
|
|
# Compiler flags for dependency generation
|
|
DEPFLAGS = -MMD -MP -MF $(@:.o=.d)
|
|
|
|
# Pattern rule for object files with automatic dependency generation
|
|
%.o : %.cpp
|
|
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEPFLAGS) $< -o $@
|
|
|
|
# Default target
|
|
.PHONY: all sks ref kpy clean redo clang
|
|
|
|
all : $(LIBRARY)
|
|
$(MAKE) sks
|
|
$(MAKE) ref
|
|
$(MAKE) kpy
|
|
|
|
# Create lib directory
|
|
$(LIBDIR):
|
|
mkdir -p $(LIBDIR)
|
|
|
|
# Build shared library
|
|
$(LIBRARY): $(OBJECTS) | $(LIBDIR)
|
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(SHARED) $(SONAME) -o $@ $(OBJECTS) $(LDLIBS)
|
|
|
|
# Build sks components
|
|
sks :
|
|
$(MAKE) -C $(KS)/kutil
|
|
$(MAKE) -C $(KS)/target
|
|
$(MAKE) -C $(KS)/document
|
|
|
|
# ref/ is NOT part of a klammer set: it is the reflection library, whose
|
|
# C++ reads the engine's OWN registries and character tables and returns
|
|
# Klammertext. It is built here because, like the sks DSOs, it links
|
|
# against libklammertext.so -- but it is a separate target so it does not
|
|
# become "part of sks" by association, which is exactly the confusion the
|
|
# klammer-set naming is trying to undo.
|
|
ref :
|
|
$(MAKE) -C $(K)/ref
|
|
|
|
# kpy/ is the Python binding: a CPython extension module that links against
|
|
# libklammertext.so and shares its class layouts, like the sks DSOs and
|
|
# ref/. A fourth consumer of the library, and neither a command nor a
|
|
# klammer set.
|
|
kpy :
|
|
$(MAKE) -C $(K)/kpy
|
|
|
|
clean :
|
|
rm -f $(OBJECTS) $(DEPFILES) $(LIBRARY) *~
|
|
|
|
redo :
|
|
ifneq ($(filter clang,$(MAKECMDGOALS)),)
|
|
@:
|
|
else
|
|
$(MAKE) clean
|
|
$(MAKE) -j all
|
|
endif
|
|
|
|
# "make clang" = incremental build; "make clang redo" = full clean rebuild
|
|
clang :
|
|
$(MAKE) $(or $(filter-out clang,$(MAKECMDGOALS)),all) COMPILER=clang
|
|
|
|
# Include generated dependency files (if they exist)
|
|
-include $(DEPFILES)
|