Skip to content

Commit 56c16b9

Browse files
committed
Replace make with $(MAKE) in Makefile
According to GNU Make Manual, Recursive make commands should always use the variable MAKE, not the explicit command name "make".
1 parent 9c39011 commit 56c16b9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lkmpg.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ \subsection{The Simplest Module}
258258
PWD := $(CURDIR)
259259
260260
all:
261-
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
261+
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
262262

263263
clean:
264-
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
264+
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
265265
\end{code}
266266
267267
In \verb|Makefile|, \verb|$(CURDIR)| can set to the absolute pathname of the current working directory(after all \verb|-C| options are processed, if any).
@@ -461,10 +461,10 @@ \subsection{Hello and Goodbye}
461461
PWD := $(CURDIR)
462462

463463
all:
464-
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
464+
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
465465
466466
clean:
467-
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
467+
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
468468
\end{code}
469469

470470
Now have a look at \src{drivers/char/Makefile} for a real world example.
@@ -604,10 +604,10 @@ \subsection{Modules Spanning Multiple Files}
604604
PWD := $(CURDIR)
605605
606606
all:
607-
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
607+
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
608608

609609
clean:
610-
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
610+
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
611611
\end{code}
612612
613613
This is the complete makefile for all the examples we have seen so far.

0 commit comments

Comments
 (0)