From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,638eb988f52aaadc X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-10-19 01:55:32 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: shivrajang@yahoo.com (Shiva Gowda) Newsgroups: comp.unix.tru64 Subject: Re: make command problem with dependencies..! Date: 19 Oct 2001 01:55:32 -0700 Organization: http://groups.google.com/ Message-ID: References: NNTP-Posting-Host: 194.122.136.34 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1003481732 9497 127.0.0.1 (19 Oct 2001 08:55:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 19 Oct 2001 08:55:32 GMT Xref: archiver1.google.com comp.unix.tru64:5428 shivrajang@yahoo.com (Shiva Gowda) wrote in message news:... > Hello Gurus... > > Not sure this is the right place for make command problem! If not please > redirect me to the right list!!! > > I have a problem with one of my Makefile. here is the makefile > > $ sizer -v > Digital UNIX V4.0G (Rev. 1530); Thu Dec 7 13:46:52 MET 2000 > $ ls > Makefile _defaultRule header.h hello.c > $ cat _defaultRule > .SUFFIXES : .c > > local : $(DELIVER) > > .c : $$@.c $(INCLUDE_FILES) > cc -o $@ $@.c > > $ cat Makefile > INCLUDE_FILES=\ > header.h > > DSOURCE=\ > hello.c > > DELIVER=$(DSOURCE:.c=) > > include _defaultRule > > clean :: > rm -f hello > > $ cat header.h > #include > > #define MESSAGE "Hello, World!\n" > > $ cat hello.c > #include "header.h" > > main() { > > printf("%s", MESSAGE); > > } > -------------------------------------------------------- > > the steps below shows the problem. > > $ type make > make is a tracked alias for /bin/make > $ make local > cc -o hello hello.c > $ echo "#define DAY MONTAG" >> header.h > $ make local > $ make clean > rm -f hello > $ /usr/bin/posix/make local > cc -o hello hello.c > $ echo "#define DAY1 MONTAG" >> header.h > $ /usr/bin/posix/make local > cc -o hello hello.c > $ > > I'm using echo just to update one of the dependency, here it is header.h. > my question is: why hello.c file not gets compiled when there is a change > in the dependency with base make? > > Not sure the problem is with my Makefile or with the base make. It works > the way I wanted with posix make. I don't want to use posix make as the build > environmet uses base make. So.....any workaround otherthan posix make??? > > thx a lot.. > > -shiva Well, just an update. One of my friend suggested me a workaround which works pretty well. Here is my updated _defaultRule $ cat _defaultRule .SUFFIXES : .c local : $(DELIVER) $(DELIVER) : $$@.c $(INCLUDE_FILES) .c : cc -o $@ $@.c The idea is to have dependency on the target!! so, base make works fine with this makefile. -shiva