docs.sheetjs.com/docz/static/hermes/Makefile
2023-08-08 21:10:17 -04:00

58 lines
2.6 KiB
Makefile

# Note: The official Hermes documentation includes zero guidance on embedding.
# Tested against commit 70af78ba69391645749b40a3674d7321c4d6177a
.PHONY: doit
doit: sheetjs-hermes
if [ ! -e xlsx.full.min.js ]; then curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js; fi
if [ ! -e pres.numbers ]; then curl -LO https://sheetjs.com/pres.numbers; fi
./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
llvm-g++ $< -o $@ -std=gnu++17 \
-Ihermes/include/ -Ihermes/API/ -Ihermes/API/jsi -Ihermes/public \
-Lbuild_release/API/hermes/ -lhermesapi -lcompileJS -lsynthTrace -lsynthTraceParser -ltimerStats -ltraceInterpreter \
-Lbuild_release/external/dtoa/ -ldtoa \
-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/BCGen/ -lhermesBackend \
-Lbuild_release/lib/BCGen/HBC/ -lhermesHBCBackend \
-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/Parser/ -lhermesParser \
-Lbuild_release/lib/Platform/ -lhermesPlatform \
-Lbuild_release/lib/Platform/Intl/ -lhermesBCP47Parser \
-Lbuild_release/lib/Platform/Unicode/ -lhermesPlatformUnicode \
-Lbuild_release/lib/Regex/ -lhermesRegex \
-Lbuild_release/lib/SourceMap/ -lhermesSourceMap \
-Lbuild_release/lib/Support/ -lhermesSupport \
-Lbuild_release/lib/VM/ -lhermesVMRuntime \
-Lbuild_release/public/hermes/Public -lhermesPublic \
-Lhermes/external/flowparser/ -lflowparser-mac \
-framework CoreFoundation
.PHONY: init
init:
if [ ! -e hermes ]; then git clone https://github.com/facebook/hermes.git; cd hermes; git checkout 70af78ba69391645749b40a3674d7321c4d6177a; cd ..; fi
if [ ! -e build_release ]; then cmake -S hermes -B build_release -G Ninja -DCMAKE_BUILD_TYPE=Release; cmake --build ./build_release; fi