Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lkmpg.tex
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ \subsection{The Simplest Module}
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).
Expand Down Expand Up @@ -461,10 +461,10 @@ \subsection{Hello and Goodbye}
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.
Expand Down Expand Up @@ -604,10 +604,10 @@ \subsection{Modules Spanning Multiple Files}
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.
Expand Down