makefile.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. #
  3. # curl compilation script for the OS/400.
  4. #
  5. #
  6. # This is a shell script since make is not a standard component of OS/400.
  7. SCRIPTDIR=`dirname "${0}"`
  8. . "${SCRIPTDIR}/initscript.sh"
  9. cd "${TOPDIR}"
  10. # Create the OS/400 library if it does not exist.
  11. if action_needed "${LIBIFSNAME}"
  12. then CMD="CRTLIB LIB(${TARGETLIB}) TEXT('curl: multiprotocol support API')"
  13. system "${CMD}"
  14. fi
  15. # Create the DOCS source file if it does not exist.
  16. if action_needed "${LIBIFSNAME}/DOCS.FILE"
  17. then CMD="CRTSRCPF FILE(${TARGETLIB}/DOCS) RCDLEN(240)"
  18. CMD="${CMD} CCSID(${TGTCCSID}) TEXT('Documentation texts')"
  19. system "${CMD}"
  20. fi
  21. # Copy some documentation files if needed.
  22. for TEXT in "${TOPDIR}/COPYING" "${SCRIPTDIR}/README.OS400" \
  23. "${TOPDIR}/CHANGES" "${TOPDIR}/docs/THANKS" "${TOPDIR}/docs/FAQ" \
  24. "${TOPDIR}/docs/FEATURES" "${TOPDIR}/docs/SSLCERTS.md" \
  25. "${TOPDIR}/docs/RESOURCES" "${TOPDIR}/docs/VERSIONS" \
  26. "${TOPDIR}/docs/HISTORY.md"
  27. do MEMBER="`basename \"${TEXT}\" .OS400`"
  28. MEMBER="`basename \"${MEMBER}\" .md`"
  29. MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR"
  30. if action_needed "${MEMBER}" "${TEXT}"
  31. then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
  32. CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"
  33. system "${CMD}"
  34. fi
  35. done
  36. # Build in each directory.
  37. # for SUBDIR in include lib src tests
  38. for SUBDIR in include lib src
  39. do "${SCRIPTDIR}/make-${SUBDIR}.sh"
  40. done