I'm trying to emulate this rule with bmake
%.o: %.c
echo $< $@
This is valid in GNU make but I'm having a hard time to replicate it with BSD make.
Thanks in advance!
CodePudding user response:
Somewhat out of my depth here, but I think there are two things to change:
- Use suffix rules instead of (unsupported, GNU Make feature) pattern rules.
- Use the bmake names for automatic variables (bmake supports GNU Make automatic variables but are not recommended)
.SUFFIXES: .o
.c.o:
echo ${.TARGET} ${.IMPSRC}
BSD make (aka bmake) uses traditional suffix rules (.c.o: ...) instead of pattern rules like gmake's (%.c:%.o: ...) which are more general and flexible.
See also https://linux.die.net/man/1/bmake