Skip to content
Snippets Groups Projects
Select Git revision
  • android-6.0.1_r0.11
  • master default protected
  • android-msm-bullhead-3.10-nougat_kgdb_less_changes
  • android-msm-bullhead-3.10-nougat_kgdb
  • android-msm-bullhead-3.10-nougat_klist
  • android-4.4
  • android-msm-vega-4.4-oreo-daydream
  • android-msm-wahoo-4.4-p-preview-5
  • android-msm-wahoo-4.4-pie
  • android-msm-marlin-3.18-p-preview-5
  • android-msm-marlin-3.18-pie
  • android-msm-wahoo-2018.07-oreo-m2
  • android-msm-wahoo-2018.07-oreo-m4
  • android-msm-wahoo-4.4-p-preview-4
  • android-msm-bullhead-3.10-oreo-m6
  • android-msm-angler-3.10-oreo-m6
  • android-msm-marlin-3.18-p-preview-4
  • android-msm-stargazer-3.18-oreo-wear-dr
  • android-msm-catshark-3.18-oreo-wear-dr
  • android-msm-wahoo-4.4-oreo-m2
  • android-msm-wahoo-4.4-oreo-m4
  • android-daydreamos-8.0.0_r0.5
  • android-8.1.0_r0.92
  • android-8.1.0_r0.91
  • android-daydreamos-8.0.0_r0.4
  • android-p-preview-5_r0.2
  • android-p-preview-5_r0.1
  • android-9.0.0_r0.5
  • android-9.0.0_r0.4
  • android-9.0.0_r0.2
  • android-9.0.0_r0.1
  • android-8.1.0_r0.81
  • android-8.1.0_r0.80
  • android-8.1.0_r0.78
  • android-8.1.0_r0.76
  • android-8.1.0_r0.75
  • android-8.1.0_r0.72
  • android-8.1.0_r0.70
  • android-p-preview-4_r0.2
  • android-p-preview-4_r0.1
  • android-wear-8.0.0_r0.30
41 results

Kbuild

Blame
  • Kbuild 2.48 KiB
    #
    # Kbuild for top-level directory of the kernel
    # This file takes care of the following:
    # 1) Generate bounds.h
    # 2) Generate asm-offsets.h (may need bounds.h)
    # 3) Check for missing system calls
    
    #####
    # 1) Generate bounds.h
    
    bounds-file := include/generated/bounds.h
    
    always  := $(bounds-file)
    targets := $(bounds-file) kernel/bounds.s
    
    quiet_cmd_bounds = GEN     $@
    define cmd_bounds
    	(set -e; \
    	 echo "#ifndef __LINUX_BOUNDS_H__"; \
    	 echo "#define __LINUX_BOUNDS_H__"; \
    	 echo "/*"; \
    	 echo " * DO NOT MODIFY."; \
    	 echo " *"; \
    	 echo " * This file was generated by Kbuild"; \
    	 echo " *"; \
    	 echo " */"; \
    	 echo ""; \
    	 sed -ne $(sed-y) $<; \
    	 echo ""; \
    	 echo "#endif" ) > $@
    endef
    
    # We use internal kbuild rules to avoid the "is up to date" message from make
    kernel/bounds.s: kernel/bounds.c FORCE
    	$(Q)mkdir -p $(dir $@)
    	$(call if_changed_dep,cc_s_c)
    
    $(obj)/$(bounds-file): kernel/bounds.s Kbuild
    	$(Q)mkdir -p $(dir $@)
    	$(call cmd,bounds)
    
    #####
    # 2) Generate asm-offsets.h
    #
    
    offsets-file := include/generated/asm-offsets.h
    
    always  += $(offsets-file)
    targets += $(offsets-file)
    targets += arch/$(SRCARCH)/kernel/asm-offsets.s
    
    
    # Default sed regexp - multiline due to syntax constraints
    define sed-y
    	"/^->/{s:->#\(.*\):/* \1 */:; \
    	s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
    	s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
    	s:->::; p;}"
    endef
    
    quiet_cmd_offsets = GEN     $@
    define cmd_offsets
    	(set -e; \
    	 echo "#ifndef __ASM_OFFSETS_H__"; \
    	 echo "#define __ASM_OFFSETS_H__"; \
    	 echo "/*"; \
    	 echo " * DO NOT MODIFY."; \
    	 echo " *"; \
    	 echo " * This file was generated by Kbuild"; \
    	 echo " *"; \