diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 4 | ||||
-rw-r--r-- | scripts/Makefile.lib | 16 | ||||
-rwxr-xr-x | scripts/makelst | 4 |
3 files changed, 17 insertions, 7 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index d32b40048f1f..de9836eee8bb 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -22,6 +22,10 @@ EXTRA_AFLAGS := | |||
22 | EXTRA_CFLAGS := | 22 | EXTRA_CFLAGS := |
23 | EXTRA_CPPFLAGS := | 23 | EXTRA_CPPFLAGS := |
24 | EXTRA_LDFLAGS := | 24 | EXTRA_LDFLAGS := |
25 | asflags-y := | ||
26 | ccflags-y := | ||
27 | cppflags-y := | ||
28 | ldflags-y := | ||
25 | 29 | ||
26 | # Read .config if it exist, otherwise ignore | 30 | # Read .config if it exist, otherwise ignore |
27 | -include include/config/auto.conf | 31 | -include include/config/auto.conf |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 95e6e0fbdbd0..3c5e88bfecf1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -1,3 +1,9 @@ | |||
1 | # Backward compatibility | ||
2 | asflags-y += $(EXTRA_AFLAGS) | ||
3 | ccflags-y += $(EXTRA_CFLAGS) | ||
4 | cppflags-y += $(EXTRA_CPPFLAGS) | ||
5 | ldflags-y += $(EXTRA_LDFLAGS) | ||
6 | |||
1 | # Figure out what we need to build from the various variables | 7 | # Figure out what we need to build from the various variables |
2 | # =========================================================================== | 8 | # =========================================================================== |
3 | 9 | ||
@@ -84,9 +90,9 @@ basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" | |||
84 | modname_flags = $(if $(filter 1,$(words $(modname))),\ | 90 | modname_flags = $(if $(filter 1,$(words $(modname))),\ |
85 | -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") | 91 | -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") |
86 | 92 | ||
87 | _c_flags = $(KBUILD_CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o) | 93 | _c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o) |
88 | _a_flags = $(KBUILD_AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) | 94 | _a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o) |
89 | _cpp_flags = $(KBUILD_CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) | 95 | _cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) |
90 | 96 | ||
91 | # If building the kernel in a separate objtree expand all occurrences | 97 | # If building the kernel in a separate objtree expand all occurrences |
92 | # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). | 98 | # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). |
@@ -115,7 +121,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ | |||
115 | 121 | ||
116 | cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) | 122 | cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) |
117 | 123 | ||
118 | ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) | 124 | ld_flags = $(LDFLAGS) $(ldflags-y) |
119 | 125 | ||
120 | # Finds the multi-part object the current object will be linked into | 126 | # Finds the multi-part object the current object will be linked into |
121 | modname-multi = $(sort $(foreach m,$(multi-used),\ | 127 | modname-multi = $(sort $(foreach m,$(multi-used),\ |
@@ -145,7 +151,7 @@ $(obj)/%:: $(src)/%_shipped | |||
145 | # --------------------------------------------------------------------------- | 151 | # --------------------------------------------------------------------------- |
146 | 152 | ||
147 | quiet_cmd_ld = LD $@ | 153 | quiet_cmd_ld = LD $@ |
148 | cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ | 154 | cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \ |
149 | $(filter-out FORCE,$^) -o $@ | 155 | $(filter-out FORCE,$^) -o $@ |
150 | 156 | ||
151 | # Objcopy | 157 | # Objcopy |
diff --git a/scripts/makelst b/scripts/makelst index 4fc80f2b7e19..e6581496d820 100755 --- a/scripts/makelst +++ b/scripts/makelst | |||
@@ -3,8 +3,8 @@ | |||
3 | # with correct relocations from System.map | 3 | # with correct relocations from System.map |
4 | # Requires the following lines in makefile: | 4 | # Requires the following lines in makefile: |
5 | #%.lst: %.c | 5 | #%.lst: %.c |
6 | # $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $< | 6 | # $(CC) $(c_flags) -g -c -o $*.o $< && |
7 | # $(srctree)/scripts/makelst $*.o $(objtree)/System.map $(OBJDUMP) | 7 | # $(srctree)/scripts/makelst $*.o System.map $(OBJDUMP) > $@ |
8 | # | 8 | # |
9 | # Copyright (C) 2000 IBM Corporation | 9 | # Copyright (C) 2000 IBM Corporation |
10 | # Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) | 10 | # Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) |