68 lines
2.8 KiB
Makefile
68 lines
2.8 KiB
Makefile
# Note: The official Hermes documentation includes zero guidance on embedding.
|
|
# Tested against commit 84732b3ce6a859cbc6a20112437c81154f111fe7
|
|
|
|
MYCC=llvm-g++
|
|
POSTAMBLE=-framework CoreFoundation
|
|
|
|
UNAME__S := $(shell uname -s)
|
|
ifeq ($(UNAME__S),Linux)
|
|
MYCC=g++
|
|
POSTAMBLE=-pthread -licuuc -licudata -licuio -licutu -licui18n
|
|
endif
|
|
|
|
.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
|
|
$(MYCC) $< -o $@ -std=gnu++17 \
|
|
-Ihermes/include/ -Ihermes/API/ -Ihermes/API/jsi -Ihermes/public \
|
|
-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 \
|
|
-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 \
|
|
-Lbuild_release/external/dtoa/ -ldtoa \
|
|
$(POSTAMBLE)
|
|
|
|
.PHONY: init
|
|
init:
|
|
if [ ! -e hermes ]; then git clone https://github.com/facebook/hermes.git; cd hermes; git checkout 84732b3ce6a859cbc6a20112437c81154f111fe7; cd ..; fi
|
|
if [ ! -e build_release ]; then cmake -S hermes -B build_release -G Ninja -DCMAKE_BUILD_TYPE=Release; cmake --build ./build_release; fi
|