Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
fbf47415
Commit
fbf47415
authored
Jun 03, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://linux-sam.bkbits.net/kbuild
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
cbec8fba
b830d797
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
80 deletions
+87
-80
Makefile
Makefile
+44
-17
scripts/Makefile.build
scripts/Makefile.build
+43
-63
No files found.
Makefile
View file @
fbf47415
...
...
@@ -36,13 +36,36 @@ KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
SUBARCH
:=
$(
shell
uname
-m
|
sed
-e
s/i.86/i386/
-e
s/sun4u/sparc64/
\
-e
s/arm.
*
/arm/
-e
s/sa110/arm/
\
-e
s/s390x/s390/
)
ARCH
:=
$(SUBARCH)
# Remove hyphens since they have special meaning in RPM filenames
KERNELPATH
=
kernel-
$(
subst
-,,
$(KERNELRELEASE)
)
# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
# When performing cross compilation for other architectures ARCH shall be set
# to the target architecture. (See arch/* for the possibilities).
# ARCH can be set during invocation of make:
# make ARCH=ia64
# Another way is to have ARCH set in the environment.
# The default ARCH is the host where make is executed.
# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin-utils executables
# are prefixed with $(CROSS_COMPILE).
# CROSS_COMPILE can be set on the command line
# make CROSS_COMPILE=ia64-linux-
# Alternatively CROSS_COMPILE can be set in the environment.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
ARCH
?=
$(SUBARCH)
CROSS_COMPILE
?=
# Architecture as present in compile.h
UTS_MACHINE
:=
$(ARCH)
# SHELL used by kbuild
CONFIG_SHELL
:=
$(
shell
if
[
-x
"
$$
BASH"
]
;
then
echo
$$
BASH
;
\
else if
[
-x
/bin/bash
]
;
then
echo
/bin/bash
;
\
else
echo
sh
;
fi
;
fi
)
...
...
@@ -53,7 +76,6 @@ HOSTCXX = g++
HOSTCFLAGS
=
-Wall
-Wstrict-prototypes
-O2
-fomit-frame-pointer
HOSTCXXFLAGS
=
-O2
CROSS_COMPILE
=
# That's our default target when none is given on the command line
# Note that 'modules' will be added as a prerequisite as well,
...
...
@@ -789,7 +811,8 @@ help:
@
echo
'Configuration targets:'
@
echo
' oldconfig - Update current config utilising a line-oriented program'
@
echo
' menuconfig - Update current config utilising a menu based program'
@
echo
' xconfig - Update current config utilising a X-based program'
@
echo
' xconfig - Update current config utilising a QT based front-end'
@
echo
' gconfig - Update current config utilising a GTK based front-end'
@
echo
' defconfig - New config with default answer to all options'
@
echo
' allmodconfig - New config selecting modules when possible'
@
echo
' allyesconfig - New config where all options are accepted with yes'
...
...
@@ -799,7 +822,8 @@ help:
@
echo
' all - Build all targets marked with [*]'
@
echo
'* vmlinux - Build the bare kernel'
@
echo
'* modules - Build all modules'
@
echo
' dir/file.[ois]- Build specified target only'
@
echo
' modules_install - Install all modules'
@
echo
' dir/file.[ois] - Build specified target only'
@
echo
' rpm - Build a kernel as an RPM package'
@
echo
' tags/TAGS - Generate tags file for editors'
@
echo
''
...
...
@@ -810,6 +834,9 @@ help:
@
$(
if
$(archhelp)
,
$(archhelp)
,
\
echo
' No architecture specific help defined for
$(ARCH)
'
)
@
echo
''
@
echo
' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
@
echo
' make C=1 [targets] Check all c source with checker tool'
@
echo
''
@
echo
'Execute "make" or "make all" to build all targets marked with [*] '
@
echo
'For further info browse Documentation/kbuild/*'
...
...
scripts/Makefile.build
View file @
fbf47415
...
...
@@ -72,54 +72,6 @@ quiet_cmd_checksrc = CHECK $<
cmd_checksrc
=
$(CHECK)
$(c_flags)
$<
;
endif
# Module versioning
# ---------------------------------------------------------------------------
ifdef
CONFIG_MODVERSIONS
# $(call if_changed_rule,vcc_o_c) does essentially the same as the
# normal $(call if_changed_dep,cc_o_c), i.e. compile an object file
# from a C file, keeping track of the command line and dependencies.
#
# However, actually it does:
# o compile a .tmp_<file>.o from <file>.c
# o if .tmp_<file>.o doesn't contain a __ksymtab version, i.e. does
# not export symbols, we just rename .tmp_<file>.o to <file>.o and
# are done.
# o otherwise, we calculate symbol versions using the good old
# genksyms on the preprocessed source and postprocess them in a way
# that they are usable as a linker script
# o generate <file>.o from .tmp_<file>.o using the linker to
# replace the unresolved symbols __crc_exported_symbol with
# the actual value of the checksum generated by genksyms
quiet_cmd_vcc_o_c
=
CC
$(quiet_modtag)
$@
cmd_vcc_o_c
=
$(CC)
$(c_flags)
-c
-o
$
(
@D
)
/.tmp_
$
(
@F
)
$<
define
rule_vcc_o_c
$(if
$($(quiet)cmd_checksrc),echo
' $($(quiet)cmd_checksrc)'
;)
\
$(cmd_checksrc)
\
$(if
$($(quiet)cmd_vcc_o_c),echo
' $($(quiet)cmd_vcc_o_c)'
;)
\
$(cmd_vcc_o_c);
\
\
if
!
$(OBJDUMP)
-h
$(@D)/.tmp_$(@F)
|
grep
-q
__ksymtab;
then
\
mv
$(@D)/.tmp_$(@F)
$@;
\
else
\
$(CPP)
-D__GENKSYMS__
$(c_flags)
$<
\
|
$(GENKSYMS)
\
> $(@D)/.tmp_$(@F
:
.o=.ver);
\
\
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F)
\
-T $(@D)/.tmp_$(@F:.o=.ver);
\
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver);
\
fi;
\
scripts/fixdep
$(depfile)
$@
'
$(cmd_vcc_o_c)
'
>
$
(
@D
)
/.
$
(
@F
)
.tmp
;
\
rm
-f
$(depfile)
;
\
mv
-f
$
(
@D
)
/.
$
(
@F
)
.tmp
$
(
@D
)
/.
$
(
@F
)
.cmd
endef
endif
# Compile C sources (.c)
# ---------------------------------------------------------------------------
...
...
@@ -164,13 +116,49 @@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
%.i
:
%.c FORCE
$(
call
if_changed_dep,cc_i_c
)
# C (.c) files
# The C file is compiled and updated dependency information is generated.
# (See cmd_cc_o_c + relevant part of rule_cc_o_c)
quiet_cmd_cc_o_c
=
CC
$(quiet_modtag)
$@
ifndef
CONFIG_MODVERSIONS
cmd_cc_o_c
=
$(CC)
$(c_flags)
-c
-o
$@
$<
else
# When module versioning is enabled the following steps are executed:
# o compile a .tmp_<file>.o from <file>.c
# o if .tmp_<file>.o doesn't contain a __ksymtab version, i.e. does
# not export symbols, we just rename .tmp_<file>.o to <file>.o and
# are done.
# o otherwise, we calculate symbol versions using the good old
# genksyms on the preprocessed source and postprocess them in a way
# that they are usable as a linker script
# o generate <file>.o from .tmp_<file>.o using the linker to
# replace the unresolved symbols __crc_exported_symbol with
# the actual value of the checksum generated by genksyms
cmd_cc_o_c
=
$(CC)
$(c_flags)
-c
-o
$
(
@D
)
/.tmp_
$
(
@F
)
$<
cmd_modversions
=
\
if
!
$(OBJDUMP)
-h
$
(
@D
)
/.tmp_
$
(
@F
)
|
grep
-q
__ksymtab
;
then
\
mv
$
(
@D
)
/.tmp_
$
(
@F
)
$@
;
\
else
\
$(CPP)
-D__GENKSYMS__
$(c_flags)
$<
\
|
$(GENKSYMS)
\
>
$
(
@D
)
/.tmp_
$
(
@F:.o
=
.ver
)
;
\
\
$(LD)
$(LDFLAGS)
-r
-o
$@
$
(
@D
)
/.tmp_
$
(
@F
)
\
-T
$
(
@D
)
/.tmp_
$
(
@F:.o
=
.ver
)
;
\
rm
-f
$
(
@D
)
/.tmp_
$
(
@F
)
$
(
@D
)
/.tmp_
$
(
@F:.o
=
.ver
)
;
\
fi
;
endif
define
rule_cc_o_c
$(if
$($(quiet)cmd_checksrc),echo
' $($(quiet)cmd_checksrc)'
;)
\
$(cmd_checksrc)
\
$(if
$($(quiet)cmd_cc_o_c),echo
' $($(quiet)cmd_cc_o_c)'
;)
\
$(cmd_cc_o_c);
\
$(cmd_modversions)
\
scripts/fixdep
$(depfile)
$@
'$(cmd_cc_o_c)'
>
$(@D)/.$(@F).tmp;
\
rm
-f
$(depfile);
\
mv
-f
$(@D)/.$(@F).tmp
$(@D)/.$(@F).cmd
...
...
@@ -179,20 +167,12 @@ endef
# Built-in and composite module parts
%.o
:
%.c FORCE
ifdef
CONFIG_MODVERSIONS
$(
call
if_changed_rule,vcc_o_c
)
else
$(
call
if_changed_rule,cc_o_c
)
endif
# Single-part modules are special since we need to mark them in $(MODVERDIR)
$(single-used-m)
:
%.o: %.c FORCE
ifdef
CONFIG_MODVERSIONS
$(
call
if_changed_rule,vcc_o_c
)
else
$(
call
if_changed_rule,cc_o_c
)
endif
$
(
touch-module
)
quiet_cmd_cc_lst_c
=
MKLST
$@
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment