blob: 29a26efa9328be200fce2776c04f36e27317b433 [file] [log] [blame]
# Central Makefile
#
PLATFORM ?= maple
TOP_DIR=$(shell pwd)
export PLATFORM
export TOP_DIR
ifeq ("$(PLATFORM)", "maple")
DEVICE=bcm68620
export DEVICE
else
$(error Set DEVICE for $(PLATFORM))
endif
MAKE_DIR=$(TOP_DIR)/make
MAKE_DEVICE_DIR=$(MAKE_DIR)/$(DEVICE)
export MAKE_DIR
export MAKE_DEVICE_DIR
include $(MAKE_DIR)/Makefile.initial_config
OUT_DIR ?= $(TOP_DIR)/build
OUT_DOCS_DIR ?= $(OUT_DIR)/doc
# Identify whether it is customer or development build
EMB_MODULE_LIST=$(realpath $(MAKE_DEVICE_DIR)/modules.embedded)
ifeq ("$(EMB_MODULE_LIST)", "")
RELEASE_BUILD=y
export RELEASE_BUILD
USE_LINT=n
export USE_LINT
OUT_HOST_DIR ?= $(OUT_DIR)
COPY_FS_SH = $(TOP_DIR)/make/copy_host_fs.sh
else
OUT_HOST_DIR ?= $(OUT_DIR)/$(PLATFORM)/host
OUT_EMBEDDED_DIR ?= $(OUT_DIR)/$(PLATFORM)/embedded
COPY_FS_SH = $(TOP_DIR)/scripts/copy_host_fs.sh
export OUT_EMBEDDED_DIR
endif
ifneq ("$(BOARD)", "")
COPY_HOST_FS_CMD = $(SILENT_BUILD)$(COPY_FS_SH) TOP_DIR=$(TOP_DIR) OUT_HOST_DIR=$(OUT_HOST_DIR)
endif
export OUT_HOST_DIR
export OUT_DOCS_DIR
# List of all modules, all library modules and all application modules
export ALL_MODULES
export ALL_LIB_MODULES
export ALL_APP_MODULES
# Current board
export BOARD
V ?= 0
ifeq (x"$(V)", x"0")
SILENT = -s
export SILENT
SILENT_BUILD=@
endif
ifeq ("$(RELEASE_BUILD)", "y")
all: build_host
else
all: build_host build_embedded
endif
$(COPY_HOST_FS_CMD)
@echo --- All done ---
copy_host_fs:
$(COPY_HOST_FS_CMD)
ifeq ("$(RELEASE_BUILD)", "y")
clean: clean_host
else
clean: clean_host clean_embedded
endif
rm -fr $(OUT_DIR)
help_general:
@echo "make parameters:"
@echo " PLATFORM - platform to perform the build for. The default platform is $$PLATFORM"
@echo " Supported platforms are: maple"
@echo " BOARD - TBD board"
@echo " ENABLE_EPON - Include EPON/10GEPON support. Default =y, unless overwritten in platform configuration"
@echo " ENABLE_GPON - Include GPON support. Default =y, unless overwritten in platform configuration"
@echo " ENABLE_XGPON - Include XGPON support. Default =y, unless overwritten in platform configuration"
@echo " V=<output_level> - =1-verbose command output, =2-makefile debug output"
@echo " GEN_OBJTAGS - Low-level option. OBGTAGS to be passed to code generator"
@echo " EXTRA_TYPES - Low-level option. Space-delimited list of extra types without bcmolt_ prefix"
@echo " ENABLE_CLI - =n-exclude CLI support. Included by default"
@echo " ENABLE_LOG - =n-exclude dev_log support. Included by default"
@echo "make targets:"
@echo " all - build everything for the PLATFORM. This is the default target"
@echo " host - build PLATFORM's host side"
@echo " embedded - build PLATFORM's embedded side"
@echo " clean - clean everything for the PLATFORM"
@echo " clean_host - clean PLATFORM's host side"
@echo " clean_embedded - clean PLATFORM's embedded side"
@echo " docs - generate reference document in html format"
@echo " docs_pdf - generate reference document in pdf format"
@echo " drivers - generate librdb, ru_gen and hal_generator driver layers"
@echo " clean_drivers - clean librdb, ru_gen and hal_generator"
ifeq ("$(RELEASE_BUILD)", "y")
help: help_general help_host
else
help: help_general help_host help_embedded
endif
docs: docs_host
docs_host:
$(SILENT_BUILD)$(MAKE) SUBSYSTEM=host -f $(MAKE_DIR)/Makefile.main $@
docs_pdf: docs
$(SILENT_BUILD)$(MAKE) -C $(OUT_DOCS_DIR)/latex
docs_clean:
$(SILENT_BUILD)$(BOLD_PRINT) "Cleaning docs"
$(SILENT_BUILD)rm -fr $(OUT_DOCS_DIR)
clobber: clean docs_clean
host: build_host
$(COPY_HOST_FS_CMD)
clean_host:
$(SILENT_BUILD)rm -fr $(OUT_HOST_DIR)
$(SILENT_BUILD)$(MAKE) $(SILENT) SUBSYSTEM=host -f $(MAKE_DIR)/Makefile.main $@
%_host:
$(SILENT_BUILD)$(MAKE) $(SILENT) SUBSYSTEM=host -f $(MAKE_DIR)/Makefile.main $@
ifneq ("$(RELEASE_BUILD)", "y")
embedded: build_embedded
$(COPY_HOST_FS_CMD)
clean_embedded:
$(SILENT_BUILD)rm -fr $(OUT_EMBEDDED_DIR)
$(SILENT_BUILD)$(MAKE) $(SILENT) SUBSYSTEM=embedded -f $(MAKE_DIR)/Makefile.main $@
docs_embedded:
%_embedded:
$(SILENT_BUILD)$(MAKE) $(SILENT) SUBSYSTEM=embedded -f $(MAKE_DIR)/Makefile.main $@
endif
hal_generator:
$(SILENT_BUILD)$(MAKE) $(SLIENT) -C $(TOP_DIR)/embedded/hal_generator/src
drivers:
$(SILENT_BUILD)$(MAKE) $(SLIENT) -C $(TOP_DIR)/embedded/hal_generator/librdb
$(SILENT_BUILD)$(MAKE) $(SLIENT) -C $(TOP_DIR)/embedded/hal_generator/ru_gen
$(SILENT_BUILD)$(MAKE) $(SLIENT) -C $(TOP_DIR)/embedded/pm_drv_generator
clean_drivers:
$(SILENT_BUILD)$(MAKE) $(SLIENT) -C $(TOP_DIR)/embedded/hal_generator/librdb clean
$(SILENT_BUILD)$(MAKE) $(SLIENT) -C $(TOP_DIR)/embedded/hal_generator/ru_gen clean
$(SILENT_BUILD)$(MAKE) $(SLIENT) -C $(TOP_DIR)/embedded/hal_generator/src clean
$(SILENT_BUILD)$(MAKE) $(SLIENT) -C $(TOP_DIR)/embedded/pm_drv_generator clean