Tcl Source Code

View Ticket
Login
Ticket UUID: 427697
Title: Script for Making Dependency Information
Type: Patch Version: None
Submitter: dkf Created on: 2001-05-27 12:34:17
Subsystem: 53. Configuration and Build Tools Assigned To: stwo
Priority: 3 Low Severity: Minor
Status: Open Last Modified: 2016-09-01 16:10:26
Resolution: None Closed By: nobody
    Closed on:
Description:
There has been some discussion recently online (in the Tcler's chat and elsewhere) about how 
Tcl's dependency information is seriously out-of-date. Normally this does not matter (most 
people just build everything from scratch) but given the number of people now developing in 
the core, it is becoming more important to have accurate dependency information in the core. 
However, it was discovered that makedepend (and gcc -M) do not always get this information 
right with Tcl's build structure. This Tcl script is intended to be a replacement for that that allows 
dependency information to be built relatively easily and accurately.
User Comments: dkf added on 2003-03-27 18:01:40:
Logged In: YES 
user_id=79902

I don't quite see what the problem is.  The script assumes
that it is being run in the directory where generated .o
files will be produced and where the makefile is.  It is
configured (by default) to search the current directory (and
its sibling directories compat and generic) for source
files, but the directories searched may be configured
through the use of the -directory flag.

For example (the '-directory -' option removes the built-in
search path) and trying to solve the sort of problem that
you described:
  tclsh makedep.tcl -directory - \
-directory $(SRCLOC)/compat \
-directory $(SRCLOC)/generic \
-directory $(SRCLOC)/unix

You can also control the name of the makefile that is
modified with the -makefile option.  The script does not
currently allow configuring of the file extensions, but it
shouldn't be hard to add that.

mdejong added on 2003-03-27 13:25:46:
Logged In: YES 
user_id=90858

I looked at this script and tried to adapt it to the
existing build
environment, but I was not able to get it working. The script
assumes that the src dir is the build dir. Unless it can be
rewritten
so that it works with run in a build dir that is not the
source dir,
I can't approve it.

dkf added on 2001-09-20 16:34:15:
Logged In: YES 
user_id=79902

The intention is that this script is only used by people
developing the core; when you're building for installation,
you just make the lot and don't worry about when you need to
rebuild.  OTOH, if you make a far-reaching change in tclIO.h
to some structure definition, you'd *really* like to check
that everything that depends on it rebuilds correctly...

msofer added on 2001-09-19 00:07:50:
Logged In: YES 
user_id=148712

Well, the only ones who *really* need dependency information
are developers - ie, those that modify some files andwant to
rebuild partially. It is not important if you are building
from scratch (from a distro, or after 'make clean').

I think it is safe to assume that core developers do have a
working version of Tcl, so that this script indeed solves
the problem for them/us.

mdejong added on 2001-09-19 00:01:06:
Logged In: YES 
user_id=90858

I still don't understand how this script is to be
run. It is the old chicken and the egg problem.
How does one run a Tcl script before building Tcl?
Typically, the `make depend` target appends a
bunch of additional deps to the Makefile. But,
we can't expect people to have Tcl around before
building Tcl.

msofer added on 2001-05-28 22:21:29:
Logged In: YES 
user_id=148712

This is a 'solution' to bugs 427101 and 427105

dkf added on 2001-05-27 19:34:17:

File Added - 6698: makedep.tcl

Attachments: