Tcl Extension Architecture (TEA) Sample Extension

Check-in [edee81275c]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Certain dependencies are now expressed as a dependency not a trigger. This prevents a lot of duplication of already compiled code.

Simplified the makefile's handling of DESTDIR

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | practcl
Files: files | file ages | folders
SHA1: edee81275c5a4432add4e9b4dae9085160f1b796
User & Date: hypnotoad 2016-07-07 14:04:16
Context
2016-10-13
15:28
Re-ran autoconf check-in: cbc0e011dc user: seandeelywoods tags: practcl
2016-07-07
14:04
Certain dependencies are now expressed as a dependency not a trigger. This prevents a lot of duplication of already compiled code.

Simplified the makefile's handling of DESTDIR check-in: edee81275c user: hypnotoad tags: practcl

2016-06-25
14:54
Tweak to ensure we don't overwrite the real make.tcl check-in: 13adaa3c2c user: hypnotoad tags: practcl
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.in.

196
197
198
199
200
201
202
203
204
205
206
207



208
209
210



211
212
213
214
215
216
217
#========================================================================
# Your doc target should differentiate from doc builds (by the developer)
# and doc installs (see install-doc), which just install the docs on the
# end user machine when building from source.
#========================================================================

doc:
	@echo "If you have documentation to create, place the commands to"
	@echo "build the docs in the 'doc:' target.  For example:"
	@echo "        xml2nroff sample.xml > sample.n"
	@echo "        xml2html sample.xml > sample.html"




install:
	$(TCLSH) ${srcdir}/make.tcl install $(DESTDIR)




install-package:
	$(TCLSH) ${srcdir}/make.tcl install-package $(DESTDIR)

test: binaries libraries
	$(TCLSH) `@[email protected] $(srcdir)/tests/all.tcl` $(TESTFLAGS) \
		-load "package ifneeded ${PACKAGE_NAME} ${PACKAGE_VERSION} \
			[list load `@[email protected] $(PKG_LIB_FILE)` $(PACKAGE_NAME)]"






|
<
<
<

>
>
>



>
>
>







196
197
198
199
200
201
202
203



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#========================================================================
# Your doc target should differentiate from doc builds (by the developer)
# and doc installs (see install-doc), which just install the docs on the
# end user machine when building from source.
#========================================================================

doc:
	$(TCLSH) ${srcdir}/make.tcl doc




#========================================================================
# Performs a full install with documentation and headers
#========================================================================
install:
	$(TCLSH) ${srcdir}/make.tcl install $(DESTDIR)

#========================================================================
# Performs a minimum install of the dll and Tcl library files
#========================================================================
install-package:
	$(TCLSH) ${srcdir}/make.tcl install-package $(DESTDIR)

test: binaries libraries
	$(TCLSH) `@[email protected] $(srcdir)/tests/all.tcl` $(TESTFLAGS) \
		-load "package ifneeded ${PACKAGE_NAME} ${PACKAGE_VERSION} \
			[list load `@[email protected] $(PKG_LIB_FILE)` $(PACKAGE_NAME)]"

Changes to make.tcl.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
..
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
if {[file exists [file join $CWD $::project(sandbox) tclconfig practcl.tcl]]} {
  source [file join $CWD $::project(sandbox) tclconfig practcl.tcl]
} else {
  source [file join $SRCPATH tclconfig practcl.tcl]
}


array set ::project [::practcl::config.tcl $CWD]
::practcl::library create LIBRARY [array get ::project]
LIBRARY add [file join $::project(srcdir) generic sample.c]
LIBRARY add [file join $::project(srcdir) generic sample.tcl]
LIBRARY define add public-verbatim [file join $::project(srcdir) generic sample.h]
###
# Create build targets
###
::practcl::target implement {}
::practcl::target autoconf {
  triggers implement
}
::practcl::target all {
  triggers library
}
::practcl::target binaries {
  triggers library
}
::practcl::target libraries {
  triggers library
}
::practcl::target library {
  triggers implement

}
::practcl::target doc {}

::practcl::target install {
  depends {library doc}
  triggers {install-package}
}
................................................................................
}

if {$make(autoconf)} {
  #set mkout [open sample.mk w]
  #puts $mkout [::practcl::build::Makefile $::project(builddir) LIBRARY]
  #close $mkout
  LIBRARY generate-decls [LIBRARY define get name] $::project(builddir)
  if {![file exists make.tcl]} {
    set fout [open make.tcl w]
    puts $fout [list source [file join $::project(srcdir) make.tcl]]
    close $fout
  }
}

if {$make(library)} {
  puts "BUILDING [LIBRARY define get libfile]"
  ::practcl::build::library [LIBRARY define get libfile] LIBRARY
}

