make-singleh.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh
  2. set -e
  3. set -x
  4. echo "
  5. #define STB_TRUETYPE_IMPLEMENTATION
  6. #define STB_IMAGE_WRITE_IMPLEMENTATION
  7. #define STB_IMAGE_IMPLEMENTATION
  8. #include <limits.h>
  9. #include <stdarg.h>
  10. #include <stdint.h>
  11. #include <stddef.h>
  12. #include <math.h>
  13. #include <stdio.h>
  14. #include <math.h>
  15. #include <stdint.h>
  16. #include <stdlib.h>
  17. #include <errno.h>
  18. #include <assert.h>
  19. #include <string.h>
  20. #include <sys/types.h>
  21. #include <sys/stat.h>
  22. #include <sys/syscall.h>
  23. #include <fcntl.h>
  24. #include <ctype.h>
  25. #include <unistd.h>
  26. " > all.h
  27. cat src/stb_*.h >> all.h
  28. cat src/utf8.h | grep -v "#include" >> all.h
  29. cat src/libcaptcha.h | grep -v "#include" >> all.h
  30. cat src/global.h | grep -v "#include" >> all.h
  31. cat src/utf8.c | grep -v "#include" > all.c
  32. cat src/libcaptcha.c | grep -v "#include" >> all.c
  33. cat src/utils.c | grep -v "#include" >> all.c
  34. cat src/font.c | grep -v "#include" >> all.c
  35. cat src/generator1.c | grep -v "#include" >> all.c
  36. cat src/transform.c | grep -v "#include" >> all.c
  37. cat src/image.c | grep -v "#include" >> all.c
  38. cat src/pattern.c | grep -v "#include" >> all.c
  39. cat src/pattern-gen.c | grep -v "#include" >> all.c
  40. cat src/preset0.c | grep -v "#include" >> all.c
  41. cat src/string.c | grep -v "#include" >> all.c
  42. mkdir -p singleh
  43. cat all.h all.c > singleh/libcaptcha.h
  44. rm all.h
  45. rm all.c
  46. cd examples
  47. cc example1.c -I../singleh -lm -o shtest
  48. ./shtest
  49. rm shtest
  50. echo "singleh/libcaptcha.h is ready"