File dependencies generator needed.

File dependencies generator needed.

Post by David Erha » Wed, 31 Aug 1994 15:12:25



Can someone suggest a good freeware/shareware application that will
generate file dependencies for a list of sources in a makefile.
I have used SCANDEPS by Intersolv with their PVCS product.  Something
similar to that would be great.  It must work in MS-DOS.

Example:
--------
file1.cpp: a.h b.h c.h ...
file2.cpp: abc.h cde.h efg.h ...
filea.rc: xyz.h rst.h ...
filea1.c: a.h abc.h xyz.h

etc.

I am writing a group of makefiles for a project that is using Microsoft
Visual C++ v1.5 as the compiler/linker/nmake/etc.  I want to be able to
build the whole system (multiple makefiles, nested dirs, etc.) from the
command line, not from the Visual C++/Windows interface.  Keeping the
file dependencies correct manually is not so easy!

Thanks in advance.
David.
--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 
 
 

File dependencies generator needed.

Post by Mark S Wrig » Wed, 31 Aug 1994 21:38:41




>Can someone suggest a good freeware/shareware application that will
>generate file dependencies for a list of sources in a makefile.

I've always wanted such a beast myself.  THe only solution I've found is
to use the DJGPP compiler's -M option, which creates a makefile-ready
file dependency list.  Unfortunately, using a 16meg compiler to do this
is like swatting a fly with a sledge hammer...

A little while back, someone posted a makefile maker to comp.sources.misc
(? I think.  May have been .unix)  But unfortunately it was looking for a
String class which wasn't contained anywhere in the source.

>Thanks in advance.
>David.
>--
>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


--
"The real surprise, and Bertolucci's best achievement here, is the
performance of Prince Siddhartha by Keanu Reeves. That is not a
misprint."  - Stanley Kaufman, The New Republic.


 
 
 

File dependencies generator needed.

Post by Chris Chl » Thu, 01 Sep 1994 06:24:33



Quote:>Can someone suggest a good freeware/shareware application that will
>generate file dependencies for a list of sources in a makefile.
>I have used SCANDEPS by Intersolv with their PVCS product.  Something
>similar to that would be great.  It must work in MS-DOS.

You can solve this problem by writing a batch program which uses the
Unix utilities like sed and awk to extract the #include directives from

if not %pcxnet%x == x goto ok1
echo PCXLIB environment variable missing
goto done
:ok1
if exist libfile goto ok2
echo LIBFILE missing
goto done
:ok2
echo on
grep "^#include" *.c > mx1
ls *.c *.asm | sed "s/.*/&: &/" >> mx1
sed -f %pcxnet%\lib\mx1.sed mx1 | sort > mx2
awk -f %pcxnet%\lib\mx2.awk mx2 > xdepend
sed "s/\.obj.*//" xdepend > xinu.fil
sed -e "s/.*/+& \&/" -e "$s/ &$//" xinu.fil > xlib.fil
awk "{for(i=2;i<=NF;i++)file[$i]++}END{for(i in file)print i}" xdepend >
mx3
sed s/:.*// mx1 >> mx3
sort < mx3 | uniq > xinu.lst
cat %pcxnet%\lib\make1.add > makefile.lib
cat libfile >> makefile.lib
cat %pcxnet%\lib\make2.add >> makefile.lib
awk -f %pcxnet%\lib\makeobjs.awk xinu.fil >> makefile.lib
cat %pcxnet%\lib\make3.add >> makefile.lib
cat xdepend >> makefile.lib
ed - < %pcxnet%\lib\update.ed
copy %pcxnet%\lib\makefile .
del mx?.
echo off
:done
rem end of batch file
For full details, see the Xinu distribution available from
csc.canberra.edu.au in /pub/ise/xinu/xinu79.exe.

Chris Chlap
University of Canberra, Australia.

>Example:
>--------
>file1.cpp: a.h b.h c.h ...
>file2.cpp: abc.h cde.h efg.h ...
>filea.rc: xyz.h rst.h ...
>filea1.c: a.h abc.h xyz.h
>etc.
>I am writing a group of makefiles for a project that is using Microsoft
>Visual C++ v1.5 as the compiler/linker/nmake/etc.  I want to be able to
>build the whole system (multiple makefiles, nested dirs, etc.) from the
>command line, not from the Visual C++/Windows interface.  Keeping the
>file dependencies correct manually is not so easy!
>Thanks in advance.
>David.
>--
>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


 
 
 

File dependencies generator needed.

Post by Kevin D. Hunt » Fri, 02 Sep 1994 01:09:47



>Can someone suggest a good freeware/shareware application that will
>generate file dependencies for a list of sources in a makefile.
>Example:
>--------
>file1.cpp: a.h b.h c.h ...
>file2.cpp: abc.h cde.h efg.h ...
>filea.rc: xyz.h rst.h ...
>filea1.c: a.h abc.h xyz.h

I have such a beastie that I wrote years ago which does what you want,
but it doesn't support every type of file in the world (limited to
c, cpp, h and asm extensions I think).  Maybe I should dust off the
source code and tweak it up.  You use it by saying something like

        hfiles *.c *.cpp >>makefile

and it generates stuff like:

file1.obj:      file1.cpp something.h somethingElse.h somethingMore.h \
                yetAnother.h

and so forth.  It does recurse .h files so that includes included by
included are captured in the dependency lists.

I'd be glad to put this out into the public domain if someone would suggest
the best place to post it.

--
------------------------------------------------------------------------
Kevin Hunter              "He can't do that to our programmers!

------------------------------------------------------------------------
--
------------------------------------------------------------------------
Kevin Hunter              "He can't do that to our programmers!

------------------------------------------------------------------------

 
 
 

1. File Dependency Generator Available

Recently there was a series of inquiries about a tool to assist in the
generation of makefile dependencies.

I have written (well, re-written, actually) a file dependency generator
for "C" and "ASM" files.  This tool runs in the DOS environment.  
A PKZIP 2.04g-compatible file containing executable, source, and
(extremely minimal) documentation has been uploaded to teeri.oulu.fi
(aka x2ftp.oulu.fi) into the /incoming area, and is named "hfiles01.zip"
This includes a makefile for the Microsoft C compiler.  (The tool also
can be compiled using Borland, and probably other compilers as well,
as it is pretty vanilla).

Presumably the system administrator of this site will move it into
a downloadable area in the next few days.

The dependencies supported are "tuned" for my particular environment,
however a relatively arbitrary set can be obtained by modifying a
table in the source code and recompiling.

Comments and feedback are welcomed.  I would prefer that you respond

--
------------------------------------------------------------------------
Kevin Hunter              "He can't do that to our programmers!

------------------------------------------------------------------------
--
------------------------------------------------------------------------
Kevin Hunter              "He can't do that to our programmers!

------------------------------------------------------------------------

2. Logon to Win2k

3. makedep2.zip - Makefile dependency generator for NMAKE

4. Music/animation

5. NEEDED install generator

6. P.S./T.T. Help

7. Need a good industrial grade random number generator ?

8. users able to mount smb volumes

9. Precision tone generator for Soundblaster NEEDED

10. Looking for .EXE generator for .BAT-files

11. gcc 3.03 dependency output

12. using gcc to make dependencies

13. Dependencies in LD