freebsd-src/unit-tests/depsrc-use.mk
Simon J. Gerraty 6bbc783f48 Import bmake-20200902
Lots of code refactoring, simplification and cleanup.
Lots of new unit-tests providing much higher code coverage.
All courtesy of rillig at netbsd.

Other significant changes:

o new read-only variable .SHELL which provides the path of the shell
  used to run scripts (as defined by  the .SHELL target).

o new debug option -dl: LINT mode, does the equivalent of := for all
  variable assignments so that file and line number are reported for
  variable parse errors.
2020-09-05 16:11:04 +00:00

25 lines
617 B
Makefile

# $NetBSD: depsrc-use.mk,v 1.4 2020/08/22 12:30:57 rillig Exp $
#
# Tests for the special source .USE in dependency declarations,
# which allows to append common commands to other targets.
all: action directly
first: .USE
@echo first 1 # Using ${.TARGET} here would expand to "action"
@echo first 2
second: .USE
@echo second 1
@echo second 2
# 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