More makefile simplification and formatting in version.h.in

This commit is contained in:
Jasmine Iwanek
2023-02-03 00:49:32 -05:00
parent 186b63b845
commit ffbf1d63c3
2 changed files with 50 additions and 59 deletions

View File

@@ -1,58 +1,60 @@
/* /*
* 86Box A hypervisor and IBM PC system emulator that specializes in * 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM * running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent * PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus. * system designs based on the PCI bus.
* *
* This file is part of the 86Box distribution. * This file is part of the 86Box distribution.
* *
* Definitions for project version, branding, and external links. * Definitions for project version, branding, and external links.
* *
* Authors: Miran Grca, <mgrca8@gmail.com>
* *
* Copyright 2020 Miran Grca. *
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2020 Miran Grca.
*/ */
#define _LSTR(s) L ## s #define _LSTR(s) L ## s
#define LSTR(s) _LSTR(s) #define LSTR(s) _LSTR(s)
/* Version info. */ /* Version info. */
#define EMU_NAME "@CMAKE_PROJECT_NAME@" #define EMU_NAME "@CMAKE_PROJECT_NAME@"
#define EMU_NAME_W LSTR(EMU_NAME) #define EMU_NAME_W LSTR(EMU_NAME)
#define EMU_VERSION "@CMAKE_PROJECT_VERSION@" #define EMU_VERSION "@CMAKE_PROJECT_VERSION@"
#define EMU_VERSION_W LSTR(EMU_VERSION) #define EMU_VERSION_W LSTR(EMU_VERSION)
#define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */ #define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */
#define EMU_VERSION_MAJ @CMAKE_PROJECT_VERSION_MAJOR@ #define EMU_VERSION_MAJ @CMAKE_PROJECT_VERSION_MAJOR@
#define EMU_VERSION_MIN @CMAKE_PROJECT_VERSION_MINOR@ #define EMU_VERSION_MIN @CMAKE_PROJECT_VERSION_MINOR@
#define EMU_VERSION_PATCH @CMAKE_PROJECT_VERSION_PATCH@ #define EMU_VERSION_PATCH @CMAKE_PROJECT_VERSION_PATCH@
#cmakedefine EMU_BUILD "@EMU_BUILD@" #cmakedefine EMU_BUILD "@EMU_BUILD@"
#define EMU_BUILD_NUM @EMU_BUILD_NUM@ #define EMU_BUILD_NUM @EMU_BUILD_NUM@
#cmakedefine EMU_GIT_HASH "@EMU_GIT_HASH@" #cmakedefine EMU_GIT_HASH "@EMU_GIT_HASH@"
#ifdef EMU_BUILD #ifdef EMU_BUILD
# define EMU_BUILD_W LSTR(EMU_BUILD) # define EMU_BUILD_W LSTR(EMU_BUILD)
# define EMU_VERSION_FULL EMU_VERSION " [" EMU_BUILD "]" # define EMU_VERSION_FULL EMU_VERSION " [" EMU_BUILD "]"
# define EMU_VERSION_FULL_W EMU_VERSION_W L" [" EMU_BUILD_W L"]" # define EMU_VERSION_FULL_W EMU_VERSION_W L" [" EMU_BUILD_W L"]"
#else #else
# define EMU_VERSION_FULL EMU_VERSION # define EMU_VERSION_FULL EMU_VERSION
# define EMU_VERSION_FULL_W EMU_VERSION_W # define EMU_VERSION_FULL_W EMU_VERSION_W
#endif #endif
#ifdef EMU_GIT_HASH #ifdef EMU_GIT_HASH
# define EMU_GIT_HASH_W LSTR(EMU_GIT_HASH) # define EMU_GIT_HASH_W LSTR(EMU_GIT_HASH)
#endif #endif
#define COPYRIGHT_YEAR "@EMU_COPYRIGHT_YEAR@" #define COPYRIGHT_YEAR "@EMU_COPYRIGHT_YEAR@"
/* Web URL info. */ /* Web URL info. */
#define EMU_SITE "86box.net" #define EMU_SITE "86box.net"
#define EMU_SITE_W LSTR(EMU_SITE) #define EMU_SITE_W LSTR(EMU_SITE)
#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest" #define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest"
#define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL) #define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL)
#ifdef RELEASE_BUILD #ifdef RELEASE_BUILD
# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@/" # define EMU_DOCS_URL "https://86box.readthedocs.io/en/v@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@/"
#else #else
# define EMU_DOCS_URL "https://86box.readthedocs.io" # define EMU_DOCS_URL "https://86box.readthedocs.io"
#endif #endif
#define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL) #define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL)

View File

@@ -240,44 +240,33 @@ VPATH := $(EXPATH) . $(CODEGEN) minitrace cpu \
sound/munt/srchelper sound/munt/srchelper/srctools/src \ sound/munt/srchelper sound/munt/srchelper/srctools/src \
sound/resid-fp sound/ymfm \ sound/resid-fp sound/ymfm \
scsi video network network/slirp win scsi video network network/slirp win
WINDRES := windres
STRIP := strip
ifeq ($(X64), y) ifeq ($(X64), y)
TOOL_PREFIX := x86_64-w64-mingw32- TOOL_PREFIX := x86_64-w64-mingw32-
else else
TOOL_PREFIX := i686-w64-mingw32-
endif
WINDRES := windres
STRIP := strip
ifeq ($(ARM64), y)
WINDRES := aarch64-w64-mingw32-windres
STRIP := aarch64-w64-mingw32-strip
endif
ifeq ($(ARM), y)
WINDRES := armv7-w64-mingw32-windres
STRIP := armv7-w64-mingw32-strip
endif
ifeq ($(CLANG), y)
CPP := clang++
CC := clang
ifeq ($(ARM64), y) ifeq ($(ARM64), y)
CPP := aarch64-w64-mingw32-clang++ TOOL_PREFIX := aarch64-w64-mingw32-
CC := aarch64-w64-mingw32-clang WINDRES := ${TOOL_PREFIX}windres
STRIP := ${TOOL_PREFIX}strip
endif endif
ifeq ($(ARM), y) ifeq ($(ARM), y)
CPP := armv7-w64-mingw32-clang++ TOOL_PREFIX := armv7-w64-mingw32-
CC := armv7-w64-mingw32-clang WINDRES := ${TOOL_PREFIX}windres
STRIP := ${TOOL_PREFIX}strip
endif endif
TOOL_PREFIX := i686-w64-mingw32-
endif
ifeq ($(CLANG), y)
CPP := ${TOOL_PREFIX}clang++
CC := ${TOOL_PREFIX}clang
else else
CPP := ${TOOL_PREFIX}g++ CPP := ${TOOL_PREFIX}g++
CC := ${TOOL_PREFIX}gcc CC := ${TOOL_PREFIX}gcc
ifeq ($(ARM64), y)
CPP := aarch64-w64-mingw32-g++
CC := aarch64-w64-mingw32-gcc
endif
ifeq ($(ARM), y)
CPP := armv7-w64-mingw32-g++
CC := armv7-w64-mingw32-gcc
endif
endif endif
DEPS = -MMD -MF $*.d -c $< DEPS = -MMD -MF $*.d -c $<
DEPFILE := win/.depends DEPFILE := win/.depends