Makefile error with files starting with "#"

I have a directory "FS2" that contains the following files:

  • Argh

  • this
  • what

I have a makefile with the following contents.

Template:sh= ls ./FS2/*
#all: $(Template)
        echo "Template is: $(Template)"
        touch all

When I run "clearmake -C sun" and the "all" file does not exist, I get the following output:

"Template is: ./FS2/#ARGH# ./FS2/that ./FS2/this"

Changing either "this" or "that" does not restore all. When starting with "-d" for debugging, the goal of "everything" depends only on the "./FS2" directory, and not on the three files in the directory. I determined that when it extends the "Template", "#" is treated as the beginning of the comment, and the rest of the line is ignored!

, , "#". , "" .

, , , , "", , , "# ARGH #" , "" . ?

+3
5

, #ARGH# , all , , , Makefile ,

Template:sh= ls ./FS2/*

Template=./FS2/*
Template_files:sh= ls $(Template)

, $(Template) ./FS2/* all $(Template_files).

Clearmake ( GNU make), ./FS2/* , , ./FS2/#ARGH# ./FS2/that ./FS2/this $(Template_files), , .

0

"FS2", : # ARGH #...

. , "" . , , ( ASCII, backspace, ).

, SomethingLike. , , , UNIX .

, , , . , , , , make . , , .

, : Template:sh= ls ./FS2/[A-Za-z0-9]*, ( , , , ).

+3

'#' Makefile char, make.

( grep) , #, ?

+1

clearmake,

Template:sh= ls ./FS2/* | grep -v '#'

so that file names containing #are not included in $(Template).

+1
source

If clearmake follows the same rules as GNU make, then you can also rewrite your target using something like Template := $(wildcard *.c)that would be a little more reasonable for files with odd names.

0
source

Source: https://habr.com/ru/post/1734621/


All Articles