Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) Newsgroups: comp.unix.programmer Subject: Re: mkdep program for SysV (Xenix/Unix) Message-ID: <1990Dec16.020414.8652@NCoast.ORG> Date: 16 Dec 90 02:04:14 GMT References: <1990Dec13.010143@cs.yale.edu> <1990Dec14.023842.21164@robobar.co.uk> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) Followup-To: comp.unix.programmer Organization: North Coast Public Access *NIX, Cleveland, OH Lines: 34 As quoted from <1990Dec14.023842.21164@robobar.co.uk> by ronald@robobar.co.uk (Ronald S H Khoo): +--------------- | fields-doug@cs.yale.edu (Doug Fields) writes: | | > Hi. I have alot of Makefiles that call a "makedep" or "mkdep" program, which | > I assume adds to the end a zillion dependencies [ to the end of Makefiles ] | > Anyway, I could really use [ mkdep ], or one which does | > something similar, for those Makefiles and as a general utility. | | One fast and accurate way to make dependencies for makefiles is to use gcc -M. | (Doug's asking about Xenix/Sys V, so he'd need gcc. BSD cc has -M doesn't it?) +--------------- If I remember correctly, BSD cc has -M but it has to be massaged to produce dependencies. gcc has -M and -E -M (I think that's correct); the latter produces dependencies in Makefile format. I have a Perl script that computes dependencies, which I use in preference to gcc. Part of the reason is that it doesn't feel as weird as running a C compiler on random non-C source [ ;-) ] and part of the reason is some misgivings about letting gcc anywhere near my Unify ACCELL 4GL scripts, copyleft notwithstanding. Neither is a hard-and-fast reason, and little would change if I made my mkdep script call gcc -E -M, except that my mkdep does a little cleanup on the resulting filenames. In particular, I seem to remember it keeping an eye on Makefile macro definitions and substituting them in place of leading pathname components. (It's been a while since I bothered to look at the output; once you trust a tool, you don't worry it to death.) ++Brandon -- Me: Brandon S. Allbery VHF/UHF: KB8JRR on 220, 2m, 440 Internet: allbery@NCoast.ORG Packet: KB8JRR @ WA8BXN America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY