이렇게 정의된 Makefile을 볼 수 있을 것이다.

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

여기에서 make, modules, clean은 target인 것 같고 나머지는 옵션... 같은데 미리 정의된 것인듯 하다. 이에 대한 설명이 없어 찾아본 결과 다음 경로에서 아래의 내용을 찾을 수 있었다.

커널 소스 내 Documentation/kbuild/module.txt

--- 2.2 Options
87	
88		($KDIR refers to the path of the kernel source directory.)
89	
90		make -C $KDIR M=$PWD
91	
92		-C $KDIR
93			The directory where the kernel source is located.
94			"make" will actually change to the specified directory
95			when executing and will change back when finished.
96	
97		M=$PWD
98			Informs kbuild that an external module is being built.
99			The value given to "M" is the absolute path of the
100			directory where the external module (kbuild file) is
101			located.
102	
103	--- 2.3 Targets
104	
105		When building an external module, only a subset of the "make"
106		targets are available.
107	
108		make -C $KDIR M=$PWD [target]
109	
110		The default will build the module(s) located in the current
111		directory, so a target does not need to be specified. All
112		output files will also be generated in this directory. No
113		attempts are made to update the kernel source, and it is a
114		precondition that a successful "make" has been executed for the
115		kernel.
116	
117		modules
118			The default target for external modules. It has the
119			same functionality as if no target was specified. See
120			description above.
121	
122		modules_install
123			Install the external module(s). The default location is
124			/lib/modules/<kernel_release>/extra/, but a prefix may
125			be added with INSTALL_MOD_PATH (discussed in section 5).
126	
127		clean
128			Remove all generated files in the module directory only.
129	
130		help
131			List the available targets for external modules.

'Embedded Lab > linux, x86' 카테고리의 다른 글

[diff 사용법]  (0) 2012.10.26
[find]  (0) 2012.10.18
[안드로이드용 Linux Kernel Source Code 받기]  (0) 2012.10.17
[모듈 만들어 올리기]  (0) 2012.10.16
[error가 있는지 확인 출력]  (0) 2012.10.15
Posted by cyj4369
,