mirror of
				https://git.code.sf.net/p/openocd/code
				synced 2025-11-04 13:59:05 +00:00 
			
		
		
		
	We disconnect port B and D which are going to be used by GPIF module. Change-Id: Iffaccbb43ded4b2e0b37f5ee1cc7509e90b0f3d4 Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8714 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
		
			
				
	
	
		
			78 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
# SPDX-License-Identifier: GPL-2.0-or-later
 | 
						|
#****************************************************************************
 | 
						|
#   File : Makefile                                                         *
 | 
						|
#   Contents : Code for NanoXplore USB-JTAG ANGIE adapter hardware.         *
 | 
						|
#   Based on openULINK project by: Martin Schmoelzer.                       *
 | 
						|
#   Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS.              *
 | 
						|
#   <aboudjelida@nanoxplore.com>                                            *
 | 
						|
#	<ahmederrachedbjld@gmail.com>											*
 | 
						|
# ***************************************************************************/
 | 
						|
 | 
						|
# Define the name of tools.
 | 
						|
PREFIX =
 | 
						|
 | 
						|
# Small Device C Compiler: http://sdcc.sourceforge.net/
 | 
						|
CC = $(PREFIX)sdcc
 | 
						|
 | 
						|
# 8051 assembler, part of the SDCC software package.
 | 
						|
AS = $(PREFIX)sdas8051
 | 
						|
 | 
						|
# SDCC produces quite messy Intel HEX files. This tool is be used to re-format
 | 
						|
# those files. It is not required for the firmware download functionality in
 | 
						|
# the OpenOCD driver, but the resulting file is smaller.
 | 
						|
PACKIHX = $(PREFIX)packihx
 | 
						|
 | 
						|
# GNU binutils size. Used to print the size of the IHX file generated by SDCC.
 | 
						|
SIZE = size
 | 
						|
 | 
						|
# Source and header directories.
 | 
						|
SRC_DIR     = src
 | 
						|
INCLUDE_DIR = include
 | 
						|
 | 
						|
CODE_SIZE = 0x3C00
 | 
						|
XRAM_LOC  = 0x3C00
 | 
						|
XRAM_SIZE = 0x0400
 | 
						|
 | 
						|
CFLAGS  = --std-sdcc99 --opt-code-size --model-small
 | 
						|
LDFLAGS = --code-loc 0x0000 --code-size $(CODE_SIZE) --xram-loc $(XRAM_LOC) \
 | 
						|
          --xram-size $(XRAM_SIZE) --iram-size 256 --model-small
 | 
						|
 | 
						|
# list of base object files
 | 
						|
OBJECTS = main.rel usb.rel delay.rel USBJmpTb.rel gpif.rel i2c.rel serial.rel
 | 
						|
HEADERS = $(INCLUDE_DIR)/usb.h          \
 | 
						|
          $(INCLUDE_DIR)/delay.h        \
 | 
						|
          $(INCLUDE_DIR)/reg_ezusb.h    \
 | 
						|
          $(INCLUDE_DIR)/io.h           \
 | 
						|
          $(INCLUDE_DIR)/serial.h       \
 | 
						|
          $(INCLUDE_DIR)/fx2macros.h    \
 | 
						|
          $(INCLUDE_DIR)/msgtypes.h     \
 | 
						|
          $(INCLUDE_DIR)/i2c.h
 | 
						|
 | 
						|
# Disable all built-in rules.
 | 
						|
.SUFFIXES:
 | 
						|
 | 
						|
# Targets which are executed even when identically named file is present.
 | 
						|
.PHONY: all, clean
 | 
						|
 | 
						|
all: angie_firmware.ihx
 | 
						|
	$(SIZE) angie_firmware.ihx
 | 
						|
 | 
						|
angie_firmware.ihx: $(OBJECTS)
 | 
						|
	$(CC) -mmcs51 $(LDFLAGS) -o $@ $^
 | 
						|
 | 
						|
# Rebuild every C module (there are only 8 of them) if any header changes.
 | 
						|
%.rel: $(SRC_DIR)/%.c $(HEADERS)
 | 
						|
	$(CC) -c $(CFLAGS) -mmcs51 -I$(INCLUDE_DIR) -o $@ $<
 | 
						|
 | 
						|
%.rel: $(SRC_DIR)/%.a51
 | 
						|
	$(AS) -lsgo $@ $<
 | 
						|
 | 
						|
clean:
 | 
						|
	rm -f *.asm *.lst *.rel *.rst *.sym *.ihx *.lk *.map *.mem
 | 
						|
 | 
						|
bin: angie_firmware.ihx
 | 
						|
	makebin -p angie_firmware.ihx angie_firmware.bin
 | 
						|
 | 
						|
hex: angie_firmware.ihx
 | 
						|
	$(PACKIHX) angie_firmware.ihx > fx2.hex
 |