84 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
		
		
			
		
	
	
			84 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
|  | 
 | ||
|  | # OUTPUT type
 | ||
|  | # 1 - .out
 | ||
|  | # 2 - .a
 | ||
|  | # 3 - .so
 | ||
|  | OUTPUT_TYPE = 1 | ||
|  | OUTPUT_NAME = mac_rx_test | ||
|  | 
 | ||
|  | ifeq ($(target), kunlun2) | ||
|  | hw_dep = hw2 | ||
|  | else | ||
|  | hw_dep = hw | ||
|  | endif | ||
|  | 
 | ||
|  | SUB_DIRS    =   $(TOPDIR)/common/os_shim/dtestos \
 | ||
|  |                 $(TOPDIR)/common/io_lib/src \
 | ||
|  |                 $(TOPDIR)/plc/halmac/desc \
 | ||
|  |                 $(TOPDIR)/common/utils \
 | ||
|  |                 $(TOPDIR)/dtest/mac_tx_test/$(hw_dep) \
 | ||
|  |                 $(TOPDIR)/dtest/mac_rx_test/$(hw_dep) \
 | ||
|  |                 $(TOPDIR)/dtest/mac_rx_test/hal | ||
|  | 
 | ||
|  | ADD_INCLUDE	+=  $(TOPDIR)/inc/pkt \
 | ||
|  |                 $(TOPDIR)/common/io_lib/inc \
 | ||
|  |                 $(TOPDIR)/inc/dbglog \
 | ||
|  |                 $(TOPDIR)/driver/inc \
 | ||
|  |                 $(TOPDIR)/dtest/mac_tx_test/inc \
 | ||
|  |                 $(TOPDIR)/dtest/mac_tx_test/$(hw_dep)/inc \
 | ||
|  |                 $(TOPDIR)/dtest/mac_rx_test/hal/inc \
 | ||
|  |                 $(TOPDIR)/dtest/mac_rx_test/inc \
 | ||
|  |                 $(TOPDIR)/dtest/mac_rx_test/$(hw_dep)/inc \
 | ||
|  |                 $(TOPDIR)/plc/halmac/$(hw_dep)/inc/reg \
 | ||
|  |                 $(TOPDIR)/plc/halmac/$(hw_dep)/inc \
 | ||
|  |                 $(TOPDIR)/plc/inc \
 | ||
|  |                 $(TOPDIR)/inc/pib \
 | ||
|  |                 $(TOPDIR)/plc/halphy/test/inc \
 | ||
|  |                 $(TOPDIR)/plc/halphy/test/$(hw_dep)/inc | ||
|  | 
 | ||
|  | # predefined macro
 | ||
|  | PRE_MARCO += | ||
|  | 
 | ||
|  | 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 | ||
|  | 
 | ||
|  | ADD_LIBDIR  +=  $(TOPDIR)/common/utils $(TOPDIR)/plc/halphy \
 | ||
|  |                 $(TOPDIR)/plc/halmac/hw \
 | ||
|  |                 $(TOPDIR)/common/pkt \
 | ||
|  |                 $(TOPDIR)/common $(TOPDIR)/driver $(TOPDIR)/dtest/startup \
 | ||
|  |                 $(TOPDIR)/plc/common $(TOPDIR)/plc/halmac | ||
|  | 
 | ||
|  | # becareful the seq of LIBs
 | ||
|  | ADD_LIB += halphy plc_common halmac driver common | ||
|  | 
 | ||
|  | #####################################################
 | ||
|  | LD_SCRIPT = link_ate.lds | ||
|  | 
 | ||
|  | 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) |