makefile.sh 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  10. #
  11. # This software is licensed as described in the file COPYING, which
  12. # you should have received as part of this distribution. The terms
  13. # are also available at https://curl.se/docs/copyright.html.
  14. #
  15. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. # copies of the Software, and permit persons to whom the Software is
  17. # furnished to do so, under the terms of the COPYING file.
  18. #
  19. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  20. # KIND, either express or implied.
  21. #
  22. ###########################################################################
  23. #
  24. # curl compilation script for the OS/400.
  25. #
  26. #
  27. # This is a shell script since make is not a standard component of OS/400.
  28. SCRIPTDIR=`dirname "${0}"`
  29. . "${SCRIPTDIR}/initscript.sh"
  30. cd "${TOPDIR}"
  31. # Create the OS/400 library if it does not exist.
  32. if action_needed "${LIBIFSNAME}"
  33. then CMD="CRTLIB LIB(${TARGETLIB}) TEXT('curl: multiprotocol support API')"
  34. system "${CMD}"
  35. fi
  36. # Create the DOCS source file if it does not exist.
  37. if action_needed "${LIBIFSNAME}/DOCS.FILE"
  38. then CMD="CRTSRCPF FILE(${TARGETLIB}/DOCS) RCDLEN(240)"
  39. CMD="${CMD} CCSID(${TGTCCSID}) TEXT('Documentation texts')"
  40. system "${CMD}"
  41. fi
  42. # Copy some documentation files if needed.
  43. for TEXT in "${TOPDIR}/COPYING" "${SCRIPTDIR}/README.OS400" \
  44. "${TOPDIR}/CHANGES" "${TOPDIR}/docs/THANKS" "${TOPDIR}/docs/FAQ" \
  45. "${TOPDIR}/docs/FEATURES" "${TOPDIR}/docs/SSLCERTS.md" \
  46. "${TOPDIR}/docs/RESOURCES" "${TOPDIR}/docs/VERSIONS.md" \
  47. "${TOPDIR}/docs/HISTORY.md"
  48. do MEMBER="`basename \"${TEXT}\" .OS400`"
  49. MEMBER="`basename \"${MEMBER}\" .md`"
  50. MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR"
  51. [ -e "${TEXT}" ] || continue
  52. if action_needed "${MEMBER}" "${TEXT}"
  53. then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
  54. CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"
  55. system "${CMD}"
  56. fi
  57. done
  58. # Build in each directory.
  59. # for SUBDIR in include lib src tests
  60. for SUBDIR in include lib src
  61. do "${SCRIPTDIR}/make-${SUBDIR}.sh"
  62. done