Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* make command problem with dependencies..!
@ 2001-10-18 12:02 Shiva Gowda
  2001-10-19  8:55 ` Shiva Gowda
  0 siblings, 1 reply; 2+ messages in thread
From: Shiva Gowda @ 2001-10-18 12:02 UTC (permalink / raw)


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 <stdio.h>

#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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: make command problem with dependencies..!
  2001-10-18 12:02 make command problem with dependencies..! Shiva Gowda
@ 2001-10-19  8:55 ` Shiva Gowda
  0 siblings, 0 replies; 2+ messages in thread
From: Shiva Gowda @ 2001-10-19  8:55 UTC (permalink / raw)


shivrajang@yahoo.com (Shiva Gowda) wrote in message news:<c8246df4.0110180402.764c9a26@posting.google.com>...
> 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 <stdio.h>
> 
> #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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-10-19  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-18 12:02 make command problem with dependencies..! Shiva Gowda
2001-10-19  8:55 ` Shiva Gowda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox