busybox-w32
busybox-w32 copied to clipboard
`make` - automatic variables `$<` and `$*` works inside suffixes rules only
Test makefile:
all:
@echo "Automatic variables from suffixes rule"
@make -n AUTO=1 main.o
@echo
@echo "Automatic variables from regular rule"
@make -n main.o
.c.o:
$$< = "$<"
$$? = "$?"
$$@ = "$@"
$$* = "$*"
$$^ = "$^"
main.o: main.c common.h
ifndef AUTO
$$< = "$<"
$$? = "$?"
$$@ = "$@"
$$* = "$*"
$$^ = "$^"
endif
main.c:
common.h:
Output:
$ make
Automatic variables from suffixes rule
$< = "main.c"
$? = "main.c common.h"
$@ = "main.o"
$* = "main"
$^ = "main.c common.h"
Automatic variables from regular rule
$< = ""
$? = "main.c common.h"
$@ = "main.o"
$* = ""
$^ = "main.c common.h"