From: Olivier MATZ <zer0@droids-corp.org>
To: linux-kernel@vger.kernel.org
Subject: Makefile : can I use both "O=" and "M=" ?
Date: Tue, 25 Oct 2005 09:34:48 +0200 [thread overview]
Message-ID: <435DE018.5000902@droids-corp.org> (raw)
Hi all,
When compiling an external module, is it possible to use both 'O=...'
and 'M=...' in the make command line ?
Here is an example :
[matz@barracuda linux-2.6.13.4]$ pwd
/usr/local/src/linux-2.6.13.4
[matz@barracuda linux-2.6.13.4]$ make V=1 M=~/module_helloworld
mkdir -p /home/matz/module_helloworld/.tmp_versions
make -f scripts/Makefile.build obj=/home/matz/module_helloworld
rm -f /home/matz/module_helloworld/built-in.o; ar rcs
/home/matz/module_helloworld/built-in.o
gcc -m32 -Wp,-MD,/home/matz/module_helloworld/.helloworld.o.d
-nostdinc -isystem /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include
-D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer
-g -pipe -msoft-float -mpreferred-stack-boundary=2 -march=i686
-mregparm=3 -Iinclude/asm-i386/mach-default
-Wdeclaration-after-statement -DMODULE -DKBUILD_BASENAME=helloworld
-DKBUILD_MODNAME=helloworld -c -o
/home/matz/module_helloworld/helloworld.o
/home/matz/module_helloworld/helloworld.c
Building modules, stage 2.
make -rR -f /usr/local/src/linux-2.6.13.4/scripts/Makefile.modpost
scripts/mod/modpost -i /usr/local/src/linux-2.6.13.4/Module.symvers
vmlinux /home/matz/module_helloworld/helloworld.o
gcc -m32 -Wp,-MD,/home/matz/module_helloworld/.helloworld.mod.o.d
-nostdinc -isystem /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include
-D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer
-g -pipe -msoft-float -mpreferred-stack-boundary=2 -march=i686
-mregparm=3 -Iinclude/asm-i386/mach-default
-Wdeclaration-after-statement -DKBUILD_BASENAME=helloworld
-DKBUILD_MODNAME=helloworld -DMODULE -c -o
/home/matz/module_helloworld/helloworld.mod.o
/home/matz/module_helloworld/helloworld.mod.c
ld -m elf_i386 -m elf_i386 -r -o
/home/matz/module_helloworld/helloworld.ko
/home/matz/module_helloworld/helloworld.o
/home/matz/module_helloworld/helloworld.mod.o
Now imagine /home/matz is read-only, and I want to generate the objects
file in /tmp :
[matz@barracuda linux-2.6.13.4]$ make V=1 M=~/module_helloworld O=/tmp
make -C /tmp \
KBUILD_SRC=/usr/local/src/linux-2.6.13.4 KBUILD_VERBOSE=1 \
KBUILD_CHECK= KBUILD_EXTMOD="/home/matz/module_helloworld" \
-f /usr/local/src/linux-2.6.13.4/Makefile _all
/usr/local/src/linux-2.6.13.4/Makefile:485: .config: No such file or
directory
mkdir -p /home/matz/module_helloworld/.tmp_versions
WARNING: Symbol version dump /tmp/Module.symvers
is missing; modules will have no dependencies and modversions.
make -f /usr/local/src/linux-2.6.13.4/scripts/Makefile.build
obj=/home/matz/module_helloworld
gcc -m32 -Wp,-MD,/home/matz/module_helloworld/.helloworld.o.d
-nostdinc -isystem /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include
-D__KERNEL__ -Iinclude -Iinclude2
-I/usr/local/src/linux-2.6.13.4/include -I/home/matz/module_helloworld
-Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -ffreestanding -O2 -fomit-frame-pointer -pipe -msoft-float
-mpreferred-stack-boundary=2
-I/usr/local/src/linux-2.6.13.4/include/asm-i386/mach-default
-Iinclude/asm-i386/mach-default -Wdeclaration-after-statement -DMODULE
-DKBUILD_BASENAME=helloworld -DKBUILD_MODNAME=helloworld -c -o
/home/matz/module_helloworld/helloworld.o
/home/matz/module_helloworld/helloworld.c
/bin/sh: line 1: scripts/basic/fixdep: No such file or directory
make[2]: *** [/home/matz/module_helloworld/helloworld.o] Error 1
make[1]: *** [_module_/home/matz/module_helloworld] Error 2
make: *** [_all] Error 2
Is it a bug or this is not supposed to work ?
Thanks & regards
Olivier
next reply other threads:[~2005-10-25 7:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-25 7:34 Olivier MATZ [this message]
2005-10-25 8:01 ` Makefile : can I use both 'O=' and 'M=' ? Sam Ravnborg
2005-10-25 17:16 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=435DE018.5000902@droids-corp.org \
--to=zer0@droids-corp.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.