2021-12-28 10:18:21 +01:00
|
|
|
# TEXLIVE_SRC must be a precompiled TEXLIVE build with dynamic libraries
|
2022-10-09 01:09:01 +02:00
|
|
|
TEXLIVE_SRC = $(HOME)/texlive-mingw
|
|
|
|
LUAMETATEX_SRC = $(HOME)/luametatex
|
2021-12-28 10:18:21 +01:00
|
|
|
# We expect to find a precompiled static library compiled with -fpic here
|
2022-10-09 01:09:01 +02:00
|
|
|
LUA_DIR = $(LUAMETATEX_SRC)/source/luacore/lua54/src
|
2021-12-28 10:18:21 +01:00
|
|
|
# HarfBuzz also should be compiled static, position independent in a build_meson subdirectory
|
2022-01-02 11:01:00 +01:00
|
|
|
HARFBUZZ_DIR = $(TEXLIVE_SRC)/Work/libs/harfbuzz
|
2021-12-28 10:22:25 +01:00
|
|
|
# Graphite also should be compiled static, position independent in a build subdirectory
|
2022-01-02 11:01:00 +01:00
|
|
|
GRAPHITE_DIR = $(TEXLIVE_SRC)/Work/libs/graphite2
|
2021-12-28 10:18:21 +01:00
|
|
|
|
2022-01-02 11:01:00 +01:00
|
|
|
HB_INCLUDE_DIRS = $(HARFBUZZ_DIR)/include
|
2021-12-28 10:18:21 +01:00
|
|
|
TL_INCLUDE_DIRS = $(TEXLIVE_SRC)/Work/texk $(TEXLIVE_SRC)/texk
|
|
|
|
LUA_INCLUDE_DIRS = $(LUA_DIR)
|
2022-10-09 01:09:01 +02:00
|
|
|
LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
|
2021-12-28 10:18:21 +01:00
|
|
|
LINK.so = $(LINK.o) -shared
|
|
|
|
|
|
|
|
LUAHARFBUZZ_SRCS = $(wildcard luaharfbuzz/src/luaharfbuzz/*.c)
|
|
|
|
LUAHARFBUZZ_OBJS = $(patsubst %.c,%.o,$(LUAHARFBUZZ_SRCS))
|
|
|
|
|
2022-01-02 11:01:00 +01:00
|
|
|
|
2021-12-28 10:18:21 +01:00
|
|
|
override CFLAGS += -fpic -DHAVE_DECL_ISASCII=1 $(patsubst %,-I%,$(INCLUDE_DIRS))
|
2022-01-02 11:01:00 +01:00
|
|
|
# For Linux
|
2022-10-09 01:09:01 +02:00
|
|
|
# override LDFLAGS += -Wl,linkscript.ld -Wl,--gc-sections
|
|
|
|
# SO_EXT = so
|
2021-12-28 10:18:21 +01:00
|
|
|
# For Windows instead:
|
2022-10-09 01:09:01 +02:00
|
|
|
# override LDFLAGS += -Wl,-version-script=versionscript -Wl,--gc-sections
|
|
|
|
SO_EXT = dll
|
2022-01-02 11:01:00 +01:00
|
|
|
# For MacOS instead:
|
|
|
|
# override LDFLAGS += -Wl,-exported_symbols_list,symbols_list,-alias_list,alias_list -lc++abi
|
|
|
|
# SO_EXT = dylib
|
2021-12-28 10:18:21 +01:00
|
|
|
|
|
|
|
luaharfbuzz/src/luaharfbuzz/%.o: INCLUDE_DIRS = $(HB_INCLUDE_DIRS) $(LUA_INCLUDE_DIRS)
|
|
|
|
luametalatex-kpse/lkpselib.o: INCLUDE_DIRS = $(TL_INCLUDE_DIRS) $(LUA_INCLUDE_DIRS)
|
|
|
|
|
2022-01-02 11:01:00 +01:00
|
|
|
luametalatex.$(SO_EXT): luametalatex-kpse/lkpselib.o $(LUAHARFBUZZ_OBJS) $(TEXLIVE_SRC)/Work/texk/kpathsea/.libs/libkpathsea.a $(HARFBUZZ_DIR)/libharfbuzz.a $(GRAPHITE_DIR)/libgraphite2.a $(LUA_DIR)/liblua.a
|
2021-12-28 10:18:21 +01:00
|
|
|
|
2022-01-02 11:01:00 +01:00
|
|
|
%.$(SO_EXT):
|
2021-12-28 10:18:21 +01:00
|
|
|
$(LINK.so) $^ $(LOADLIBES) $(LDLIBS) -o $@
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2022-01-02 11:01:00 +01:00
|
|
|
rm $(LUAHARFBUZZ_OBJS) luametalatex-kpse/lkpselib.o luametalatex.$(SO_EXT)
|
2021-12-28 10:18:21 +01:00
|
|
|
|
|
|
|
# lkpselib.o: lkpselib.c
|