62 lines
1.9 KiB
Makefile
62 lines
1.9 KiB
Makefile
|
|
# OUTPUT type
|
|
# 1 - .out
|
|
# 2 - .a
|
|
# 3 - .so
|
|
OUTPUT_TYPE = 1
|
|
OUTPUT_NAME = flash_cmd
|
|
|
|
# .h files dir
|
|
ADD_INCLUDE += $(TOPDIR)/inc/io_lib $(TOPDIR)/inc/driver $(TOPDIR)/driver/inc $(TOPDIR)/dtest/flash_cmd $(TOPDIR)/dtest/mac_rx_test/inc
|
|
ADD_INCLUDE += $(TOPDIR)/inc/utils $(TOPDIR)/inc/os_shim $(TOPDIR)/ftm/src $(TOPDIR)/ftm/inc $(TOPDIR)/inc/cli/plc $(TOPDIR)/dtest/mac_rx_test/hal/inc
|
|
ADD_INCLUDE += $(TOPDIR)/plc/halphy/test/inc $(TOPDIR)/inc/pib $(TOPDIR)/inc/uart
|
|
|
|
# predefined macro
|
|
PRE_MARCO += INCLUDE_IOT_DTEST_FTM_MODE
|
|
|
|
LD_SCRIPT = link_soc.lds
|
|
|
|
ifeq ($(gcc),arm)
|
|
ADD_LIB = cm3
|
|
ADD_LIBDIR = $(TOPDIR)/startup/cm3
|
|
else
|
|
ifeq ($(target), kunlun2)
|
|
ADD_LIB = riscv
|
|
ADD_LIBDIR =$(TOPDIR)/startup/riscv2
|
|
ADD_INCLUDE += $(TOPDIR)/driver/src/hw2/inc $(TOPDIR)/sbl/inc/hw2 $(TOPDIR)/inc/hw/reg/riscv2/15 $(TOPDIR)/dtest/mac_rx_test/hw2/inc $(TOPDIR)/dtest/mac_tx_test/hw2/inc
|
|
ADD_INCLUDE += $(TOPDIR)/startup/riscv2/inc
|
|
else
|
|
ADD_LIB = riscv
|
|
ADD_LIBDIR =$(TOPDIR)/startup/riscv
|
|
ADD_INCLUDE += $(TOPDIR)/driver/src/hw/inc $(TOPDIR)/sbl/inc/hw $(TOPDIR)/inc/hw/reg/riscv/15 $(TOPDIR)/dtest/mac_rx_test/hw/inc $(TOPDIR)/dtest/mac_tx_test/hw/inc
|
|
ADD_INCLUDE += $(TOPDIR)/startup/riscv/inc
|
|
endif
|
|
endif
|
|
|
|
ADD_LIBDIR += $(TOPDIR)/plc $(TOPDIR)/driver $(TOPDIR)/common $(TOPDIR)/os $(TOPDIR)/pib $(TOPDIR)/plc
|
|
# lib need to ld together
|
|
ADD_LIB += pib plc driver common os
|
|
|
|
#####################################################
|
|
|
|
ifdef TOPDIR
|
|
include $(TOPDIR)/build/makefile.cfg
|
|
else
|
|
include $(CURDIR)/build/makefile.cfg
|
|
TOPDIR = $(CURDIR)
|
|
export TOPDIR
|
|
endif
|
|
|
|
dump:
|
|
$(OBJDUMP) -D -S -l $(OUTPUT_FULL_NAME) > $(OUTPUT_FULL_NAME).dump
|
|
|
|
# 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)
|