[comp.sources.wanted] Makefile Generator Wanted

rkxyv@mergvax (Rob Kedoin) (12/13/88)

Does anyone know of any Public Domain makefile generator ? 

My problem is that programmers(myself included) occasionally forget to
add dependencies into their Makefiles.  I am looking for a tool that
will somehow create/verify a Makefile so I can be confident that no
dependencies have been forgotten.

I would like information on non-public domain programs if anyone has
it.

Thanks in advance,
		-Rob Kedoin

UUCP:	...{cpmain,icus,motown,philabs}\!mergvax\!rkxyv
ARPA:	rkxyv%mergvax.UUCP@uunet.uu.net
BITNET:	rkxyv%mergvax.UUCP@uunet.uu.net.BITNET
SNAIL-mail: Linotype Company - R&D 425 Oser Avenue Hauppauge, NY 11788
VOICE: (516) 434 - 2729

lampman@heurikon.UUCP (Ray Lampman) (12/17/88)

/--
| In article <2269@mergvax> rkxyv@mergvax (Rob Kedoin) writes:
| I am looking for a tool that will somehow create/verify a Makefile
| so I can be confident that no dependencies have been forgotten.
\--

I've been looking for a tool like this for some time, now.  This tool should
verify dependency on the Makefile itself and the tools that the make program
invokes to create target files.  For example, an object file is dependent, not
only on its source and included header files, but also on the compiler and the
options specified in the Makefile.  Change any one of these and you've changed
the object.  I would like to hear about any tool that can verify that _ALL_
dependencies have been included correctly.  By the way, how do you efficiently
archive an entire development environment?
-- 
I am seriously considering a career on  | Ray Lampman (608) 276-3431
the beach. I'll need a microwave modem, | Madison Wisconsin USA Earth
solar power supply, and a little shade. | {husc6,rutgers}!uwvax!heurikon!lampman

guy@auspex.UUCP (Guy Harris) (12/17/88)

>For example, an object file is dependent, not only on its source and
>included header files, but also on the compiler and the options
>specified in the Makefile.  Change any one of these and you've changed
>the object.

The SunOS 4.0 "make" can be told to handle that; if told to do so, it
asks the C preprocessor to list include files used, and asks the linker
to list libraries used, when building programs, and builds a
".make.state" file that lists those dependencies.  It also makes targets
depend on the commands used to build them, so that if the options change
targets are rebuilt.  I don't remember whether it makes the targets
depend on the tools used to build them, although I don't think it does.

Unfortunately, you have to buy a Sun to get it (Sun doesn't sell it for
other machines), and it requires assistance from the compilers and
linker.

daveb@gonzo.UUCP (Dave Brower) (12/18/88)

In article <2269@mergvax> rkxyv@mergvax (Rob Kedoin) writes:
>Does anyone know of any Public Domain makefile generator ? 
>
>My problem is that programmers(myself included) occasionally forget to
>add dependencies into their Makefiles.  I am looking for a tool that
>will somehow create/verify a Makefile so I can be confident that no
>dependencies have been forgotten.
>
>I would like information on non-public domain programs if anyone has
>it.

the "mkmf" package split out from "spms" on the 4.3 user contributed
software tape is a good start.  We used it for wuite a while before
moving to AT&T's "nmake" program available from the toolchest.

If you only need to add dependencies, rather than create the makefile
from scratch, the 4.3 "cc" command has a -M option that spits out
makefile dependiencies for the specified files to stdout.  (This is
actually a feature of /lib/cpp).

The GNU C preprocessor also has a -M flag.

Good luck,
-dB
-- 
If life was like the movies, the music would match the picture.

{sun,mtxinu,hoptoad}!rtech!gonzo!daveb		daveb@gonzo.uucp

gregg@ihlpb.ATT.COM (Wonderly) (12/20/88)

From article <487@gonzo.UUCP>, by daveb@gonzo.UUCP (Dave Brower):
> In article <2269@mergvax> rkxyv@mergvax (Rob Kedoin) writes:
>>Does anyone know of any Public Domain makefile generator ? 
>>
>>My problem is that programmers(myself included) occasionally forget to
>>add dependencies into their Makefiles.  I am looking for a tool that
>>will somehow create/verify a Makefile so I can be confident that no
>>dependencies have been forgotten.
>>
>>I would like information on non-public domain programs if anyone has
>>it.
> 
> ...
> 
> If you only need to add dependencies, rather than create the makefile
> from scratch, the 4.3 "cc" command has a -M option that spits out
> makefile dependiencies for the specified files to stdout.  (This is
> actually a feature of /lib/cpp).

It is a feature of every cc(1) that will run cpp...

try

    cc -E file.c | grep '^#' | sed '1,$s/^[^"]*"//;s/"$//' | sort -u | \
    (
      echo "file.o : \c"     #  change as needed for you version of sh
	  # echo -n "file.o : "
      while read x
      do
          echo "\\\n\t$x \c"  #  change as needed for you version of sh
		  # echo -n "\\\n\t$x "
      done
      echo ''
      exit 0
    )

Which generated for me...

file.o : \
	./defs.h \
	./extern.h \
	./struct.h \
	/usr/include/assert.h \
	/usr/include/ctype.h \
	/usr/include/stdio.h \
	/usr/include/string.h \
	/usr/include/sys/types.h \
	file.c 

-- 
It isn't the DREAM that NASA's missing...  DOMAIN: gregg@ihlpb.att.com
It's a direction!                          UUCP:   att!ihlpb!gregg