aboutsummaryrefslogtreecommitdiff
path: root/testsuite/make.tests
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2022-11-01 14:18:00 +0000
committerRon Yorston <rmy@pobox.com>2022-11-01 14:24:31 +0000
commit0aceca8673c1d9a8bc34faa460389768efa08eb7 (patch)
treea484dc09b97a4137de053dc3243029880d7600e5 /testsuite/make.tests
parent93cb545c1a380724b7cf4528eabe6da3ea8ba964 (diff)
downloadbusybox-w32-0aceca8673c1d9a8bc34faa460389768efa08eb7.tar.gz
busybox-w32-0aceca8673c1d9a8bc34faa460389768efa08eb7.tar.bz2
busybox-w32-0aceca8673c1d9a8bc34faa460389768efa08eb7.zip
make: comments in macro expansions and command lines
The POSIX specification says: There are three kinds of comments: blank lines, empty lines, and a <number-sign> ('#') and all following characters up to the first unescaped <newline> character. Most implementations don't treat '#' in a macro expansion or a command line as the start of a comment. POSIX doesn't mention either of these exceptions. Permit the exceptions as a non-POSIX extension.
Diffstat (limited to '')
-rwxr-xr-xtestsuite/make.tests18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/make.tests b/testsuite/make.tests
index a0ca9778b..f52770438 100755
--- a/testsuite/make.tests
+++ b/testsuite/make.tests
@@ -379,6 +379,24 @@ t1? t2* t3[abc]: s1? s2* s3[abc]
379' 379'
380cd .. || exit 1; rm -rf make.tempdir 2>/dev/null 380cd .. || exit 1; rm -rf make.tempdir 2>/dev/null
381 381
382# A '#' character in a macro expansion doesn't start a comment
383testing "make hash in macro expansion isn't a comment" \
384 "make -f -" \
385 ": hash # hash\n" "" '
386HASH = hash
387hash = $(HASH:hash=#)
388target:
389 : hash $(hash) hash
390'
391
392# A '#' character in a command line doesn't start a comment
393testing "make hash in command line isn't a comment" \
394 "make -f -" \
395 ": hash # hash\n" "" '
396target:
397 : hash # hash
398'
399
382# Skip duplicate entries in $? and $^ 400# Skip duplicate entries in $? and $^
383mkdir make.tempdir && cd make.tempdir || exit 1 401mkdir make.tempdir && cd make.tempdir || exit 1
384touch -t 202206171200 file1 file3 402touch -t 202206171200 file1 file3