63 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
		
		
			
		
	
	
			63 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# OUTPUT type
							 | 
						||
| 
								 | 
							
								# 1 - .out
							 | 
						||
| 
								 | 
							
								# 2 - .a
							 | 
						||
| 
								 | 
							
								# 3 - .so
							 | 
						||
| 
								 | 
							
								OUTPUT_TYPE	= 1
							 | 
						||
| 
								 | 
							
								OUTPUT_NAME	= mac_rx_test
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								SUB_DIRS	= $(TOPDIR)/common/os_shim/dtestos \
							 | 
						||
| 
								 | 
							
											  $(TOPDIR)/common/io_lib/src \
							 | 
						||
| 
								 | 
							
											  $(TOPDIR)/common/utils
							 | 
						||
| 
								 | 
							
								#			  $(TOPDIR)/plc/halmac/desc \
							 | 
						||
| 
								 | 
							
											  
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								ADD_INCLUDE	+= $(TOPDIR)/inc/pkt \
							 | 
						||
| 
								 | 
							
											   $(TOPDIR)/common/io_lib/inc \
							 | 
						||
| 
								 | 
							
											   $(TOPDIR)/inc/dbglog
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# predefined macro
							 | 
						||
| 
								 | 
							
								PRE_MARCO   += 
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								LD_SCRIPT = link_mac_txrx.lds
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								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)/startup/riscv \
							 | 
						||
| 
								 | 
							
											  $(TOPDIR)/startup/cm3 $(TOPDIR)/common/pkt $(TOPDIR)/driver $(TOPDIR)/common/io_lib \
							 | 
						||
| 
								 | 
							
											  $(TOPDIR)/common $(TOPDIR)/driver $(TOPDIR)/os
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# becareful the seq of LIBs
							 | 
						||
| 
								 | 
							
								ADD_LIB += halphy halmac_hw io_lib 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)
							 |