Reputation:
I've prepared the following makefile, to automatically clean-up all the temporary projects I want to delete:
.SUFFIXES : bye
# The default action is to
# remove the latest project, i was working at...
byebye :
rm -rf "$(ls -1dt /projects/new_* | head -n1)"
# Remove a specific project.
# Run make from the command-line as 'make new_1_bye' etc.
%_bye :
rm -rf /projects/$*
But, if I run make as:
$ make
I get:
make: *** No targets. Stop.
Why?
Upvotes: 1
Views: 4276
Reputation: 755064
The .SUFFIXES
line seems to cause the trouble. Suffixes normally start with a dot (.c
, for example). Make appears to accept the suffix bye
, but that means the line byebye:
marks the start of a suffix rule, and the %_bye
line is also a suffix rule. That adds up to mean there are no targets cited in the makefile
, hence the error message.
If you use .SUFFIXES : .bye
instead, make
is then happy with the makefile.
Upvotes: 2