docs.sheetjs.com/docz/static/hermes/Makefile

75 lines
3.5 KiB
Makefile
Raw Permalink Normal View History

2024-04-26 04:16:13 +00:00
# Note: The official Hermes documentation includes zero guidance on embedding.=
# Tested against commit d070c749bcf6fb635579433421a976c29d7a2bb7 on darwin-x64
# History https://git.sheetjs.com/sheetjs/docs.sheetjs.com/commits/branch/master/docz/static/hermes/Makefile
2023-05-30 06:41:09 +00:00
2023-08-28 22:40:53 +00:00
MYCC=llvm-g++
2024-01-29 03:29:45 +00:00
POSTAMBLE=-framework CoreFoundation -Wl,-rpath .
2023-08-28 22:40:53 +00:00
UNAME__S := $(shell uname -s)
ifeq ($(UNAME__S),Linux)
MYCC=g++
2024-01-29 03:29:45 +00:00
POSTAMBLE=-pthread -licuuc -licudata -licuio -licutu -licui18n -Wl,-rpath=./
2023-08-28 22:40:53 +00:00
endif
2023-05-30 06:41:09 +00:00
.PHONY: doit
doit: sheetjs-hermes
2023-08-03 02:49:32 +00:00
if [ ! -e xlsx.full.min.js ]; then curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js; fi
2024-04-26 04:16:13 +00:00
if [ ! -e pres.numbers ]; then curl -LO https://docs.sheetjs.com/pres.numbers; fi
2024-01-29 03:29:45 +00:00
if [ -e ./build_release/API/hermes/libhermes.so ]; then cp ./build_release/API/hermes/libhermes.so .; fi
if [ -e ./build_release/API/hermes/libhermes.dylib ]; then cp ./build_release/API/hermes/libhermes.dylib .; fi
if [ -e ./build_release/jsi/libjsi.so ]; then cp ./build_release/jsi/libjsi.so .; fi
if [ -e ./build_release/jsi/libjsi.dylib ]; then cp ./build_release/jsi/libjsi.dylib .; fi
2023-05-30 06:41:09 +00:00
./sheetjs-hermes pres.numbers
.PHONY: clean
clean:
rm -f sheetjs-hermes
.PHONY: clean-all
clean-all: clean
rm -rf build_release hermes xlsx.full.min.js pres.numbers
# This sequence was cobbled together by linking against every artifact.
# Some of these lines are likely extraneous
sheetjs-hermes: sheetjs-hermes.cpp init
2023-08-28 22:40:53 +00:00
$(MYCC) $< -o $@ -std=gnu++17 \
2023-05-30 06:41:09 +00:00
-Ihermes/include/ -Ihermes/API/ -Ihermes/API/jsi -Ihermes/public \
2023-08-28 22:40:53 +00:00
-Lbuild_release/API/hermes/ -lsynthTrace -lsynthTraceParser \
2024-01-29 03:29:45 +00:00
-lhermes \
2023-08-28 22:40:53 +00:00
-Lbuild_release/lib/VM/ -lhermesVMRuntime \
-Lbuild_release/lib/BCGen/HBC/ -lhermesHBCBackend \
-Lbuild_release/lib/BCGen/ -lhermesBackend \
-Lbuild_release/lib/SourceMap/ -lhermesSourceMap \
-Lbuild_release/lib/Parser/ -lhermesParser \
-Lbuild_release/lib/Platform/Unicode/ -lhermesPlatformUnicode \
-lcompileJS -ltimerStats -ltraceInterpreter \
2023-05-30 06:41:09 +00:00
-Lbuild_release/external/llvh/lib/Demangle/ -lLLVHDemangle \
-Lbuild_release/external/llvh/lib/Support/ -lLLVHSupport \
-Lbuild_release/jsi/ -ljsi \
-Lbuild_release/lib/ -lhermesFrontend \
-Lbuild_release/lib/ -lhermesOptimizer \
-Lbuild_release/lib/ADT -lhermesADT \
-Lbuild_release/lib/AST/ -lhermesAST \
-Lbuild_release/lib/AST2JS/ -lhermesAST2JS \
-Lbuild_release/lib/CompilerDriver/ -lhermesCompilerDriver \
-Lbuild_release/lib/ConsoleHost/ -lhermesConsoleHost \
-Lbuild_release/lib/DependencyExtractor/ -lhermesDependencyExtractor \
-Lbuild_release/lib/FlowParser/ -lhermesFlowParser \
-Lbuild_release/lib/FrontEndDefs/ -lhermesFrontEndDefs \
-Lbuild_release/lib/Inst/ -lhermesInst \
-Lbuild_release/lib/InternalBytecode/ -lhermesInternalBytecode \
-Lbuild_release/lib/Platform/ -lhermesPlatform \
-Lbuild_release/lib/Platform/Intl/ -lhermesBCP47Parser \
-Lbuild_release/lib/Regex/ -lhermesRegex \
-Lbuild_release/lib/Support/ -lhermesSupport \
-Lbuild_release/public/hermes/Public -lhermesPublic \
-Lhermes/external/flowparser/ -lflowparser-mac \
2023-08-28 22:40:53 +00:00
-Lbuild_release/external/dtoa/ -ldtoa \
$(POSTAMBLE)
2023-05-30 06:41:09 +00:00
2024-01-29 03:29:45 +00:00
sheetjs-hermes.cpp:
curl -LO https://docs.sheetjs.com/hermes/sheetjs-hermes.cpp
2023-05-30 06:41:09 +00:00
.PHONY: init
init:
2024-04-26 04:16:13 +00:00
if [ ! -e hermes ]; then git clone https://github.com/facebook/hermes.git; cd hermes; git checkout d070c749bcf6fb635579433421a976c29d7a2bb7; cd ..; fi
2024-01-29 03:29:45 +00:00
if [ ! -e build_release ]; then cmake -S hermes -B build_release -G Ninja -DCMAKE_BUILD_TYPE=Release -DHERMES_BUILD_APPLE_FRAMEWORK=OFF; cmake --build ./build_release; fi