From fc0cd57120d91d28abb262e46a2d90f1ae92817f Mon Sep 17 00:00:00 2001 From: "Leo C." Date: Sun, 28 Apr 2024 22:12:45 +0200 Subject: [PATCH] SVN --> GIT svnrev --> autorevision --- avr/Makefile | 49 +++++++++++++++++++++++++++---------------------- avr/avrcpm.asm | 1 - avr/config.inc | 6 ------ avr/init.asm | 2 +- avr/svnrev.inc | 18 ------------------ 5 files changed, 28 insertions(+), 48 deletions(-) delete mode 100644 avr/svnrev.inc diff --git a/avr/Makefile b/avr/Makefile index 30dbfa0..a91a772 100644 --- a/avr/Makefile +++ b/avr/Makefile @@ -18,11 +18,6 @@ MCU = atmega328p #MMCBOOTLOADER = 0 -# Version defined in 'config.inc'. -VMAJOR = $(call conf-val, VMAJOR, config.inc) -VMINOR = $(call conf-val, VMINOR, config.inc) - - TARGET = avrcpm ASRC0 = avrcpm.asm @@ -31,18 +26,39 @@ ASRC0 += mmc.asm mmc-old.asm virt_ports.asm ASRC0 += dsk_cpm.asm dsk_fat16.asm dsk_fsys.asm dsk_mgr.asm dsk_ram.asm ASRC0 += 8080int-orig.asm 8080int.asm 8080int-jmp.asm 8080int-t3.asm 8080int-t3-jmp.asm Z80int-jmp.asm +EXTRA_DIST := autorevision.cache + +PREFIX = $(PROG)_$(VERSION) +DIST_NAME = $(PREFIX).zip + +$(foreach X,$(subst =,:=,$(subst ",,$(filter VCS_%,\ + $(shell autorevision -q -t sh -o ./autorevision.cache)))),$(eval $X)) + +VERSION := $(shell echo "$(VCS_TAG)" | sed -e 's/^v//g') +VMAJOR := $(shell echo "$(VCS_TAG)" | sed -E 's/([^0-9]*)([0-9]+)([.])([0-9]+)([^0-9]*)/\2/') +VMINOR := $(shell echo "$(VCS_TAG)" | sed -E 's/([^0-9]*)([0-9]+)([.])([0-9]+)([^0-9]*)/\4/') + + +ifneq ($(VCS_TICK),0) + VERSION := $(VERSION)-$(VCS_TICK) +endif +ifneq ($(VCS_BRANCH),master) + VERSION := $(VERSION)-$(VCS_BRANCH) +endif +ifeq ($(VCS_WC_MODIFIED),1) + VERSION := $(VERSION)-dirty +endif + ifneq ($(DRAM_8BIT),0) ASRC0 += dram-8bit.inc dram-8bit.asm sw-uart.asm i2c.asm else ASRC0 += dram-4bit.inc dram-4bit.asm hw-uart.asm endif -ASRC = $(ASRC0) svnrev.inc -#ASRC := $(ASRC0) svnrev.inc +ASRC = $(ASRC0) # Place -D or -U options here -CDEFS = -D$(MCU) - +CDEFS = -D$(MCU) -DVERSION=\"$(VERSION)\" -DVMAJOR=$(VMAJOR) -DVMINOR=$(VMINOR) ifdef F_CPU CDEFS += -DF_CPU=$(F_CPU) endif @@ -71,8 +87,8 @@ ifdef TESTVERSION CDEFS += -DTESTVERSION=$(TESTVERSION) endif -ASPATH = C:/Programme/Atmel/AVR\ Tools/AvrAssembler2 -DEFS = $(ASPATH)/Appnotes +ASPATH := C:/Programme/Atmel/AVR\ Tools/AvrAssembler2 +DEFS := $(ASPATH)/Appnotes ifeq "$(OS)" "Windows_NT" PLATFORM=win32 @@ -88,17 +104,11 @@ endif AS = $(WINE) $(ASPATH)/avrasm2.exe ASFLAGS = -I $(DEFS) $(CDEFS) -AWK = gawk OBJCOPY = avr-objcopy CRCGEN = crcgen HEXTOBIN = $(OBJCOPY) -I ihex -O binary --gap-fill 0xff -#(call conf-val,config-id,config-file) -#conf-val = $(shell $(AWK) -vID=$(strip $1) '$$0 ~ "^[ \t]*\#define[ \t]+" ID "[ \t]+" {print $$3}' $2 ) -conf-val = $(shell $(AWK) -vID=$(strip $1) '$$1$$2 ~ "\#define"ID {print $$3}' $2) - - # Programming support using avrdude. Settings and variables. AVRDUDE_PROGRAMMER = dragon_isp @@ -107,7 +117,6 @@ AVRDUDE_PORT = usb AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep - # Uncomment the following if you want avrdude's erase cycle counter. # Note that this counter needs to be initialized first using -Yn, # see avrdude manual. @@ -176,10 +185,6 @@ $(TARGET).map: $(ASRC) tags: $(SRC) $(ASRC) ctags $(SRC) $(ASRC) -svnrev.inc: $(ASRC0) - svnrev -osvnrev.inc $^ - touch svnrev.inc - # Target: clean project. clean: $(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).obj $(TARGET).map $(TARGET).lst \ diff --git a/avr/avrcpm.asm b/avr/avrcpm.asm index 8099cb1..1e4f218 100644 --- a/avr/avrcpm.asm +++ b/avr/avrcpm.asm @@ -33,7 +33,6 @@ .include "m328Pdef.inc" #endif .include "config.inc" - .include "svnrev.inc" .include "macros.inc" #if DRAM_8BIT /* Implies software uart */ .include "dram-8bit.inc" diff --git a/avr/config.inc b/avr/config.inc index 11b7cae..392835c 100644 --- a/avr/config.inc +++ b/avr/config.inc @@ -20,12 +20,6 @@ ; ; $Id: config.inc 242 2015-12-11 16:05:52Z rapid $ - -#define VMAJOR 3 /* Version number */ -#define VMINOR 5 -#define VERS_STR "3.5" - - ;----------------------------------------------------------------------- ; ; Hardware and feature configuration diff --git a/avr/init.asm b/avr/init.asm index dcc9459..c3cfd47 100644 --- a/avr/init.asm +++ b/avr/init.asm @@ -150,7 +150,7 @@ fill_loop: rcall printstr .db '\r', '\r' version_string: - makestring "CPM on an AVR, v" VERS_STR " r" SVN_REVSTR TESTSTR + makestring "CPM on an AVR, v" VERSION TESTSTR .if MEMTEST printnewline diff --git a/avr/svnrev.inc b/avr/svnrev.inc deleted file mode 100644 index ee10318..0000000 --- a/avr/svnrev.inc +++ /dev/null @@ -1,18 +0,0 @@ -/* This file was generated by the "svnrev" utility - * (http://www.compuphase.com/svnrev.htm). - * You should not modify it manually, as it may be re-generated. - * - * $Revision: 242M$ - * $Date: 2015-12-11$ - */ - -#ifndef SVN_REV_H -#define SVN_REV_H - -#define SVN_REV 242 -#define SVN_REVSTR "242M" -#define SVN_REVDATE "2015-12-11" -#define SVN_REVSTAMP 20151211L -#define SVN_REVMODIFIED 6 - -#endif /* SVN_REV_H */ -- 2.39.2