makefile.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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(112)"
  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" \
  25. "${TOPDIR}/docs/RESOURCES" "${TOPDIR}/docs/VERSIONS" \
  26. "${TOPDIR}/docs/HISTORY"
  27. do MEMBER="`basename \"${TEXT}\" .OS400`"
  28. MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR"
  29. if action_needed "${MEMBER}" "${TEXT}"
  30. then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
  31. CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"
  32. system "${CMD}"
  33. fi
  34. done
  35. # Build in each directory.
  36. for SUBDIR in include lib src tests
  37. do "${SCRIPTDIR}/make-${SUBDIR}.sh"
  38. done