78 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
		
		
			
		
	
	
			78 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
|  | 
 | ||
|  | # OUTPUT type
 | ||
|  | # 1 - .out
 | ||
|  | # 2 - .a
 | ||
|  | # 3 - .so
 | ||
|  | OUTPUT_TYPE	= 1 | ||
|  | OUTPUT_NAME	= ada_test | ||
|  | 
 | ||
|  | ifeq ($(target), kunlun2) | ||
|  | hw_dep = hw2 | ||
|  | else | ||
|  | hw_dep = hw | ||
|  | endif | ||
|  | 
 | ||
|  | SUB_DIRS	= $(TOPDIR)/common/os_shim/dtestos \
 | ||
|  |                 $(TOPDIR)/dtest/ada_test/$(hw_dep) | ||
|  | 
 | ||
|  | ADD_INCLUDE	+= $(TOPDIR)/inc/pkt \
 | ||
|  |                 $(TOPDIR)/driver/inc \
 | ||
|  |                 $(TOPDIR)/plc/halphy/test/inc \
 | ||
|  |                 $(TOPDIR)/plc/halphy/test/$(hw_dep)/inc \
 | ||
|  |                 $(TOPDIR)/driver/src/$(hw_dep)/inc \
 | ||
|  |                 $(TOPDIR)/dtest/ada_test/inc \
 | ||
|  |                 $(TOPDIR)/dtest/ada_test/$(hw_dep)/inc | ||
|  | 
 | ||
|  | # predefined macro
 | ||
|  | PRE_MARCO   += | ||
|  | 
 | ||
|  | ADD_LIBDIR	+= $(TOPDIR)/common/utils \
 | ||
|  |                 $(TOPDIR)/plc/common \
 | ||
|  |                 $(TOPDIR)/plc/halphy \
 | ||
|  |                 $(TOPDIR)/dtest/startup \
 | ||
|  |                 $(TOPDIR)/startup/cm3 \
 | ||
|  |                 $(TOPDIR)/common/pkt \
 | ||
|  |                 $(TOPDIR)/common \
 | ||
|  |                 $(TOPDIR)/driver \
 | ||
|  |                 $(TOPDIR)/plc/halmac/$(hw_dep) | ||
|  | 
 | ||
|  | ifeq ($(gcc),arm) | ||
|  | OBJDUMP = arm-none-eabi-objdump | ||
|  | ADD_INCLUDE +=  $(TOPDIR)/os/inc/cm3 | ||
|  | ADD_LIB += cm3 | ||
|  | else | ||
|  | OBJDUMP = riscv32-unknown-elf-objdump | ||
|  | ADD_INCLUDE +=  $(TOPDIR)/os/inc/riscv | ||
|  | ADD_LIB += riscv | ||
|  | endif | ||
|  | 
 | ||
|  | # with psram
 | ||
|  | #LD_SCRIPT = link_adadump.lds
 | ||
|  | # without psram
 | ||
|  | LD_SCRIPT = link_ada_tools.lds | ||
|  | 
 | ||
|  | # becareful the seq of LIBs
 | ||
|  | ADD_LIB += halphy plc_common halmac_hw driver common | ||
|  | #####################################################
 | ||
|  | 
 | ||
|  | 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) |