Files
kunlun/common/Makefile
2024-09-28 14:24:04 +08:00

90 lines
2.2 KiB
Makefile

# OUTPUT type
# 1 - .out
# 2 - .a
# 3 - .so
OUTPUT_TYPE = 2
OUTPUT_NAME = common
ifeq ($(smp_enable), 1)
FREERTOS = freertos_smp
else
FREERTOS = freertos
endif
ifeq ($(product_line), PLC)
prd_dep = plc
else ifeq ($(product_line), BT)
prd_dep = bt
else
prd_dep = bt
endif
SUB_DIRS = compiler/gcc/src io_lib utils lzma
ifeq ($(COMMON_A_BUILD_TYPE), sbl)
SUB_DIRS += os_shim/dtestos
else
SUB_DIRS += os_shim/freertos/src share_task app/src socket pkt dbglog/$(prd_dep) dbglog ipc/itc/src
endif
ifeq ($(product_line), PLC)
ifneq ($(no_plc), 1)
SUB_DIRS += plc_lib/src
endif
endif
ADD_INCLUDE += $(TOPDIR)/inc/compiler/gcc $(TOPDIR)/common/io_lib/inc $(TOPDIR)/common/plc_lib/inc $(TOPDIR)/inc/io_lib \
$(TOPDIR)/inc $(TOPDIR)/inc/driver $(TOPDIR)/inc/app $(TOPDIR)/inc/dbglog $(TOPDIR)/inc/dbglog/$(prd_dep) \
$(TOPDIR)/inc/host_interface $(TOPDIR)/app/inc $(TOPDIR)/inc/ipc $(TOPDIR)/inc/os_shim $(TOPDIR)/inc/pkt \
$(TOPDIR)/inc/plc_lib $(TOPDIR)/inc/utils $(TOPDIR)/plc/inc $(TOPDIR)/plc/inc/mme $(TOPDIR)/os/$(FREERTOS)/include \
$(TOPDIR)/os/$(FREERTOS)/src/include $(TOPDIR)/driver/inc $(TOPDIR)/inc/cli $(TOPDIR)/import/lwip/lwip/src/include \
$(TOPDIR)/import/lwip/ports/include $(TOPDIR)/export/inc/socket $(TOPDIR)/inc/crypto
ifeq ($(gcc), arm)
ADD_INCLUDE += $(TOPDIR)/os/freertos/src/portable/ARM_CM3
else
ADD_INCLUDE += $(TOPDIR)/os/$(FREERTOS)/src/portable/RISCV
endif
ifeq ($(target), kunlun2)
hw_dep = hw2
riscv_dep = riscv2
else
ifeq ($(target), kunlun3)
hw_dep = hw3
riscv_dep = riscv3
else
hw_dep = hw
riscv_dep = riscv
endif
endif
ADD_INCLUDE += $(TOPDIR)/driver/src/${hw_dep}/inc $(TOPDIR)/startup/${riscv_dep}/inc
# predefined macro
PRE_MARCO +=
# lib dir
ADD_LIBDIR =
# lib need to ld together
ADD_LIB =
ifdef TOPDIR
include $(TOPDIR)/build/makefile.cfg
else
include $(CURDIR)/build/makefile.cfg
TOPDIR = $(CURDIR)
export TOPDIR
endif
# display the obj files and output name
debug:
@echo TOPDIR=$(TOPDIR)
@echo OUTPUT_LIB=$(OUTPUT_FULL_NAME)
@echo DEPS=$(DEPS)
@echo OBJECTS=$(OBJECTS)
@echo SRCS=$(SRCS)
@echo OBJECTS folder=$(foreach dirname, $(SUB_DIRS), $(addprefix $(BIN_DIR)/, $(dirname)))
@echo output_name=$(OUTPUT_FULL_NAME)