targets.vc 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #------------------------------------------------------------- -*- makefile -*-
  2. # targets.vc --
  3. #
  4. # Part of the nmake based build system for Tcl and its extensions.
  5. # This file defines some standard targets for the convenience of extensions
  6. # and can be optionally included by the extension makefile.
  7. # See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for docs.
  8. $(PROJECT): setup pkgindex $(PRJLIB)
  9. !ifdef PRJ_STUBOBJS
  10. $(PROJECT): $(PRJSTUBLIB)
  11. $(PRJSTUBLIB): $(PRJ_STUBOBJS)
  12. $(LIBCMD) $**
  13. $(PRJ_STUBOBJS):
  14. $(CCSTUBSCMD) %s
  15. !endif # PRJ_STUBOBJS
  16. !ifdef PRJ_MANIFEST
  17. $(PROJECT): $(PRJLIB).manifest
  18. $(PRJLIB).manifest: $(PRJ_MANIFEST)
  19. @nmakehlp -s << $** >$@
  20. @MACHINE@ $(MACHINE:IX86=X86)
  21. <<
  22. !endif
  23. !if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk"
  24. $(PRJLIB): $(PRJ_OBJS) $(RESFILE)
  25. !if $(STATIC_BUILD)
  26. $(LIBCMD) $**
  27. !else
  28. $(DLLCMD) $**
  29. $(_VC_MANIFEST_EMBED_DLL)
  30. !endif
  31. -@del $*.exp
  32. !endif
  33. !if "$(PRJ_HEADERS)" != "" && "$(PRJ_OBJS)" != ""
  34. $(PRJ_OBJS): $(PRJ_HEADERS)
  35. !endif
  36. # If parent makefile has defined stub objects, add their installation
  37. # to the default install
  38. !if "$(PRJ_STUBOBJS)" != ""
  39. default-install: default-install-stubs
  40. !endif
  41. # Unlike the other default targets, these cannot be in rules.vc because
  42. # the executed command depends on existence of macro PRJ_HEADERS_PUBLIC
  43. # that the parent makefile will not define until after including rules-ext.vc
  44. !if "$(PRJ_HEADERS_PUBLIC)" != ""
  45. default-install: default-install-headers
  46. default-install-headers:
  47. @echo Installing headers to '$(INCLUDE_INSTALL_DIR)'
  48. @for %f in ($(PRJ_HEADERS_PUBLIC)) do @$(COPY) %f "$(INCLUDE_INSTALL_DIR)"
  49. !endif
  50. !if "$(DISABLE_STANDARD_TARGETS)" == ""
  51. DISABLE_STANDARD_TARGETS = 0
  52. !endif
  53. !if "$(DISABLE_TARGET_setup)" == ""
  54. DISABLE_TARGET_setup = 0
  55. !endif
  56. !if "$(DISABLE_TARGET_install)" == ""
  57. DISABLE_TARGET_install = 0
  58. !endif
  59. !if "$(DISABLE_TARGET_clean)" == ""
  60. DISABLE_TARGET_clean = 0
  61. !endif
  62. !if "$(DISABLE_TARGET_test)" == ""
  63. DISABLE_TARGET_test = 0
  64. !endif
  65. !if "$(DISABLE_TARGET_shell)" == ""
  66. DISABLE_TARGET_shell = 0
  67. !endif
  68. !if !$(DISABLE_STANDARD_TARGETS)
  69. !if !$(DISABLE_TARGET_setup)
  70. setup: default-setup
  71. !endif
  72. !if !$(DISABLE_TARGET_install)
  73. install: default-install
  74. !endif
  75. !if !$(DISABLE_TARGET_clean)
  76. clean: default-clean
  77. realclean: hose
  78. hose: default-hose
  79. distclean: realclean default-distclean
  80. !endif
  81. !if !$(DISABLE_TARGET_test)
  82. test: default-test
  83. !endif
  84. !if !$(DISABLE_TARGET_shell)
  85. shell: default-shell
  86. !endif
  87. !endif # DISABLE_STANDARD_TARGETS