mirror of
				https://github.com/rfivet/stm32bringup.git
				synced 2025-11-03 16:38:16 -05:00 
			
		
		
		
	Allow putchar() to be defined as a macro to pass regression test using older version of the toolchain.
This commit is contained in:
		
							
								
								
									
										32
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								Makefile
									
									
									
									
									
								
							@@ -5,23 +5,29 @@
 | 
			
		||||
 | 
			
		||||
ifeq (linux, $(findstring linux, $(MAKE_HOST)))
 | 
			
		||||
 INSTALLDIR = $(HOME)/Packages
 | 
			
		||||
#GCCDIR = $(INSTALLDIR)/gcc-arm-none-eabi-9-2019-q4-major
 | 
			
		||||
#GCCDIR = $(INSTALLDIR)/gcc-arm-none-eabi-9-2020-q2-update
 | 
			
		||||
 GCCDIR = $(INSTALLDIR)/gcc-arm-none-eabi-10-2020-q4-major
 | 
			
		||||
#REVDIR = gcc-arm-none-eabi-9-2019-q4-major
 | 
			
		||||
#REVDIR = gcc-arm-none-eabi-9-2020-q2-update
 | 
			
		||||
 REVDIR = gcc-arm-none-eabi-10-2020-q4-major
 | 
			
		||||
else
 | 
			
		||||
 DRIVE = d
 | 
			
		||||
ifeq (cygwin, $(findstring cygwin, $(MAKE_HOST)))
 | 
			
		||||
 DRIVE = /cygdrive/d
 | 
			
		||||
 OSDRIVE = /cygdrive/$(DRIVE)
 | 
			
		||||
else ifeq (msys, $(findstring msys, $(MAKE_HOST)))
 | 
			
		||||
 DRIVE = /d
 | 
			
		||||
 OSDRIVE = /$(DRIVE)
 | 
			
		||||
else
 | 
			
		||||
 DRIVE = D:
 | 
			
		||||
 OSDRIVE = $(DRIVE):
 | 
			
		||||
endif
 | 
			
		||||
 INSTALLDIR = $(DRIVE)/Program Files (x86)
 | 
			
		||||
#GCCDIR = $(INSTALLDIR)/GNU Tools ARM Embedded/9 2019-q4-major
 | 
			
		||||
#GCCDIR = $(INSTALLDIR)/GNU Arm Embedded Toolchain/9 2020-q2-update
 | 
			
		||||
 GCCDIR = $(INSTALLDIR)/GNU Arm Embedded Toolchain/10 2020-q4-major
 | 
			
		||||
 INSTALLDIR = $(OSDRIVE)/Program Files (x86)
 | 
			
		||||
#REVDIR = GNU Tools ARM Embedded/5.4 2016q2
 | 
			
		||||
#REVDIR = GNU Tools ARM Embedded/6 2017-q2-update
 | 
			
		||||
#REVDIR = GNU Tools ARM Embedded/7 2017-q4-major
 | 
			
		||||
#REVDIR = GNU Tools ARM Embedded/7 2018-q2-update
 | 
			
		||||
#REVDIR = GNU Tools ARM Embedded/9 2019-q4-major
 | 
			
		||||
#REVDIR = GNU Arm Embedded Toolchain/9 2020-q2-update
 | 
			
		||||
 REVDIR = GNU Arm Embedded Toolchain/10 2020-q4-major
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
GCCDIR = $(INSTALLDIR)/$(REVDIR)
 | 
			
		||||
export PATH := $(GCCDIR)/bin:$(PATH)
 | 
			
		||||
 | 
			
		||||
BINPFX  = @arm-none-eabi-
 | 
			
		||||
@@ -62,10 +68,14 @@ LIBS = -l$(LIBSTEM)
 | 
			
		||||
 | 
			
		||||
### Build rules
 | 
			
		||||
 | 
			
		||||
.PHONY: clean all
 | 
			
		||||
.PHONY: clean all version
 | 
			
		||||
 | 
			
		||||
all: $(PROJECT).hex $(PROJECT).bin
 | 
			
		||||
 | 
			
		||||
version:
 | 
			
		||||
	@echo make $(MAKE_VERSION) $(MAKE_HOST)
 | 
			
		||||
	@echo PATH="$(PATH)"
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	@echo CLEAN
 | 
			
		||||
	@rm -f *.o *.elf *.map *.lst *.bin *.hex *.a
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
/* putchar.c -- write a character to stdout */
 | 
			
		||||
/* Copyright (c) 2020 Renaud Fivet          */
 | 
			
		||||
/* Copyright (c) 2020-2021 Renaud Fivet     */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include "system.h" /* kputc() */
 | 
			
		||||
 | 
			
		||||
int putchar( int c) {
 | 
			
		||||
int (putchar)( int c) { /* putchar may be defined as macro in stdio.h */
 | 
			
		||||
    kputc( c) ;
 | 
			
		||||
    return c ;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user