Makefile.inc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # $OpenBSD: Makefile.inc,v 1.7 2002/04/29 01:02:28 hugh Exp $
  2. # $NetBSD: Makefile.inc,v 1.2 1997/01/23 22:29:09 cgd Exp $
  3. #
  4. # Configuration variables (default values are below):
  5. #
  6. # S must be set to the top of the 'sys' tree.
  7. # ZDST may be set to the location of the directory where library
  8. # objects are to be built. Defaults to ${.OBJDIR}/lib/z.
  9. # Z_AS may be set to 'obj' to build a object from the library's
  10. # object files. (Otherwise, a library will be built.)
  11. # Defaults to 'library'.
  12. # ZMISCMAKEFLAGS
  13. # Miscellaneous flags to be passed to the library's Makefile when
  14. # building. See library's Makefile for more details about
  15. # supported flags and their default values.
  16. # Default values:
  17. ZDST?= ${.OBJDIR}/lib/z
  18. Z_AS?= library
  19. ZDIR= $S/lib/libz
  20. .if (${Z_AS} == "obj")
  21. ZLIB= ${ZDST}/libz.o
  22. ZLIB_PROF= ${ZDST}/libz.po
  23. .else
  24. ZLIB= ${ZDST}/libz.a
  25. ZLIB_PROF= ${ZDST}/libz_p.a
  26. .endif
  27. ZMAKE= \
  28. cd ${ZDIR} && MAKEOBJDIR=${ZDST} ${MAKE} \
  29. CC="${CC}" CFLAGS="${CFLAGS}" \
  30. AS=${AS} AFLAGS="${AFLAGS}" \
  31. LD=${LD} STRIP=${STRIP} \
  32. MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} \
  33. ZCPPFLAGS="${CPPFLAGS:S@^-I.@-I../../.@g}" \
  34. ${ZMISCMAKEFLAGS}
  35. ${ZLIB}: .NOTMAIN __always_make_zlib
  36. @echo making sure the z library is up to date...
  37. .if (${Z_AS} == "library")
  38. ${ZMAKE} libz.a
  39. .else
  40. @${ZMAKE} libz.o
  41. .endif
  42. ${ZLIB_PROF}: .NOTMAIN __always_make_zlib
  43. @echo making sure the profiled z library is up to date...
  44. .if (${Z_AS} == "library")
  45. @${ZMAKE} libz_p.a
  46. .else
  47. @${ZMAKE} libz.po
  48. .endif
  49. clean:: .NOTMAIN cleanzlib
  50. cleanzlib: .NOTMAIN __always_make_zlib
  51. @echo cleaning the z library objects
  52. @${ZMAKE} clean
  53. -rmdir -p ${ZDST}
  54. cleandir: .NOTMAIN cleandirzlib
  55. cleandirzlib: .NOTMAIN __always_make_zlib
  56. @echo cleandiring the z library objects
  57. @${ZMAKE} cleandir
  58. -rmdir -p ${ZDST}
  59. depend:: .NOTMAIN dependzlib
  60. dependzlib: .NOTMAIN __always_make_zlib
  61. @echo depending the z library objects
  62. @${ZMAKE} depend
  63. __always_make_zlib: .NOTMAIN
  64. -mkdir -p ${ZDST}