I would like to create an alias in the .bashrc file that calls make on a makefile. I am not sure what I am doing wrong or what is happening. I specify to make what folder to change execution to and what makefile to use. I am using the following line in .bashrc:

alias make_test="make clean --c /home/bobby/Documents/program -f /home/bobby/Documents/program/Makefile"

The result is

rm -rf src/*.o app_exec

make: Nothing to be done for '/home/bobby/Documents/program'.

Make seems to be reading something relevent; it is the correct output for the clean command. But there is no effect besides the printing; nothibg has been cleaned. The makefile works when run from the directory with the command line. What am I doing wrong?

  • Are you doing exactly the same command (without alias)?, and from the same current working directory? – ctrl-alt-delor Jan 24 at 8:31
  • No, I meant calling "make clean from the directory". Uncle Billy's answer is correct. – rur2641 Jan 24 at 13:28
  • Yes I know. I asked to make you think. – ctrl-alt-delor Jan 24 at 14:42

The --c is interpreted as --check-symlink-times, and /home/bobby/Documents/program as a target.

If you wanted it to change to that directory, you should've used -C /home/bobby/Documents/program (uppercase C and a single dash).

nothibg has been cleaned.

You were lucky.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.