Skip to content

Commit

Permalink
Strip lideflash/lidetool and add version strings
Browse files Browse the repository at this point in the history
  • Loading branch information
LIV2 committed Jan 7, 2025
1 parent 1304cfa commit 4329264
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ VERSION := $(shell git describe --tags --dirty | sed -r 's/^Release-//')
GIT_REF_NAME = $(shell git branch --show-current)
GIT_REF := "$(GIT_REF_NAME)-$(shell git rev-parse --short HEAD)"
BUILD_DATE := $(shell date +"%d.%m.%Y")

export BUILD_DATE
export GIT_REF

CC=m68k-amigaos-gcc
CFLAGS+=-nostartfiles -nostdlib -mcpu=68000 -Wall -Wno-multichar -Wno-pointer-sign -Wno-attributes -Wno-unused-value -s -Os -fomit-frame-pointer -DCDBOOT=1 -DNO_RDBLAST=1
CFLAGS+=-DGIT_REF=$(GIT_REF) -DBUILD_DATE=$(BUILD_DATE)
Expand All @@ -23,6 +27,10 @@ DISK=lide-update-$(VERSION).adf
DEVICE_VERSION=$(shell echo $(VERSION) | $(GREP) -oP '^(\w+-)?\K\d+')
DEVICE_REVISION=$(shell echo $(VERSION) | $(GREP) -oP '^(\w+-)?\d+\.\K\d+')
CFLAGS+=-DDEVICE_VERSION=$(DEVICE_VERSION) -DDEVICE_REVISION=$(DEVICE_REVISION)

export DEVICE_REVISION
export DEVICE_VERSION

else
DISK=lide-update.adf
endif
Expand Down Expand Up @@ -142,6 +150,7 @@ clean:
-rm -f AIDE-$(PROJECT)
make -C bootrom clean
make -C lideflash clean
make -C lidetool clean
make -C rename clean
-rm -rf *.rom
-rm -rf $(BUILDDIR)
Expand Down
7 changes: 6 additions & 1 deletion lideflash/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
PROJECT=lideflash
CC=m68k-amigaos-gcc
CFLAGS=-lamiga -mcrt=nix13 -mcpu=68000 -Wall -Wno-pointer-sign -g -O3 -fomit-frame-pointer
CFLAGS=-lamiga -mcrt=nix13 -mcpu=68000 -Wall -Wno-pointer-sign -s -O3 -fomit-frame-pointer
.PHONY: clean all

ifneq ($(DEVICE_VERSION), )
CFLAGS+=-DDEVICE_VERSION=$(DEVICE_VERSION) -DDEVICE_REVISION=$(DEVICE_REVISION)
CFLAGS+=-DGIT_REF=$(GIT_REF) -DBUILD_DATE=$(BUILD_DATE)
endif

all: $(PROJECT)

OBJ = matzetk.o \
Expand Down
2 changes: 2 additions & 0 deletions lideflash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

#define ROMSIZE 32768

const char ver[] = VERSION_STRING;

struct Library *DosBase;
struct ExecBase *SysBase;
struct ExpansionBase *ExpansionBase = NULL;
Expand Down
6 changes: 6 additions & 0 deletions lideflash/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
#ifndef MAIN_H
#define MAIN_H

#define STR(s) #s /* Turn s into a string literal without expanding macro definitions (however, \
if invoked from a macro, macro arguments are expanded). */
#define XSTR(s) STR(s) /* Turn s into a string literal after macro-expanding it. */

#define VERSION_STRING "$VER: lideflash " XSTR(DEVICE_VERSION) "." XSTR(DEVICE_REVISION) " (" XSTR(BUILD_DATE) ") " XSTR(GIT_REF)

// Bank Sel register of RIPPLE
#define BANK_SEL_REG 0x8000

Expand Down
7 changes: 6 additions & 1 deletion lidetool/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
PROJECT=lidetool
CC=m68k-amigaos-gcc
CFLAGS=-lamiga -mcrt=nix20 -mcpu=68000 -Wall -Wno-pointer-sign -g -O3 -fomit-frame-pointer
CFLAGS=-lamiga -mcrt=nix20 -mcpu=68000 -Wall -Wno-pointer-sign -s -O3 -fomit-frame-pointer
.PHONY: clean all

ifneq ($(DEVICE_VERSION), )
CFLAGS+=-DDEVICE_VERSION=$(DEVICE_VERSION) -DDEVICE_REVISION=$(DEVICE_REVISION)
CFLAGS+=-DGIT_REF=$(GIT_REF) -DBUILD_DATE=$(BUILD_DATE)
endif

all: $(PROJECT)

OBJ = config.o \
Expand Down
2 changes: 2 additions & 0 deletions lidetool/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

#define CMD_XFER 0x1001

const char ver[] = VERSION_STRING;

struct ExecBase *SysBase;
struct Config *config;

Expand Down
4 changes: 4 additions & 0 deletions lidetool/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
#ifndef MAIN_H
#define MAIN_H

#define STR(s) #s /* Turn s into a string literal without expanding macro definitions (however, \
if invoked from a macro, macro arguments are expanded). */
#define XSTR(s) STR(s) /* Turn s into a string literal after macro-expanding it. */

#define VERSION_STRING "$VER: lidetool " XSTR(DEVICE_VERSION) "." XSTR(DEVICE_REVISION) " (" XSTR(BUILD_DATE) ") " XSTR(GIT_REF)
struct __attribute__((packed)) SCSI_Inquiry {
UBYTE peripheral_type;
UBYTE removable_media;
Expand Down

0 comments on commit 4329264

Please sign in to comment.