Magellan Linux

Diff of /trunk/mkinitrd-magellan/klibc/scripts/Kbuild.klibc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1121 by niro, Mon May 4 17:22:31 2009 UTC revision 1122 by niro, Wed Aug 18 21:11:40 2010 UTC
# Line 58  targets := Line 58  targets :=
58  __build:  __build:
59    
60  # Read .config if it exist, otherwise ignore  # Read .config if it exist, otherwise ignore
61  -include .config  -include $(objtree)/.config
62    
63  # Generic Kbuild routines  # Generic Kbuild routines
64  include $(srctree)/scripts/Kbuild.include  include $(srctree)/scripts/Kbuild.include
# Line 66  include $(srctree)/scripts/Kbuild.includ Line 66  include $(srctree)/scripts/Kbuild.includ
66  # Defines used when compiling early userspace (klibc programs)  # Defines used when compiling early userspace (klibc programs)
67  # ---------------------------------------------------------------------------  # ---------------------------------------------------------------------------
68    
69  KLIBCREQFLAGS     := $(call cc-option, -fno-stack-protector, )  KLIBCREQFLAGS     := $(call cc-option, -fno-stack-protector, ) \
70                         $(call cc-option, -fwrapv, )
71  KLIBCARCHREQFLAGS :=  KLIBCARCHREQFLAGS :=
72  KLIBCOPTFLAGS     :=  KLIBCOPTFLAGS     :=
73  KLIBCWARNFLAGS    := -W -Wall -Wno-sign-compare -Wno-unused-parameter  KLIBCWARNFLAGS    := -W -Wall -Wno-sign-compare -Wno-unused-parameter
# Line 75  KLIBCBITSIZE      := Line 76  KLIBCBITSIZE      :=
76  KLIBCLDFLAGS      :=  KLIBCLDFLAGS      :=
77  KLIBCCFLAGS       :=  KLIBCCFLAGS       :=
78    
79    # Defaults for arch to override
80    KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)/arch/$(KLIBCARCH)/include
81    
82  # Arch specific definitions for klibc  # Arch specific definitions for klibc
83  include $(KLIBCSRC)/arch/$(KLIBCARCHDIR)/MCONFIG  include $(srctree)/$(KLIBCSRC)/arch/$(KLIBCARCHDIR)/MCONFIG
84    
85  # include/asm-* architecture  # include/asm-* architecture
86  KLIBCASMARCH  ?= $(KLIBCARCH)  KLIBCASMARCH  ?= $(KLIBCARCH)
# Line 102  KLIBCCPPFLAGS    := -nostdinc -iwithpref Line 106  KLIBCCPPFLAGS    := -nostdinc -iwithpref
106      -I$(KLIBCOBJ)/../include \      -I$(KLIBCOBJ)/../include \
107                      -I$(KLIBCINC)                      -I$(KLIBCINC)
108  # kernel include paths  # kernel include paths
109  KLIBCKERNELSRC ?= $(srctree)/  KLIBCKERNELSRC ?= $(srctree)
110  KLIBCCPPFLAGS    += -I$(KLIBCKERNELSRC)include -I$(KLIBCKERNELSRC)arch/x86/include \  KLIBCKERNELOBJ ?= $(objtree)
111                       $(if $(KBUILD_SRC),-I$(KLIBCKERNELOBJ)include2 -I$(KLIBCKERNELOBJ)include -I$(srctree)/include)    \  KLIBCCPPFLAGS    += -I$(KLIBCKERNELSRC)/include    \
112                         $(if $(KBUILD_SRC),-I$(KLIBCKERNELOBJ)/include2    \
113           -I$(KLIBCKERNELOBJ)/include -I$(srctree)/include)    \
114       $(KLIBCARCHINCFLAGS)       $(KLIBCARCHINCFLAGS)
115    
116  # klibc definitions  # klibc definitions
# Line 137  export KLIBCLD KLIBCCC KLIBCAR KLIBCSTRI Line 143  export KLIBCLD KLIBCCC KLIBCAR KLIBCSTRI
143  export KLIBCCFLAGS KLIBCAFLAGS KLIBCLIBGCC KLIBCSHAREDFLAGS KLIBCSTRIPFLAGS  export KLIBCCFLAGS KLIBCAFLAGS KLIBCLIBGCC KLIBCSHAREDFLAGS KLIBCSTRIPFLAGS
144  export KLIBCCRT0 KLIBCLIBC SHLIBDIR  export KLIBCCRT0 KLIBCLIBC SHLIBDIR
145    
 # kernel configuration  
 include .config  
   
146  # Add $(obj)/ for paths that is not absolute  # Add $(obj)/ for paths that is not absolute
147  objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))  objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
148    
149  # Kbuild file in the directory that is being build  # Kbuild file in the directory that is being build
150  include $(obj)/Kbuild  include $(srctree)/$(obj)/Kbuild
151    
152  #####  #####
153  # static-y + shared-y handling  # static-y + shared-y handling
# Line 203  klib-dirs       := $(addprefix $(obj)/,$ Line 206  klib-dirs       := $(addprefix $(obj)/,$
206  __klibccflags    = $(KLIBCCFLAGS) $(EXTRA_KLIBCCFLAGS) $(KLIBCCFLAGS_$(*F).o)  __klibccflags    = $(KLIBCCFLAGS) $(EXTRA_KLIBCCFLAGS) $(KLIBCCFLAGS_$(*F).o)
207  __klibcaflags    = $(KLIBCAFLAGS) $(EXTRA_KLIBCAFLAGS) $(KLIBCAFLAGS_$(*F).o)  __klibcaflags    = $(KLIBCAFLAGS) $(EXTRA_KLIBCAFLAGS) $(KLIBCAFLAGS_$(*F).o)
208    
 ifeq ($(KBUILD_SRC),)  
 _klibccflags    = $(__klibccflags)  
 _klibcaflags    = $(__klibcaflags)  
 else  
209  _klibccflags    = $(call flags,__klibccflags)  _klibccflags    = $(call flags,__klibccflags)
210  _klibcaflags    = $(call flags,__klibcaflags)  _klibcaflags    = $(call flags,__klibcaflags)
 endif  
211    
212  klibccflags     = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(_klibccflags)  klibccflags     = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(_klibccflags)
213  klibcaflags     = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(_klibcaflags)  klibcaflags     = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(_klibcaflags)
# Line 415  endif Line 413  endif
413  # Shorthand for $(Q)$(MAKE) -f scripts/Kbuild.klibc obj  # Shorthand for $(Q)$(MAKE) -f scripts/Kbuild.klibc obj
414  # Usage:  # Usage:
415  # $(Q)$(MAKE) $(klibc)=dir  # $(Q)$(MAKE) $(klibc)=dir
416  klibc := -rR -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Kbuild.klibc obj  klibc := -rR -f $(srctree)/scripts/Kbuild.klibc obj

Legend:
Removed from v.1121  
changed lines
  Added in v.1122