暂无描述

build_mac.sh 573B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash -x
  2. # This is a script that generates the test MacOS executables in this directory.
  3. # It should be needed very rarely to run this script. It is mostly provided
  4. # as a future reference on how the original binary set was created.
  5. set -o errexit
  6. cat <<EOF >/tmp/hello.cc
  7. #include <stdio.h>
  8. int main() {
  9. printf("Hello, world!\n");
  10. return 0;
  11. }
  12. EOF
  13. cat <<EOF >/tmp/lib.c
  14. int foo() {
  15. return 1;
  16. }
  17. int bar() {
  18. return 2;
  19. }
  20. EOF
  21. cd $(dirname $0)
  22. rm -rf exe_mac_64* lib_mac_64*
  23. clang -g -o exe_mac_64 /tmp/hello.c
  24. clang -g -o lib_mac_64 -dynamiclib /tmp/lib.c