mirror of
https://github.com/sysprog21/lkmpg.git
synced 2025-01-15 22:32:42 +08:00
Merge pull request #281 from Integral-Tech/replace-make
Replace make with $(MAKE) in Makefile
This commit is contained in:
commit
f3405fecd9
12
lkmpg.tex
12
lkmpg.tex
|
@ -258,10 +258,10 @@ obj-m += hello-1.o
|
|||
PWD := $(CURDIR)
|
||||
|
||||
all:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
||||
\end{code}
|
||||
|
||||
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 @@ obj-m += hello-2.o
|
|||
PWD := $(CURDIR)
|
||||
|
||||
all:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
||||
\end{code}
|
||||
|
||||
Now have a look at \src{drivers/char/Makefile} for a real world example.
|
||||
|
@ -604,10 +604,10 @@ startstop-objs := start.o stop.o
|
|||
PWD := $(CURDIR)
|
||||
|
||||
all:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
||||
\end{code}
|
||||
|
||||
This is the complete makefile for all the examples we have seen so far.
|
||||
|
|
Loading…
Reference in New Issue
Block a user