Suppose I have prog1.c prog2.c prog3.c prog4.c prog1.h prog2.h
In my Makefile I have these:
$(OBJ)= prog1.o prog2.o prog3.o prog4.o
$(OBJ): %.o: %.c %.h
     $(CC) -c $< -o $@
I get an error because there are no prog3.h and prog4.h and the static
pattern rule apparently requires a header file for each object file.
I do not want to explicitly write a separate rule for prog3 and prog4:
prog3.o prog4.o: %.o %.c
     $(CC) -c $< -o $@
$(filter prog3.o prog4.o, $(OBJ)): %.o: %.c %.h
     $(CC) -c $< -o $@
That would be too awkward.  Is there a better way?

_______________________________________________
help-gnu-utils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnu-utils

Reply via email to