Skip to content

Commit

Permalink
Merge pull request #15 from andymccall/issue-6
Browse files Browse the repository at this point in the history
chore(issue-6): add link to github repository to version information
  • Loading branch information
andymccall authored Sep 11, 2024
2 parents f75df35 + 5d71b39 commit 4877cee
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARMHF_PROJECT_NAME = ez80op_linux_armhf
ARM64_PROJECT_NAME = ez80op_linux_aarch64
Z80_PROJECT_NAME = ez80op_agon_z80
GIT_INFO := "$(shell git describe --always --tags)"
BUILD_YEAR := $(shell date +'%Y')

# Architecture-Specific Compilers and Flags
X86_CC = gcc
Expand Down
31 changes: 31 additions & 0 deletions src/constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
/ Title: ez80op
/
/ Description: opcode typdef implementation
/
/ Author: Andy McCall, [email protected]
/
/ Created: Fri 30 Aug 15:37:58 BST 2024
/ Last Updated:
/
/ Modinfo:
*/

#ifndef _CONSTANTS_H_
#define _CONSTANTS_H_

#define PROGRAM_NAME "ez80op"

#define GIT_REPOSITORY "https://github.com/andymccall/ez80op"

#ifndef GIT_INFO
#define GIT_INFO "unknown"
#endif

#ifndef BUILD_YEAR
#define BUILD_YEAR "2024"
#endif

#define AUTHOR "Andy McCall"

#endif /* !_CONSTANTS_H_ */
8 changes: 3 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
#include "config.h"
#include "opcode.h"
#include "data.h"

#ifndef GIT_INFO
#define GIT_INFO "unknown"
#endif
#include "constants.h"

void printVersion(void) {
printf("ez80op version %d.%d-%s, (C)2024 - Andy McCall\r\n",VERSION,REVISION,GIT_INFO);
printf("%s version %d.%d-%s, (C)%s - %s\r\n",PROGRAM_NAME,VERSION,REVISION,GIT_INFO,BUILD_YEAR,AUTHOR);
printf("%s\r\n",GIT_REPOSITORY);
}

void printHelp(void) {
Expand Down

0 comments on commit 4877cee

Please sign in to comment.