File: include-main.mk

package info (click to toggle)
bmake 20200710-17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,292 kB
  • sloc: ansic: 18,989; sh: 1,028; python: 487; makefile: 356; perl: 100
file content (30 lines) | stat: -rw-r--r-- 699 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# $NetBSD: include-main.mk,v 1.1 2020/05/17 12:36:26 rillig Exp $
#
# Demonstrates that the .INCLUDEDFROMFILE magic variable does not behave
# as described in the manual page.
#
# The manual page says that it is the "filename of the file this Makefile
# was included from", while in reality it is the "filename in which the
# latest .include happened".
#

.if !defined(.INCLUDEDFROMFILE)
LOG+=		main-before-ok
.else
.  for f in ${.INCLUDEDFROMFILE}
LOG+=		main-before-fail\(${f:Q}\)
.  endfor
.endif

.include "include-sub.mk"

.if !defined(.INCLUDEDFROMFILE)
LOG+=		main-after-ok
.else
.  for f in ${.INCLUDEDFROMFILE}
LOG+=		main-after-fail\(${f:Q}\)
.  endfor
.endif

all:
	@printf '%s\n' ${LOG}