2020-08-22 15:30:57 +03:00
|
|
|
# $NetBSD: depsrc-use.mk,v 1.4 2020/08/22 12:30:57 rillig Exp $
|
2020-08-16 15:07:50 +03:00
|
|
|
#
|
2020-08-22 10:49:44 +03:00
|
|
|
# Tests for the special source .USE in dependency declarations,
|
|
|
|
# which allows to append common commands to other targets.
|
2020-08-16 15:07:50 +03:00
|
|
|
|
2020-08-22 10:49:44 +03:00
|
|
|
all: action directly
|
2020-08-16 15:07:50 +03:00
|
|
|
|
2020-08-22 10:49:44 +03:00
|
|
|
first: .USE
|
2020-08-22 15:30:57 +03:00
|
|
|
@echo first 1 # Using ${.TARGET} here would expand to "action"
|
|
|
|
@echo first 2
|
2020-08-22 10:49:44 +03:00
|
|
|
|
|
|
|
second: .USE
|
2020-08-22 15:30:57 +03:00
|
|
|
@echo second 1
|
|
|
|
@echo second 2
|
2020-08-22 10:49:44 +03:00
|
|
|
|
|
|
|
# It's possible but uncommon to have a .USE target with no commands.
|
|
|
|
# This may happen as the result of expanding a .for loop.
|
|
|
|
empty: .USE
|
|
|
|
|
|
|
|
# It's possible but uncommon to directly make a .USEBEFORE target.
|
|
|
|
directly: .USE
|
|
|
|
@echo directly
|
|
|
|
|
|
|
|
action: first second empty
|