How to fix SCons error: Do not know how to make File target `clean'

Problem:

You are trying to clean your SCons build using

scons clean

but you see the following error message:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: *** Do not know how to make File target `clean' (/home/user/myproject/clean).  Stop.
scons: building terminated because of errors.

Solution

When using SCons, the correct command to clean is

scons --clean