76 lines
2.0 KiB
Makefile
76 lines
2.0 KiB
Makefile
|
|
||
|
# OUTPUT type
|
||
|
# 1 - .out
|
||
|
# 2 - .a
|
||
|
# 3 - .so
|
||
|
OUTPUT_TYPE = 2
|
||
|
OUTPUT_NAME = startup
|
||
|
|
||
|
PRE_MARCO +=
|
||
|
|
||
|
ifeq ($(target), kunlun2)
|
||
|
hw_dep = hw2
|
||
|
else ifeq ($(target), kunlun3)
|
||
|
hw_dep = hw3
|
||
|
else
|
||
|
hw_dep = hw
|
||
|
endif
|
||
|
|
||
|
# build_amp_type see IOT_BUILD_AMP_XXX for value range
|
||
|
ifeq ($(build_amp_type), 1)
|
||
|
prd_dep = cus
|
||
|
else
|
||
|
prd_dep = plc
|
||
|
endif
|
||
|
|
||
|
SUB_DIRS = misc
|
||
|
SUB_DIRS += misc/$(prd_dep)
|
||
|
ADD_INCLUDE += $(TOPDIR)/inc/app $(TOPDIR)/plc/halphy/inc $(TOPDIR)/inc/compiler/gcc $(TOPDIR)/inc $(TOPDIR)/inc/io_lib \
|
||
|
$(TOPDIR)/inc/driver $(TOPDIR)/inc/pib $(TOPDIR)/inc/uart $(TOPDIR)/inc/plc_lib $(TOPDIR)/inc/ipc \
|
||
|
$(TOPDIR)/inc/os_shim $(TOPDIR)/inc/pkt $(TOPDIR)/inc/utils $(TOPDIR)/plc/inc $(TOPDIR)/plc/common/inc $(TOPDIR)/inc/cli \
|
||
|
$(TOPDIR)/cli/communicator $(TOPDIR)/inc/dbglog $(TOPDIR)/inc/ftm $(TOPDIR)/plc/inc/mme $(TOPDIR)/plc/halmac/inc \
|
||
|
$(TOPDIR)/plc/halmac/hw/inc/desc $(TOPDIR)/driver/inc $(TOPDIR)/plc/halphy/hw/inc $(TOPDIR)/ftm/inc $(TOPDIR)/inc/lwip \
|
||
|
$(TOPDIR)/driver/src/$(hw_dep)/inc $(TOPDIR)/export/inc/socket $(TOPDIR)/inc/socket $(TOPDIR)/inc/gpio \
|
||
|
$(TOPDIR)/inc/crypto $(TOPDIR)/inc/lzma $(TOPDIR)/ftm/mp/pt_board/inc
|
||
|
|
||
|
ifeq ($(gcc), arm)
|
||
|
SUB_DIRS += cm3
|
||
|
else
|
||
|
ifeq ($(target), kunlun2)
|
||
|
SUB_DIRS += riscv2
|
||
|
ADD_INCLUDE += $(TOPDIR)/startup/riscv2/inc
|
||
|
else
|
||
|
ifeq ($(target), kunlun3)
|
||
|
SUB_DIRS += riscv3
|
||
|
ADD_INCLUDE += $(TOPDIR)/startup/riscv3/inc
|
||
|
else
|
||
|
SUB_DIRS += riscv
|
||
|
ADD_INCLUDE += $(TOPDIR)/startup/riscv/inc
|
||
|
endif
|
||
|
endif
|
||
|
endif
|
||
|
|
||
|
# 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)
|