--- zzzz-none-000/linux-4.1.52/Makefile 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/Makefile 2022-03-02 11:37:12.000000000 +0000 @@ -4,6 +4,7 @@ EXTRAVERSION = NAME = Series 4800 + # *DOCUMENTATION* # To see a list of typical targets execute "make help" # More info can be located in ./README @@ -15,6 +16,7 @@ # o Look for make include files relative to root of kernel src MAKEFLAGS += -rR --include-dir=$(CURDIR) +BRCMDRIVERS_DIR_RELATIVE = brcm_sdk/bcmdrivers # Avoid funny character set dependencies unexport LC_ALL LC_COLLATE=C @@ -298,7 +300,18 @@ HOSTCC = gcc HOSTCXX = g++ +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +#BCM_FATAL_CC_WARNING_FLAGS := -Werror -Wfatal-errors -Wno-date-time -Wno-declaration-after-statement -Wno-switch-bool + +# BCM_KBUILD_CFLAGS is used when building the Linux kernel (not bcmdrivers) +BCM_KBUILD_CFLAGS := -g $(BCM_FATAL_CC_WARNING_FLAGS) + +# lauterbach setting +#HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -fomit-frame-pointer + +else # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE HOSTCXXFLAGS = -O2 ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1) @@ -377,12 +390,24 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im +bcm-header-dirs = $(srctree)/$(REL_INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD) \ + $(srctree)/$(REL_INC_BRCMSHARED_PUB_PATH)/pmc \ + $(srctree)/$(REL_INC_BRCMSHARED_PUB_PATH)/drv/phys \ + $(srctree)/$(REL_INC_BRCMSHARED_PRIV_PATH)/$(BRCM_BOARD) \ + $(srctree)/$(REL_INC_BRCMDRIVER_PRIV_PATH)/$(BRCM_BOARD) \ + $(srctree)/$(REL_INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD) \ + $(srctree)/$(REL_BRCMDRIVERS_DIR)/broadcom/char/wlcsm_ext/impl1/include + +USERINCLUDE_BRCM_SDK = $(addprefix -I,$(bcm-header-dirs)) + # Use USERINCLUDE when you must reference the UAPI directories only. USERINCLUDE := \ -I$(srctree)/arch/$(hdr-arch)/include/uapi \ -Iarch/$(hdr-arch)/include/generated/uapi \ -I$(srctree)/include/uapi \ -Iinclude/generated/uapi \ + $(USERINCLUDE_AVM_SUBPROJECTS) \ + $(USERINCLUDE_BRCM_SDK) \ -include $(srctree)/include/linux/kconfig.h # Use LINUXINCLUDE when you must reference the include/ directory. @@ -393,6 +418,7 @@ -Iarch/$(hdr-arch)/include/generated \ $(if $(KBUILD_SRC), -I$(srctree)/include) \ -Iinclude \ + $(LINUXINCLUDE_AVM_SUBPROJECTS) \ $(USERINCLUDE) KBUILD_CPPFLAGS := -D__KERNEL__ @@ -401,6 +427,7 @@ -fno-strict-aliasing -fno-common \ -Werror-implicit-function-declaration \ -Wno-format-security \ + -Wno-unused-parameter \ -std=gnu89 KBUILD_AFLAGS_KERNEL := @@ -434,9 +461,13 @@ # Files to ignore in find ... statements +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) + # exclude *prebuilt* directories from being cleaned as they contain + # fw objects in HND profile release builds. export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ - -name CVS -o -name .pc -o -name .hg -o -name .git \) \ + -name CVS -o -name .pc -o -name .hg -o -name .git -o -name '*prebuilt*' \) \ -prune -o +endif # BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ --exclude CVS --exclude .pc --exclude .hg --exclude .git @@ -562,9 +593,50 @@ core-y := usr/ endif # KBUILD_EXTMOD +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +# Read in config +-include include/config/auto.conf +export HPATH := $(TOPDIR)/include +export CONFIG_SYSTEM := linux +ifeq ($(strip $(CONFIG_BRCM_IKOS)),$(strip $(CONFIG_BRCM_QEMU))) #both condition should be true or false +brcmdrivers-y := $(INC_BRCMBOARDPARMS_PATH)/$(BRCM_BOARD)/ $(BRCMDRIVERS_DIR_RELATIVE)/ $(INC_UTILS_PATH)/ $(INC_FLASH_PATH)/ +brcmdrivers-y += $(INC_SPI_PATH)/ +# Other chip specific compilations +brcmdrivers-y += $(SHARED_DIR)/opensource/drv/ +ifneq "$(wildcard $(PROJECT_DIR)/target )" "" +brcmdrivers-y += $(RDP_PROJECT_DIR_RELATIVE)/target/bdmf/ $(RDP_PROJECT_DIR_RELATIVE)/target/rdpa/ $(RDP_PROJECT_DIR_RELATIVE)/target/rdpa_gpl/ $(RDP_PROJECT_DIR_RELATIVE)/target/rdpa_user/ +endif +brcmdrivers-y += $(SHARED_DIR)/opensource/drivers/ +else +brcmdrivers-y := $(BRCMDRIVERS_DIR_RELATIVE)/ $(INC_UTILS_PATH)/ +endif + +ifneq ($(CONFIG_BCM_PMC),) +brcmdrivers-$(CONFIG_BCM_PMC) += $(SHARED_DIR)/opensource/pmc/impl$(CONFIG_BCM_PMC_IMPL)/ +endif + +ifneq ($(CONFIG_BUZZZ),) +brcmdrivers-$(CONFIG_BUZZZ) += $(BRCMDRIVERS_DIR)/broadcom/char/buzzz/ +endif + +ifeq ($(KBUILD_VERBOSE),1) +$(info * bcmdrivers-y = $(brcmdrivers-y)) +$(info * bcmdrivers-m = $(brcmdrivers-m)) +$(info * INC_BRCMBOARDPARMS_PATH = $(INC_BRCMBOARDPARMS_PATH)) +$(info * BRCM_BOARD = $(BRCM_BOARD)) +$(info * BRCMDRIVERS_DIR = $(BRCMDRIVERS_DIR)) +$(info * INC_SPI_PATH = $(INC_SPI_PATH)) +$(info * INC_FLASH_PATH = $(INC_FLASH_PATH)) +endif +BRCMDRIVERS := $(brcmdrivers-y) +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE + ifeq ($(dot-config),1) +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +else # BCM_KF # Read in config -include include/config/auto.conf +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE ifeq ($(KBUILD_EXTMOD),) # Read in dependencies to all Kconfig* files, make sure to run @@ -579,7 +651,11 @@ # if auto.conf.cmd is missing then we are probably in a cleaned tree so # we execute the config step to be sure to catch updated Kconfig files include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) + $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig ARCH=$(ARCH) +else # BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig +endif # BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) else # external modules needs include/generated/autoconf.h and include/config/auto.conf # but do not care if they are up-to-date. Use auto.conf to trigger the test @@ -605,7 +681,12 @@ # command line. # This allow a user to issue only 'make' to build a kernel including modules # Defaults to vmlinux, but the arch makefile usually adds further targets + +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +all: bcm_vmlinux +else # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE all: vmlinux +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE include arch/$(SRCARCH)/Makefile @@ -620,8 +701,107 @@ ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) else +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +KERNEL_DEBUG ?= 0 +ifneq ($(strip $(BRCM_KERNEL_DEBUG)$(KERNEL_DEBUG)),0) +ifeq ($(KBUILD_VERBOSE),1) +$(info "Compiling gdb symbols into kernel (-g)") +endif +KBUILD_CFLAGS += -g +endif +ifneq ($(strip $(KERNEL_DEBUG)), 0) +ifeq ($(KBUILD_VERBOSE),1) +$(info "Setting optimization to debug levels (-O1)") +endif +KBUILD_CFLAGS += -O1 +KBUILD_AFLAGS += -gdwarf-4 +KBUILD_CFLAGS += -Wno-uninitialized + +# Kernel does not compile with -O0. Set optimizatin to -O1 and disable all other optimizations +# except for the ones which result in errors when compiling kernel +KBUILD_CFLAGS += -fno-branch-count-reg +KBUILD_CFLAGS += -fno-combine-stack-adjustments +KBUILD_CFLAGS += -fno-common +KBUILD_CFLAGS += -fno-compare-elim +KBUILD_CFLAGS += -fno-cprop-registers +KBUILD_CFLAGS += -fno-dce +KBUILD_CFLAGS += -fno-defer-pop +KBUILD_CFLAGS += -fno-delayed-branch +KBUILD_CFLAGS += -fno-delete-null-pointer-checks +KBUILD_CFLAGS += -fno-dse +KBUILD_CFLAGS += -fno-early-inlining +#KBUILD_CFLAGS += -fno-forward-propagate +KBUILD_CFLAGS += -fno-gcse-lm +KBUILD_CFLAGS += -fno-guess-branch-probability +KBUILD_CFLAGS += -fno-if-conversion +KBUILD_CFLAGS += -fno-if-conversion2 +KBUILD_CFLAGS += -fno-inline-functions-called-once +KBUILD_CFLAGS += -fno-ipa-profile +KBUILD_CFLAGS += -fno-ipa-pure-const +KBUILD_CFLAGS += -fno-ipa-reference +KBUILD_CFLAGS += -fno-ivopts +KBUILD_CFLAGS += -fno-jump-tables +KBUILD_CFLAGS += -fno-math-errno +KBUILD_CFLAGS += -fno-merge-constants +KBUILD_CFLAGS += -fno-move-loop-invariants +KBUILD_CFLAGS += -fno-omit-frame-pointer +KBUILD_CFLAGS += -fno-peephole +KBUILD_CFLAGS += -fno-prefetch-loop-arrays +KBUILD_CFLAGS += -fno-rename-registers +#KBUILD_CFLAGS += -fno-rtti +KBUILD_CFLAGS += -fno-sched-critical-path-heuristic +KBUILD_CFLAGS += -fno-sched-dep-count-heuristic +KBUILD_CFLAGS += -fno-sched-group-heuristic +KBUILD_CFLAGS += -fno-sched-interblock +KBUILD_CFLAGS += -fno-sched-last-insn-heuristic +KBUILD_CFLAGS += -fno-sched-rank-heuristic +KBUILD_CFLAGS += -fno-sched-spec +KBUILD_CFLAGS += -fno-sched-spec-insn-heuristic +KBUILD_CFLAGS += -fno-sched-stalled-insns-dep +KBUILD_CFLAGS += -fno-short-enums +KBUILD_CFLAGS += -fno-signed-zeros +KBUILD_CFLAGS += -fno-split-ivs-in-unroller +KBUILD_CFLAGS += -fno-split-wide-types +#KBUILD_CFLAGS += -fno-no-threadsafe-statics +KBUILD_CFLAGS += -fno-toplevel-reorder +KBUILD_CFLAGS += -fno-trapping-math +KBUILD_CFLAGS += -fno-tree-bit-ccp +#KBUILD_CFLAGS += -fno-tree-ccp +KBUILD_CFLAGS += -fno-tree-ch +KBUILD_CFLAGS += -fno-tree-copy-prop +KBUILD_CFLAGS += -fno-tree-copyrename +KBUILD_CFLAGS += -fno-tree-cselim +KBUILD_CFLAGS += -fno-tree-dce +KBUILD_CFLAGS += -fno-tree-dominator-opts +KBUILD_CFLAGS += -fno-tree-dse +KBUILD_CFLAGS += -fno-tree-forwprop +KBUILD_CFLAGS += -fno-tree-fre +KBUILD_CFLAGS += -fno-tree-loop-if-convert +KBUILD_CFLAGS += -fno-tree-loop-im +KBUILD_CFLAGS += -fno-tree-loop-ivcanon +KBUILD_CFLAGS += -fno-tree-loop-optimize +KBUILD_CFLAGS += -fno-tree-phiprop +KBUILD_CFLAGS += -fno-tree-pta +KBUILD_CFLAGS += -fno-tree-reassoc +KBUILD_CFLAGS += -fno-tree-scev-cprop +KBUILD_CFLAGS += -fno-tree-sink +KBUILD_CFLAGS += -fno-tree-slp-vectorize +KBUILD_CFLAGS += -fno-tree-sra +KBUILD_CFLAGS += -fno-tree-ter +KBUILD_CFLAGS += -fno-tree-vect-loop-version +KBUILD_CFLAGS += -fno-unit-at-a-time +KBUILD_CFLAGS += -fno-var-tracking +KBUILD_CFLAGS += -fno-var-tracking-assignments +KBUILD_CFLAGS += -fno-web + +CONFIG_FRAME_WARN = 0 +else KBUILD_CFLAGS += -O2 endif +else # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE +KBUILD_CFLAGS += -O2 +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE +endif # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) @@ -783,7 +963,6 @@ # Make sure -fstack-check isn't enabled (like gentoo apparently did) KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,) - # conserve stack if available KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) @@ -808,12 +987,42 @@ KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS) KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS) +ifneq ($(strip $(BCA_HNDROUTER)),) +KBUILD_CFLAGS += -DBCA_HNDROUTER +endif +ifneq ($(strip $(BCA_CPEROUTER)),) +KBUILD_CFLAGS += -DBCA_CPEROUTER +endif + +ifdef BCM_KF # defined(CONFIG_BCM_KF_BUZZZ) +ifneq ($(CONFIG_BUZZZ_FUNC),) +# To support -O0 (no inlining) compilation, several compile time check need to +# be disabled within the kernel build as well as driver builds. +# e.g. BUILD_BUG(), __compiletime_assert() are no-ops. These noops may lead to +# unused variables, labels, functions, etc. +KBUILD_CFLAGS += $(call cc-disable-warning,return-type) +KBUILD_CFLAGS += $(call cc-disable-warning,unused-value) +KBUILD_CFLAGS += $(call cc-disable-warning,unused-label) +KBUILD_CFLAGS += $(call cc-disable-warning,unused-function) +KBUILD_CFLAGS += $(call cc-disable-warning,unused-variable) +ifneq ($(CONFIG_ARM64),) +# Compile time check of frame size limits of 2K, were applicable for 8K stacks. +# Post linux 3.16, stack size has been increased to 16K (arch/arm64) +KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=4096) +endif # CONFIG_ARM64 +endif # CONFIG_BUZZZ_FUNC +endif # BCM_KF # CONFIG_BCM_KF_BUZZZ + # Use --build-id when available. LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ $(call cc-ldoption, -Wl$(comma)--build-id,)) KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +LDFLAGS_vmlinux += -z max-page-size=0x8000 -Map vmlinux.map +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE + ifeq ($(CONFIG_STRIP_ASM_SYMS),y) LDFLAGS_vmlinux += $(call ld-option, -X,) endif @@ -843,6 +1052,7 @@ # makefile but the argument can be passed to make if needed. # + MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) export MODLIB @@ -905,16 +1115,39 @@ ifeq ($(KBUILD_EXTMOD),) core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ + $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ + $(brcmdrivers-y) $(brcmdrivers-m) \ + $(net-y) $(net-m) $(libs-y) $(libs-m))) + +vmlinux-dirs-1 := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ + $(core-y) $(core-m) $(drivers-y) $(drivers-m))) + +brcmdriver-dirs := $(patsubst %/,%,$(filter %/, \ + $(brcmdrivers-y) $(brcmdrivers-m))) + +vmlinux-dirs-2 := $(patsubst %/,%,$(filter %/, \ + $(net-y) $(net-m) $(libs-y) $(libs-m))) + +vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ + $(init-) $(core-) $(drivers-) $(net-) $(libs-)))) \ + $(brcmdrivers-n) $(brcmdrivers-) +else # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ $(net-y) $(net-m) $(libs-y) $(libs-m))) vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ $(init-) $(core-) $(drivers-) $(net-) $(libs-)))) +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE init-y := $(patsubst %/, %/built-in.o, $(init-y)) core-y := $(patsubst %/, %/built-in.o, $(core-y)) drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +brcmdrivers-y := $(patsubst %/, %/built-in.o, $(brcmdrivers-y)) +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE net-y := $(patsubst %/, %/built-in.o, $(net-y)) libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) @@ -922,7 +1155,18 @@ # Externally visible symbols (used by link-vmlinux.sh) export KBUILD_VMLINUX_INIT := $(head-y) $(init-y) +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(brcmdrivers-y) $(net-y) +ifeq ($(KBUILD_VERBOSE),1) +$(info kernel makefile environment variables size) +$(shell echo "" | xargs --show-limits) +$(info *******************************) +$(info * vmlinux-main: $(KBUILD_VMLINUX_MAIN)) +$(info * brcmdrivers-y: $(brcmdrivers-y)) +endif +else # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y) +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds export LDFLAGS_vmlinux # used by scripts/pacmage/Makefile @@ -934,6 +1178,20 @@ cmd_link-vmlinux = $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) quiet_cmd_link-vmlinux = LINK $@ +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +# vmlinux image - including updated kernel symbols + +.PHONY: bcm_vmlinux + +bcm_vmlinux: vmlinux | prepare_bcm_driver + +# Ensure that prepare_bcm_driver is run before vmlinux starts. prepare_bcm_driver +# creates all of the bcmdriver symlinks. Note that vmlinux performs actions on +# its normal prerequisites, so this must be added as order-only. +vmlinux : | prepare_bcm_driver + +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE + # Include targets which we want to # execute if the rest of the kernel build went well. vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE @@ -953,7 +1211,22 @@ # The actual objects are generated when descending, # make sure no implicit rule kicks in +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +ifeq ($(KBUILD_VERBOSE),1) +$(info * vmlinux-init: $(KBUILD_VMLINUX_INIT)) +$(info * vmlinux-main: $(KBUILD_VMLINUX_MAIN)) +$(info * vmlinux-lds: $(KBUILD_LDS)) +$(info *) +$(info * vmlinux-dirs-1: $(vmlinux-dirs-1)) +$(info * brcmdriver-dirs: $(brcmdriver-dirs)) +$(info * vmlinux-dirs-2: $(vmlinux-dirs-2)) +$(info *) +$(info $(sort $(KBUILD_VMLINUX_INIT) $(KBUILD_VMLINUX_MAIN)) $(KBUILD_LDS): $(vmlinux-dirs-1) $(brcmdriver-dirs) $(vmlinux-dirs-2)); +endif +$(sort $(KBUILD_VMLINUX_INIT) $(KBUILD_VMLINUX_MAIN)) $(KBUILD_LDS): $(vmlinux-dirs-1) $(brcmdriver-dirs) $(vmlinux-dirs-2); +else # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE # Handle descending into subdirectories listed in $(vmlinux-dirs) # Preset locale variables to speed up the build process. Limit locale @@ -961,9 +1234,34 @@ # make menuconfig etc. # Error messages still appears in the original language +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +PHONY += $(vmlinux-dirs-1) +$(vmlinux-dirs-1): prepare scripts + $(Q)$(MAKE) BCM_KBUILD_CMDLINE_FLAGS='$(BCM_KBUILD_CFLAGS)' $(build)=$@ + +PHONY += $(brcmdriver-dirs) + +ifeq ($(wildcard $(CURDIR)/rdp_flags.txt),) + INC_RDP_FLAGS:='' +else + INC_RDP_FLAGS:='@$(CURDIR)/rdp_flags.txt' +endif + +$(brcmdriver-dirs): $(vmlinux-dirs-1) | prepare_bcm_driver +ifdef NO_BRCMDRIVER_PARALLEL + $(Q)INC_RDP_FLAGS=${INC_RDP_FLAGS} $(MAKE) -j1 $(build)=$@ +else + $(Q)INC_RDP_FLAGS=${INC_RDP_FLAGS} $(MAKE) $(build)=$@ +endif + +PHONY += $(vmlinux-dirs-2) +$(vmlinux-dirs-2): $(brcmdriver-dirs) prepare scripts + $(Q)$(MAKE) BCM_KBUILD_CMDLINE_FLAGS='$(BCM_KBUILD_CFLAGS)' $(build)=$@ +else # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE PHONY += $(vmlinux-dirs) $(vmlinux-dirs): prepare scripts $(Q)$(MAKE) $(build)=$@ +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFIL define filechk_kernel.release echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" @@ -983,6 +1281,18 @@ # Listed in dependency order PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3 +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +PHONY += prepare_bcm_driver +$(brcmdrivers-y): | prepare_bcm_driver + +prepare_bcm_driver: + $(Q)$(MAKE) -C $(BRCMDRIVERS_DIR) symlinks + +version_info: + $(Q)$(MAKE) -C $(BRCMDRIVERS_DIR) version_info + +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE + # prepare3 is used to check if we are building in a separate output directory, # and if so do: # 1) Check that make has not been executed in the kernel src $(srctree) @@ -1009,7 +1319,11 @@ $(Q)$(MAKE) $(build)=. # All the preparing.. +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +prepare: prepare0 | prepare_bcm_driver +else # BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) prepare: prepare0 +endif # BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) # Generate some files # --------------------------------------------------------------------------- @@ -1084,6 +1398,11 @@ $(Q)$(MAKE) $(hdr-inst)=include/uapi $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) + $(Q)$(foreach dir,\ + $(bcm-header-dirs), \ + $(MAKE) $(hdr-inst)=$(dir:$(srctree)/%=%)/uapi dst=include/uapi; \ + ) + PHONY += headers_check_all headers_check_all: headers_install_all $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check @@ -1093,6 +1412,12 @@ $(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1 $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1 +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +nvram_3k: all + @mv $(CURDIR)/vmlinux $(CURDIR)/vmlinux_secureboot + @mv $(CURDIR)/vmlinux.restore $(CURDIR)/vmlinux +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE + # --------------------------------------------------------------------------- # Kernel selftest @@ -1116,18 +1441,35 @@ # using awk while concatenating to the final file. PHONY += modules + +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) + +$(vmlinux-dirs-2) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin : | prepare_bcm_driver + +modules: $(vmlinux-dirs-2) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin + $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=%/modules.order) > $(objtree)/modules.order + @$(kecho) ' Building modules, stage 2.'; + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild +else # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +%/modules.builtin: include/config/auto.conf | prepare_bcm_driver + $(Q)$(MAKE) $(modbuiltin)=$* +else # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE %/modules.builtin: include/config/auto.conf $(Q)$(MAKE) $(modbuiltin)=$* +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE # Target to prepare building external modules PHONY += modules_prepare @@ -1142,7 +1484,6 @@ @rm -rf $(MODLIB)/kernel @rm -f $(MODLIB)/source @mkdir -p $(MODLIB)/kernel - @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \ rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ @@ -1203,7 +1544,7 @@ # clean: rm-dirs := $(CLEAN_DIRS) clean: rm-files := $(CLEAN_FILES) -clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples) +clean-dirs := $(addprefix _clean_, . $(wildcard $(vmlinux-alldirs)) Documentation samples) PHONY += $(clean-dirs) clean archclean vmlinuxclean $(clean-dirs): @@ -1211,6 +1552,9 @@ vmlinuxclean: $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) + rm -f vmlinux.map +endif # BCM_KF #CONFIG_BCM_KF_MISC_MAKEFILE clean: archclean vmlinuxclean @@ -1410,6 +1754,14 @@ modules_install: _emodinst_ _emodinst_post install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra) +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +ifeq ($(KBUILD_VERBOSE),1) +$(info "2 install-dir is $(install-dir)") +$(info "2 INSTALL_MOD_DIR is $(INSTALL_MOD_DIR)") +$(info "2 MODLIB is $(MODLIB)") +endif +endif # BCM_KF # CONFIG_BCM_KF_MISC_MAKEFILE + PHONY += _emodinst_ _emodinst_: $(Q)mkdir -p $(MODLIB)/$(install-dir) @@ -1422,7 +1774,11 @@ clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD)) PHONY += $(clean-dirs) clean +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) +$(clean-dirs): | prepare_bcm_driver +else # BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) $(clean-dirs): +endif # BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) clean: rm-dirs := $(MODVERDIR) @@ -1454,6 +1810,17 @@ -o -name '*.symtypes' -o -name 'modules.order' \ -o -name modules.builtin -o -name '.tmp_*.o.*' \ -o -name '*.gcno' \) -type f -print | xargs rm -f +ifdef BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) + @echo Cleaning bcmdrivers + @find . $(BRCMDRIVERS) $(RCS_FIND_IGNORE) \ + \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ + -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ + -o -name '*.symtypes' -o -name 'modules.order' \ + -o -name modules.builtin -o -name '.tmp_*.o.*' \ + -o -name '*.gcno' \) -type f -print | xargs rm -f + @echo Cleaning bcmlinks + $(Q)$(MAKE) -C $(BRCMDRIVERS_DIR) cleanlinks +endif # BCM_KF # defined(CONFIG_BCM_KF_MISC_MAKEFILE) # Generate tags for editors # --------------------------------------------------------------------------- @@ -1603,6 +1970,8 @@ include $(cmd_files) endif +-include $(srctree)/avm/make/generated/linux.make + endif # skip-makefile PHONY += FORCE