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

68 lines
2.8 KiB
Makefile
Raw Normal View History

2023-05-30 06:41:09 +00:00
# Note: The official Hermes documentation includes zero guidance on embedding.
2023-08-03 02:49:32 +00:00
# Tested against commit 70af78ba69391645749b40a3674d7321c4d6177a
2023-05-30 06:41:09 +00:00
2023-08-28 22:40:53 +00:00
MYCC=llvm-g++
POSTAMBLE=-framework CoreFoundation
UNAME__S := $(shell uname -s)
ifeq ($(UNAME__S),Linux)
MYCC=g++
2023-08-31 22:09:08 +00:00
POSTAMBLE=-pthread -licuuc -licudata -licuio -licutu -licui18n
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
if [ ! -e pres.numbers ]; then curl -LO https://sheetjs.com/pres.numbers; 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 \
-lhermesapi \
-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
.PHONY: init
init:
2023-08-03 02:49:32 +00:00
if [ ! -e hermes ]; then git clone https://github.com/facebook/hermes.git; cd hermes; git checkout 70af78ba69391645749b40a3674d7321c4d6177a; cd ..; fi
2023-08-28 22:40:53 +00:00
if [ ! -e build_release ]; then cmake -S hermes -B build_release -G Ninja -DCMAKE_BUILD_TYPE=Release; cmake --build ./build_release; fi