Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rlgvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!mit-eddie!godot!harvard!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.lang.c Subject: Re: make depend Message-ID: <563@rlgvax.UUCP> Date: Sat, 9-Mar-85 02:45:26 EST Article-I.D.: rlgvax.563 Posted: Sat Mar 9 02:45:26 1985 Date-Received: Mon, 11-Mar-85 07:00:22 EST References: <8775@brl-tgr.ARPA> <544@rlgvax.UUCP> <12416@gatech.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 39 > I just wanted to mention that ATT's Unix Toolchest, which allows you to > sign up for software which is delivered electronically, provies a tool > call "makefile", which will read through your software in the current > directory, and generate a makefile for you. If there is a makefile there, > it will keep any comments you had when it produces the new one. It is > available (source!) for a reasonable price, only $95. For what it's worth, the following, courtesy of the University of California at Berkeley (or whoever did it first) will do much the same, if you have "/lib/cpp -M" (or its equivalent; somebody posted a script that filtered the output of a regular "cpp" to produce dependencies): depend: for i in ${SOURCES}; do \ /lib/cpp -M $$i >>makedep; \ done echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep echo '.kb' >>eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp Makefile Makefile.bak ed - Makefile < eddep rm eddep makedep echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile echo '# see make depend above' >> Makefile if you stick # DO NOT DELETE THIS LINE -- make depend uses it and two blank lines after it at the end of your Makefile, and if you have ${SOURCES} as a macro which expands to the names of all your source files. -- Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy