2026-07-18 18:48:23 +02:00
|
|
|
# Klammertext mac/ Makefile
|
|
|
|
|
# Improved version with automatic header dependency tracking
|
|
|
|
|
|
|
|
|
|
K := $(KLAMMERTEXT_HOME)
|
|
|
|
|
KS := $(K)/sks
|
|
|
|
|
|
2026-07-22 18:17:43 +02:00
|
|
|
include $(K)/env/makefile.env
|
2026-07-18 18:48:23 +02:00
|
|
|
|
|
|
|
|
# Source files
|
2026-09-07 22:37:05 +02:00
|
|
|
BASENAMES := util error locator file argv character ktype katom katom_process \
|
|
|
|
|
katomize katom_rewrite_rules katom_matching \
|
2026-07-30 23:50:07 +02:00
|
|
|
log show command argument argument_set argtype argtype_registry \
|
2026-08-06 13:11:37 +02:00
|
|
|
state eval eval_python eval_cpp klammer klammer_registry klammerset klammerset_registry \
|
|
|
|
|
option_set option_set_registry deftype \
|
2026-08-12 17:20:23 +02:00
|
|
|
target target_registry machine font_store check coverage
|
2026-07-18 18:48:23 +02:00
|
|
|
|
|
|
|
|
SOURCES := $(addsuffix .cpp,$(BASENAMES))
|
|
|
|
|
OBJECTS := $(addsuffix .o,$(BASENAMES))
|
|
|
|
|
HEADERS := $(addsuffix .h,$(BASENAMES))
|
|
|
|
|
DEPFILES := $(addsuffix .d,$(BASENAMES))
|
|
|
|
|
|
|
|
|
|
# Shared library
|
|
|
|
|
LIBDIR := ../lib
|
|
|
|
|
LIBRARY := $(LIBDIR)/libklammertext.so
|
|
|
|
|
|
|
|
|
|
# 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
|
2026-09-07 22:37:05 +02:00
|
|
|
.PHONY: all sks ref clean redo clang
|
2026-07-18 18:48:23 +02:00
|
|
|
|
|
|
|
|
all : $(LIBRARY)
|
|
|
|
|
$(MAKE) sks
|
2026-09-07 22:37:05 +02:00
|
|
|
$(MAKE) ref
|
2026-07-18 18:48:23 +02:00
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
2026-09-07 22:37:05 +02:00
|
|
|
# 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
|
|
|
|
|
|
2026-07-18 18:48:23 +02:00
|
|
|
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)
|