Tcl Extension Architecture (TEA) Sample Extension

Check-in [f5f3d48f4e]
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Moved pkgindex to rules and cleaned up
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | vc-reform
Files: files | file ages | folders
SHA1: f5f3d48f4e92bb244d88dbf2af4cac1741c89e33
User & Date: ashok 2017-10-05 17:07:15
Context
2017-10-06
13:43
Use standard targets from targets.vc check-in: 9107449556 user: ashok tags: vc-reform
2017-10-05
17:07
Moved pkgindex to rules and cleaned up check-in: f5f3d48f4e user: ashok tags: vc-reform
2017-10-04
13:36
Use macros and targets from reworked rules.vc check-in: e2ca4bafe0 user: ashok tags: vc-reform
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/sample.h.

    23     23   #else
    24     24   #   if ((1<<31)<0)
    25     25   typedef unsigned long sha_uint32_t;
    26     26   #   else
    27     27   typedef unsigned int sha_uint32_t;
    28     28   #   endif
    29     29   #endif
           30  +
    30     31   
    31     32   /*
    32     33    * For C++ compilers, use extern "C"
    33     34    */
    34     35   
    35     36   #ifdef __cplusplus
    36     37   extern "C" {

Changes to win/makefile.vc.

   135    135   #       Targeting Windows pre64 RETAIL
   136    136   #       c:\tcl_src\win\>nmake -f makefile.vc MACHINE=IA64
   137    137   #
   138    138   #------------------------------------------------------------------------------
   139    139   #==============================================================================
   140    140   #------------------------------------------------------------------------------
   141    141   
   142         -!if !exist("makefile.vc")
   143         -MSG = ^
   144         -You must run this makefile only from the directory it is in.^
   145         -Please `cd` to its location first.
   146         -!error $(MSG)
   147         -!endif
   148         -
   149         -#-------------------------------------------------------------------------
   150         -# Project specific information (EDIT)
   151         -#
   152         -# You should edit this with the name and version of your project. This
   153         -# information is used to generate the name of the package library and
   154         -# it's install location.
   155         -#
   156         -# For example, the sample extension is  going to build sample05.dll and
   157         -# would install it into $(INSTALLDIR)\lib\sample05
   158         -#
   159         -# You need to specify the object files that need to be linked into your
   160         -# binary here.
   161         -#
   162         -#-------------------------------------------------------------------------
   163         -
          142  +# The name of the package
   164    143   PROJECT = sample
   165    144   
   166    145   # Uncomment the following line if this is a Tk extension.
   167    146   #PROJECT_REQUIRES_TK=1
   168    147   !include "rules-ext.vc"
   169    148   
          149  +# Define the object files and resource file that make up the extension.
          150  +# Note the resource file does not makes sense if doing a static library build
          151  +# hence it is under that condition. TMP_DIR is the output directory
          152  +# defined by rules for object files.
   170    153   PRJ_OBJS = \
   171    154   	$(TMP_DIR)\tclsample.obj \
   172    155   	$(TMP_DIR)\sample.obj \
   173    156   !if !$(STATIC_BUILD)
   174    157   	$(TMP_DIR)\sample.res
   175    158   !endif
   176    159   
   177         -# Additional compiler defines needed for this project
   178         -PRJ_DEFINES = -DMODULE_SCOPE=extern \
   179         -	      -DPACKAGE_NAME="\"$(PROJECT)\"" \
   180         -              -DPACKAGE_VERSION="\"$(DOTVERSION)\"" \
   181         -              -D_CRT_SECURE_NO_WARNINGS
          160  +# Define any additional compiler flags that might be required for the project
          161  +PRJ_DEFINES = -D_CRT_SECURE_NO_DEPRECATE
   182    162   
          163  +# Default target is all which in turn uses the setup and pkgindex generation
          164  +# targets from rules.
          165  +all:	    setup pkgindex $(PRJLIB)
   183    166   
   184         -#---------------------------------------------------------------------
   185         -# TclTest flags
   186         -#---------------------------------------------------------------------
   187         -
   188         -!if "$(TESTPAT)" != ""
   189         -TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
   190         -!endif
   191         -
   192         -#---------------------------------------------------------------------
   193         -# Project specific targets (EDIT)
   194         -#---------------------------------------------------------------------
   195         -
   196         -all:	    setup pkgIndex $(PRJLIB)
   197         -
          167  +# MAKEBINCMD will do shared, static and debug links as appropriate
          168  +# _VC_MANIFEST_EMBED_DLL embeds the manifest for shared libraries
          169  +# and is a no-op for static libraries
   198    170   $(PRJLIB): $(PRJ_OBJS)
   199    171          $(MAKEBINCMD) $**
   200    172          $(_VC_MANIFEST_EMBED_DLL)
   201    173          [email protected] $*.exp
   202    174   
   203         -pkgIndex:   $(OUT_DIR)\pkgIndex.tcl
   204         -
   205         -test: setup $(PROJECT)
   206         -	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
   207         -	@set TCLLIBPATH=$(OUT_DIR_PATH:\=/)
   208         -!if $(TCLINSTALL)
   209         -	@set PATH=$(_TCLDIR)\bin;$(PATH)
   210         -!else
   211         -	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
   212         -!endif
   213         -	$(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS)
   214         -
   215         -shell: setup $(PROJECT)
   216         -	@set VLERQ_LIBRARY=$(LIBDIR:\=/)
   217         -	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
   218         -	@set TCLLIBPATH=$(OUT_DIR_PATH:\=/)
   219         -!if $(TCLINSTALL)
   220         -	@set PATH=$(_TCLDIR)\bin;$(PATH)
   221         -!else
   222         -	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
   223         -!endif
   224         -	$(DEBUGGER) $(TCLSH) $(SCRIPT)
   225         -
   226         -
   227         -#-------------------------------------------------------------------------
   228         -# Explicit dependency rules
   229         -#
   230         -#-------------------------------------------------------------------------
   231         -
   232         -$(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in
   233         -	@nmakehlp -s << $** > [email protected]
   234         -@[email protected]    $(DOTVERSION)
   235         -@[email protected]       $(PROJECT)
   236         -@[email protected]       $(PRJLIBNAME)
   237         -<<
   238         -	@echo package ifneeded sample $(DOTVERSION) \
   239         -	    [list load [file join $$dir $(PRJLIBNAME)] Sample] >> [email protected]
   240         -
   241         -#---------------------------------------------------------------------
   242         -# Installation. (EDIT)
   243         -#
   244         -# You may need to modify this section to reflect the final distribution
   245         -# of your files and possibly to generate documentation.
   246         -#
   247         -#---------------------------------------------------------------------
   248         -
          175  +# The default install target only installs binaries and scripts so add
          176  +# an additional target for our documentation. Note this *adds* a target
          177  +# since no commands are listed after it. The original targets for
          178  +# install (from rules.vc) will remain.
   249    179   install: install-docs
   250    180   
   251    181   install-docs:
   252    182   	@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
   253    183   	@if exist $(DOCDIR) $(CPY) $(DOCDIR)\*.n "$(DOC_INSTALL_DIR)"
   254    184   
   255    185