]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/deploy-macos.sh
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / deploy-macos.sh
1 #!/bin/bash
2
3 # Clean left overs from previous builds if there are any
4 rm -f -R antlr4-runtime build lib 2> /dev/null
5 rm antlr4-cpp-runtime-macos.zip 2> /dev/null
6
7 # Get utf8 dependency.
8 mkdir -p runtime/thirdparty 2> /dev/null
9 pushd runtime/thirdparty
10 if [ ! -d utfcpp ]
11 then
12     git clone https://github.com/nemtrif/utfcpp.git utfcpp
13     pushd utfcpp
14     git checkout tags/v3.1.1
15     popd
16 fi
17 popd
18
19 # Binaries
20 xcodebuild -project runtime/antlrcpp.xcodeproj \
21            -target antlr4                      \
22            # GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS USE_UTF8_INSTEAD_OF_CODECVT' \
23            -configuration Release
24 xcodebuild -project runtime/antlrcpp.xcodeproj \
25            -target antlr4_static               \
26            # GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS USE_UTF8_INSTEAD_OF_CODECVT' \
27            -configuration Release
28 rm -f -R lib
29 mkdir lib
30 mv runtime/build/Release/libantlr4-runtime.a lib/
31 mv runtime/build/Release/libantlr4-runtime.dylib lib/
32
33 # Headers
34 rm -f -R antlr4-runtime
35 pushd runtime/src
36 find . -name '*.h' | cpio -pdm ../../antlr4-runtime
37 popd
38 pushd runtime/thirdparty/utfcpp/source
39 find . -name '*.h' | cpio -pdm ../../../../antlr4-runtime
40 popd
41
42 # Zip up and clean up
43 zip -r antlr4-cpp-runtime-macos.zip antlr4-runtime lib
44
45 rm -f -R antlr4-runtime build lib
46
47 # Deploy
48 #cp antlr4-cpp-runtime-macos.zip ~/antlr/sites/website-antlr4/download