List Info

Thread: make question (static pattern rule)




make question (static pattern rule)
user name
2006-09-28 20:56:50
mk works as expected, but not mk2
Seems like static pattern rule is the difference.
How to make mk2 work similar to mk?

$ cat mk
%.o: ../%.c
        echo R0 $ $<

all: aa/bb/obj/x.o aa/bb/obj/y.o

aa/bb/x.c aa/bb/y.c:
        touch $

$ make -f mk
R0 aa/bb/obj/x.o aa/bb/obj/../x.c
R0 aa/bb/obj/y.o aa/bb/obj/../y.c

$ cat mk2
%.o: ../%.c
        echo R0 $ $<

all: aa/bb/obj/x.o aa/bb/obj/y.o

aa/bb/obj/x.o: %.o: ../%.c
        echo R1 $ $<

aa/bb/x.c aa/bb/y.c:
        touch $

$ make -f mk2
make: *** No rule to make target `../aa/bb/obj/x.c', needed
by
`aa/bb/obj/x.o'.  Stop.


James

_______________________________________________
help-gnu-utils mailing list
help-gnu-utilsgnu.org

http://lists.gnu.org/mailman/listinfo/help-gnu-utils
make question (static pattern rule)
user name
2006-09-29 09:41:47
James wrote:
> aa/bb/obj/x.o: %.o: ../%.c

Does make allow two : on the same rule line?

try duplicating the command lines:

aa/bb/obj/x.o:  ../%.c
         echo R1 $ $<

%.o: ../%.c
         echo R0 $ $<


I use it and it works as expected. I know it's not beautiful
(specially 
to multiple specific rules and one generic as is my case) so
if you find 
a better way, let me know. ;)

thanks,
--renato
_______________________________________________
help-gnu-utils mailing list
help-gnu-utilsgnu.org

http://lists.gnu.org/mailman/listinfo/help-gnu-utils
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )