@@ -40,17 +40,18 @@ $(error Unknown target)
40
40
41
41
endif
42
42
43
- LLVM_COMPONENTS = all-targets analysis asmparser asmprinter bitreader bitwriter codegen core coroutines debuginfodwarf executionengine instrumentation interpreter ipo irreader linker lto mc mcjit objcarcopts option profiledata scalaropts support target
43
+ LLVM_COMPONENTS = all-targets analysis asmparser asmprinter bitreader bitwriter codegen core coroutines coverage debuginfodwarf executionengine instrumentation interpreter ipo irreader linker lto mc mcjit objcarcopts option profiledata scalaropts support target
44
44
45
45
CLANG_LIBS = -Wl,--start-group $(abspath $(LLVM_BUILDDIR ) ) /lib/libclang.a -lclangAnalysis -lclangARCMigrate -lclangAST -lclangASTMatchers -lclangBasic -lclangCodeGen -lclangCrossTU -lclangDriver -lclangDynamicASTMatchers -lclangEdit -lclangFormat -lclangFrontend -lclangFrontendTool -lclangHandleCXX -lclangHandleLLVM -lclangIndex -lclangLex -lclangParse -lclangRewrite -lclangRewriteFrontend -lclangSema -lclangSerialization -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangStaticAnalyzerFrontend -lclangTooling -lclangToolingASTDiff -lclangToolingCore -lclangToolingInclusions -lclangToolingRefactor -Wl,--end-group -lstdc++
46
46
47
47
LLD_LIBS = -Wl,--start-group -llldCOFF -llldCommon -llldCore -llldDriver -llldELF -llldMachO -llldMinGW -llldReaderWriter -llldWasm -llldYAML -Wl,--end-group
48
48
49
49
50
50
# For static linking.
51
- CGO_CPPFLAGS =$(shell $(LLVM_BUILDDIR ) /bin/llvm-config --cppflags) -I$(abspath $(CLANG_SRC ) ) /include -I$(abspath $(LLD_SRC ) ) /include
51
+ CGO_CPPFLAGS =$(shell $(LLVM_BUILDDIR ) /bin/llvm-config --cppflags) -I$(abspath $(LLVM_BUILDDIR ) ) /tools/clang/include -I $( abspath $( CLANG_SRC ) ) /include -I$(abspath $(LLD_SRC ) ) /include
52
52
CGO_CXXFLAGS=-std =c++11
53
53
CGO_LDFLAGS =-L$(LLVM_BUILDDIR ) /lib $(CLANG_LIBS ) $(LLD_LIBS ) $(shell $(LLVM_BUILDDIR ) /bin/llvm-config --ldflags --libs --system-libs $(LLVM_COMPONENTS ) )
54
+ LLVM_VERSION =$(shell $(LLVM_BUILDDIR ) /bin/llvm-config --version)
54
55
55
56
56
57
@@ -116,6 +117,7 @@ static:
116
117
CGO_CPPFLAGS=" $( CGO_CPPFLAGS) " CGO_CXXFLAGS=" $( CGO_CXXFLAGS) " CGO_LDFLAGS=" $( CGO_LDFLAGS) " go build -o build/tinygo -tags byollvm .
117
118
118
119
release : static gen-device
120
+ @rm -rf build/release
119
121
@mkdir -p build/release/tinygo/bin
120
122
@mkdir -p build/release/tinygo/lib/CMSIS/CMSIS
121
123
@mkdir -p build/release/tinygo/lib/compiler-rt/lib
@@ -132,9 +134,10 @@ release: static gen-device
132
134
@cp -rp lib/nrfx/* build/release/tinygo/lib/nrfx
133
135
@cp -rp src build/release/tinygo/src
134
136
@cp -rp targets build/release/tinygo/targets
135
- ./build/tinygo build-builtins -target=armv6m-none-eabi -o build/release/tinygo/pkg/armv6m-none-eabi/compiler-rt.a
136
- ./build/tinygo build-builtins -target=armv7m-none-eabi -o build/release/tinygo/pkg/armv7m-none-eabi/compiler-rt.a
137
- ./build/tinygo build-builtins -target=armv7em-none-eabi -o build/release/tinygo/pkg/armv7em-none-eabi/compiler-rt.a
137
+ @cp -rp $(abspath $(LLVM_BUILDDIR ) ) /lib/clang/$(LLVM_VERSION ) build/release/tinygo/clang
138
+ ./build/release/tinygo/bin/tinygo build-builtins -target=armv6m-none-eabi -o build/release/tinygo/pkg/armv6m-none-eabi/compiler-rt.a
139
+ ./build/release/tinygo/bin/tinygo build-builtins -target=armv7m-none-eabi -o build/release/tinygo/pkg/armv7m-none-eabi/compiler-rt.a
140
+ ./build/release/tinygo/bin/tinygo build-builtins -target=armv7em-none-eabi -o build/release/tinygo/pkg/armv7em-none-eabi/compiler-rt.a
138
141
tar -czf build/release.tar.gz -C build/release tinygo
139
142
140
143
# Binary that can run on the host.
0 commit comments