Initial commit: Klammertext source distribution
Curated source subset assembled by klammertext-dev's doc/make_dist.sh: the Klammermachine (mac), the Standard Klammer Set (sks), the commands (com), editor plugins and install guides (doc), a test subset (tst), and lib/bin placeholders. Builds with 'make -C com'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
58
sks/document/Makefile
Normal file
58
sks/document/Makefile
Normal file
@@ -0,0 +1,58 @@
|
||||
# Klammertext sks/document/ Makefile
|
||||
# Improved version with automatic header dependency tracking
|
||||
|
||||
K := $(KLAMMERTEXT_HOME)
|
||||
KS := $(K)/sks
|
||||
KM := $(K)/mac
|
||||
|
||||
include $(KM)/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 \
|
||||
$(KS)/target/font_resolve.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) -lklammertext $(LDLIBS)
|
||||
|
||||
clean :
|
||||
rm -f $(LOCAL_OBJECTS) $(LOCAL_DEPFILES) *.so *~ __pycache__
|
||||
|
||||
# Include generated dependency files (if they exist)
|
||||
-include $(LOCAL_DEPFILES)
|
||||
Reference in New Issue
Block a user