I'm new to Linux, more so for Makefile.

In Linux, is 'make folder/path/clean' same as running 'make clean' command in folder/path/?

(folder/path/ refers to an arbitrary directory.)

Apart from this question, is there a generalization one can make about this syntax (of command and argument) in Linux?

Update based on comments and suggested answers: Thanks, I learned some new things. I also found that Makefile that I am using (openwrt) is different from the normal GNU Makefile in that it has more features.

A summary is that that the two commands in the main question are not the same.

  • 1
    Linux, is the OS kernel found in a number of Operating systems like Debian, Ubuntu, ArchLinux... Is your question about building Linux in those OSes, or about using make when building any particular software in any particular Operating System built around a Linux kernel? Aug 26, 2013 at 10:15

2 Answers 2


To execute make clean in folder/path, you want

make -C folder/path clean

The -C switch is not POSIX, though (see the comments). It works, at least, for GNU make, which is the make you have if you're running Linux.


No it is not. Your syntax would not work unless you have a rule for folder/path/clean in the directory that you execute the make folder/path/clean in.

You can, for example, make a recursive clean rule in your make file to (maybe?) achieve what you want. For example:

  (cd folder/path; make clean)

For each directory that you have or just do a for loop over all the directories etc.

  • I am not sure if this is what you are looking for. If not, let me know and I can update my answer).
    – mmtauqir
    Aug 26, 2013 at 6:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .