]> cloudbase.mooo.com Git - avrcpm.git/commitdiff
SVN --> GIT master
authorLeo C. <erbl259-lmu@yahoo.de>
Sun, 28 Apr 2024 20:12:45 +0000 (22:12 +0200)
committerLeo C. <erbl259-lmu@yahoo.de>
Sun, 28 Apr 2024 20:12:45 +0000 (22:12 +0200)
svnrev --> autorevision

avr/Makefile
avr/avrcpm.asm
avr/config.inc
avr/init.asm
avr/svnrev.inc [deleted file]

index 30dbfa0c85f4b0c6e9e82160591ca66f834bb585..a91a77237bd7569eb498346822c2eb5b707374d3 100644 (file)
@@ -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 \
index 8099cb1525206aeb80fea7aca4d78eaf4efdfdfc..1e4f218dfc31dfecafc2b7d3e1249daf8aafcd77 100644 (file)
@@ -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"
index 11b7caeaf3086d0b35352c627e732d3b795d4235..392835cc450f1ee297dc8e7e2e935a441f58abcc 100644 (file)
 ;
 ;    $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
index dcc945992e0a75553d25c80689a89832bf49d547..c3cfd47e5600530c6ecfae12f1080dcf00256796 100644 (file)
@@ -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 (file)
index ee10318..0000000
+++ /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 */