71 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
		
		
			
		
	
	
			71 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
|  | 
 | ||
|  | # OUTPUT type
 | ||
|  | # 1 - .out
 | ||
|  | # 2 - .a
 | ||
|  | # 3 - .so
 | ||
|  | OUTPUT_TYPE	= 1 | ||
|  | OUTPUT_NAME	= dtest_scan_test | ||
|  | 
 | ||
|  | ifeq ($(target), kunlun2) | ||
|  | ADD_INCLUDE += $(TOPDIR)/driver/src/hw2/inc | ||
|  | else | ||
|  | ADD_INCLUDE += $(TOPDIR)/driver/src/hw/inc | ||
|  | endif | ||
|  | 
 | ||
|  | SUB_DIRS	= | ||
|  | 
 | ||
|  | ADD_INCLUDE += $(TOPDIR)/inc/pkt \
 | ||
|  |         $(TOPDIR)/dtest/mac_tx_test \
 | ||
|  |         $(TOPDIR)/dtest/mac_rx_test \
 | ||
|  |         $(TOPDIR)/driver/inc \
 | ||
|  |         $(TOPDIR)/plc/halphy/test/inc | ||
|  | 
 | ||
|  | # predefined macro
 | ||
|  | PRE_MARCO   += MODULE_EN=1 | ||
|  | 
 | ||
|  | 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/common\
 | ||
|  | 			  $(TOPDIR)/plc/halmac $(TOPDIR)/startup/riscv \
 | ||
|  | 			  $(TOPDIR)/startup/cm3 $(TOPDIR)/common/pkt \
 | ||
|  | 			  $(TOPDIR)/common $(TOPDIR)/driver $(TOPDIR)/os | ||
|  | 
 | ||
|  | # becareful the seq of LIBs
 | ||
|  | ADD_LIB += halphy plc_common halmac driver common os | ||
|  | 
 | ||
|  | EXT_SRC += $(TOPDIR)/dtest/ada_test/ada_main.c \
 | ||
|  | 			$(TOPDIR)/dtest/ada_test/math.c \
 | ||
|  | 			$(TOPDIR)/dtest/ada_test/fft.c \
 | ||
|  | 			$(TOPDIR)/dtest/mac_tx_test/tx_entry.c | ||
|  | 
 | ||
|  | #####################################################
 | ||
|  | 
 | ||
|  | 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) |