................................................................................
  
  #========================================================================
  # Install documentation.  Unix manpages should go in the $(mandir)
  # directory.
  #========================================================================
  puts "Installing documentation in ${mandir}"
  foreach file [glob -nocomplain [file join $srcdir doc *.n]] {
    if {$DESTDIR ne {}} {
      ::practcl::installDir $file [file join ${DESTDIR} ${mandir} mann]
    } else {
      ::practcl::installDir $file [file join ${mandir} mann]
    }
  }
}

if {$make(install-package)} {
  #========================================================================
  # Install binary object libraries.  On Windows this includes both .dll and
  # .lib files.  Because the .lib files are not explicitly listed anywhere,
................................................................................
  # Library files go into the lib directory.
  # In addition, this will generate the pkgIndex.tcl
  # file in the install location (assuming it can find a usable tclsh shell)
  #
  # You should not have to modify this target.
  #========================================================================
  puts "Installing Library to ${pkglibdir}"
  if {$DESTDIR ne {}} {
    ::practcl::installDir [LIBRARY define get libfile] [file join ${DESTDIR} $pkglibdir]
    foreach file [glob -nocomplain *.lib] {
      ::practcl::installDir $file [file join ${DESTDIR} $pkglibdir]
    }
    if {[LIBRARY define get output_tcl] ne {}} {
      ::practcl::installDir [LIBRARY define get output_tcl] [file join ${DESTDIR} $pkglibdir] 
    }
  } else {
    ::practcl::installDir [LIBRARY define get libfile] $pkglibdir
    foreach file [glob -nocomplain *.lib] {
      ::practcl::installDir $file $pkglibdir
    }
    ::practcl::installDir pkgIndex.tcl $pkglibdir
    if {[LIBRARY define get output_tcl] ne {}} {
      ::practcl::installDir [LIBRARY define get output_tcl] $pkglibdir
    }
  }
}






<













|


|


|



>







 







<
<
<
<
<







 







<
<
<
|
<







 







<
<
<
<
<
<
<
<
<
|
|
|
|
|
|
|
|
|
<
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
80
81
82
83
84
85
86





87
88
89
90
91
92
93
...
134
135
136
137
138
139
140



141

142
143
144
145
146
147
148
...
150
151
152
153
154
155
156









157
158
159
160
161
162
163
164
165

if {[file exists [file join $CWD $::project(sandbox) tclconfig practcl.tcl]]} {
  source [file join $CWD $::project(sandbox) tclconfig practcl.tcl]
} else {
  source [file join $SRCPATH tclconfig practcl.tcl]
}


array set ::project [::practcl::config.tcl $CWD]
::practcl::library create LIBRARY [array get ::project]
LIBRARY add [file join $::project(srcdir) generic sample.c]
LIBRARY add [file join $::project(srcdir) generic sample.tcl]
LIBRARY define add public-verbatim [file join $::project(srcdir) generic sample.h]
###
# Create build targets
###
::practcl::target implement {}
::practcl::target autoconf {
  triggers implement
}
::practcl::target all {
  depends library
}
::practcl::target binaries {
  depends library
}
::practcl::target libraries {
  depends library
}
::practcl::target library {
  triggers implement
  filename [LIBRARY define get libfile]
}
::practcl::target doc {}

::practcl::target install {
  depends {library doc}
  triggers {install-package}
}
................................................................................
}

if {$make(autoconf)} {
  #set mkout [open sample.mk w]
  #puts $mkout [::practcl::build::Makefile $::project(builddir) LIBRARY]
  #close $mkout
  LIBRARY generate-decls [LIBRARY define get name] $::project(builddir)





}

if {$make(library)} {
  puts "BUILDING [LIBRARY define get libfile]"
  ::practcl::build::library [LIBRARY define get libfile] LIBRARY
}

................................................................................
  
  #========================================================================
  # Install documentation.  Unix manpages should go in the $(mandir)
  # directory.
  #========================================================================
  puts "Installing documentation in ${mandir}"
  foreach file [glob -nocomplain [file join $srcdir doc *.n]] {



    ::practcl::installDir $file [file join ${mandir} mann]

  }
}

if {$make(install-package)} {
  #========================================================================
  # Install binary object libraries.  On Windows this includes both .dll and
  # .lib files.  Because the .lib files are not explicitly listed anywhere,
................................................................................
  # Library files go into the lib directory.
  # In addition, this will generate the pkgIndex.tcl
  # file in the install location (assuming it can find a usable tclsh shell)
  #
  # You should not have to modify this target.
  #========================================================================
  puts "Installing Library to ${pkglibdir}"









  ::practcl::installDir [LIBRARY define get libfile] $pkglibdir
  foreach file [glob -nocomplain *.lib] {
    ::practcl::installDir $file $pkglibdir
  }
  ::practcl::installDir pkgIndex.tcl $pkglibdir
  if {[LIBRARY define get output_tcl] ne {}} {
    ::practcl::installDir [LIBRARY define get output_tcl] $pkglibdir
  }
}