mirror of
https://github.com/libretro/RetroArch.git
synced 2024-06-22 22:32:46 -04:00
Log Git version in verbose logs.
Makes it much easier to figure out which builds users are running when pasting logs.
This commit is contained in:
parent
2c60dfb8cf
commit
252efff8da
34
Makefile
34
Makefile
|
@ -58,7 +58,7 @@ RETROLAUNCH_OBJ = tools/retrolaunch/main.o \
|
||||||
HEADERS = $(wildcard */*.h) $(wildcard *.h)
|
HEADERS = $(wildcard */*.h) $(wildcard *.h)
|
||||||
|
|
||||||
ifeq ($(findstring Haiku,$(OS)),)
|
ifeq ($(findstring Haiku,$(OS)),)
|
||||||
LIBS = -lm
|
LIBS = -lm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DEFINES = -DHAVE_CONFIG_H -DHAVE_SCREENSHOTS -DRARCH_INTERNAL
|
DEFINES = -DHAVE_CONFIG_H -DHAVE_SCREENSHOTS -DRARCH_INTERNAL
|
||||||
|
@ -92,7 +92,7 @@ endif
|
||||||
|
|
||||||
ifeq ($(HAVE_RGUI), 1)
|
ifeq ($(HAVE_RGUI), 1)
|
||||||
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o file_list.o frontend/menu/disp/rgui.o frontend/menu/history.o
|
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o file_list.o frontend/menu/disp/rgui.o frontend/menu/history.o
|
||||||
DEFINES += -DHAVE_MENU
|
DEFINES += -DHAVE_MENU
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_THREADS), 1)
|
ifeq ($(HAVE_THREADS), 1)
|
||||||
|
@ -158,8 +158,8 @@ ifeq ($(HAVE_AL), 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_V4L2),1)
|
ifeq ($(HAVE_V4L2),1)
|
||||||
OBJ += camera/video4linux2.o
|
OBJ += camera/video4linux2.o
|
||||||
DEFINES += -DHAVE_CAMERA -DHAVE_V4L2
|
DEFINES += -DHAVE_CAMERA -DHAVE_V4L2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_JACK),1)
|
ifeq ($(HAVE_JACK),1)
|
||||||
|
@ -196,7 +196,7 @@ ifeq ($(HAVE_SDL), 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_OMAP), 1)
|
ifeq ($(HAVE_OMAP), 1)
|
||||||
OBJ += gfx/omap_gfx.o
|
OBJ += gfx/omap_gfx.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_OPENGL), 1)
|
ifeq ($(HAVE_OPENGL), 1)
|
||||||
|
@ -343,8 +343,8 @@ endif
|
||||||
|
|
||||||
ifeq ($(HAVE_NEON),1)
|
ifeq ($(HAVE_NEON),1)
|
||||||
OBJ += audio/sinc_neon.o
|
OBJ += audio/sinc_neon.o
|
||||||
# When compiled without this, tries to attempt to compile sinc lerp,
|
# When compiled without this, tries to attempt to compile sinc lerp,
|
||||||
# which will error out
|
# which will error out
|
||||||
DEFINES += -DSINC_LOWER_QUALITY -DHAVE_NEON
|
DEFINES += -DSINC_LOWER_QUALITY -DHAVE_NEON
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -389,6 +389,12 @@ ifeq ($(NOUNUSED_VARIABLE), yes)
|
||||||
CFLAGS += -Wno-unused-variable
|
CFLAGS += -Wno-unused-variable
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
GIT_VERSION := $(shell git rev-parse --short HEAD)
|
||||||
|
ifneq ($(GIT_VERSION),)
|
||||||
|
DEFINES += -DHAVE_GIT_VERSION -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||||
|
OBJ += git_version.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
all: $(TARGET) config.mk
|
all: $(TARGET) config.mk
|
||||||
|
|
||||||
|
@ -416,19 +422,25 @@ tools/retrolaunch/retrolaunch: $(RETROLAUNCH_OBJ)
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||||
|
|
||||||
tools/linuxraw_joypad.o: input/linuxraw_joypad.c
|
.FORCE:
|
||||||
|
|
||||||
|
git_version.o: git_version.c .FORCE
|
||||||
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||||
|
|
||||||
|
tools/linuxraw_joypad.o: input/linuxraw_joypad.c $(HEADERS)
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
tools/udev_joypad.o: input/udev_joypad.c
|
tools/udev_joypad.o: input/udev_joypad.c $(HEADERS)
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
tools/input_common_launch.o: input/input_common.c
|
tools/input_common_launch.o: input/input_common.c $(HEADERS)
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_RETROLAUNCH -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_RETROLAUNCH -c -o $@ $<
|
||||||
|
|
||||||
tools/input_common_joyconfig.o: input/input_common.c
|
tools/input_common_joyconfig.o: input/input_common.c $(HEADERS)
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
|
|
22
Makefile.win
22
Makefile.win
|
@ -51,6 +51,8 @@ JOBJ := conf/config_file.o \
|
||||||
input/dinput.o \
|
input/dinput.o \
|
||||||
input/winxinput_joypad.o
|
input/winxinput_joypad.o
|
||||||
|
|
||||||
|
HEADERS = $(wildcard */*.h) $(wildcard *.h)
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
WINDRES = windres
|
WINDRES = windres
|
||||||
|
@ -264,25 +266,37 @@ else
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
GIT_VERSION := $(shell git rev-parse --short HEAD)
|
||||||
|
ifneq ($(GIT_VERSION),)
|
||||||
|
DEFINES += -DHAVE_GIT_VERSION -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||||
|
OBJ += git_version.o
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(TARGET) $(JTARGET)
|
all: $(TARGET) $(JTARGET)
|
||||||
|
|
||||||
$(TARGET): $(OBJ)
|
$(TARGET): $(OBJ)
|
||||||
@$(if $(Q), $(shell echo echo LD $@),)
|
@$(if $(Q), $(shell echo echo LD $@),)
|
||||||
$(Q)$(CXX) -o $@ $(OBJ) $(LIBS) $(LDFLAGS) $(LDCXXFLAGS)
|
$(Q)$(CXX) -o $@ $(OBJ) $(LIBS) $(LDFLAGS) $(LDCXXFLAGS)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c $(HEADERS)
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||||
|
|
||||||
tools/input_common_joyconfig.o: input/input_common.c
|
.FORCE:
|
||||||
|
|
||||||
|
git_version.o: git_version.c .FORCE
|
||||||
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||||
|
|
||||||
|
tools/input_common_joyconfig.o: input/input_common.c $(HEADERS)
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
%.o: %.cpp
|
%.o: %.cpp $(HEADERS)
|
||||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||||
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -c -o $@ $<
|
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -c -o $@ $<
|
||||||
|
|
||||||
%.o: %.rc
|
%.o: %.rc $(HEADERS)
|
||||||
@$(if $(Q), $(shell echo echo WINDRES $<),)
|
@$(if $(Q), $(shell echo echo WINDRES $<),)
|
||||||
$(Q)$(WINDRES) -o $@ $<
|
$(Q)$(WINDRES) -o $@ $<
|
||||||
|
|
||||||
|
|
17
git_version.c
Normal file
17
git_version.c
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
/* RetroArch - A frontend for libretro.
|
||||||
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||||
|
*
|
||||||
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||||
|
* of the GNU General Public License as published by the Free Software Found-
|
||||||
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const char rarch_git_version[] = GIT_VERSION;
|
||||||
|
|
23
git_version.h
Normal file
23
git_version.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/* RetroArch - A frontend for libretro.
|
||||||
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||||
|
*
|
||||||
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||||
|
* of the GNU General Public License as published by the Free Software Found-
|
||||||
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RARCH_VERSION_H__
|
||||||
|
#define RARCH_VERSION_H__
|
||||||
|
|
||||||
|
// Put this in a separate file so we don't have to rebuilt retroarch.c every single build.
|
||||||
|
extern const char rarch_git_version[];
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
10
retroarch.c
10
retroarch.c
|
@ -38,6 +38,7 @@
|
||||||
#include "compat/posix_string.h"
|
#include "compat/posix_string.h"
|
||||||
#include "input/keyboard_line.h"
|
#include "input/keyboard_line.h"
|
||||||
#include "input/input_common.h"
|
#include "input/input_common.h"
|
||||||
|
#include "git_version.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
|
@ -751,8 +752,11 @@ static void print_compiler(FILE *file)
|
||||||
static void print_help(void)
|
static void print_help(void)
|
||||||
{
|
{
|
||||||
puts("===================================================================");
|
puts("===================================================================");
|
||||||
/* To get around error 'too many decimal points in number - expected ')' before numeric constant */
|
#ifdef HAVE_GIT_VERSION
|
||||||
|
printf("RetroArch: Frontend for libretro -- v" PACKAGE_VERSION " -- %s --\n", rarch_git_version);
|
||||||
|
#else
|
||||||
puts("RetroArch: Frontend for libretro -- v" PACKAGE_VERSION " --");
|
puts("RetroArch: Frontend for libretro -- v" PACKAGE_VERSION " --");
|
||||||
|
#endif
|
||||||
print_compiler(stdout);
|
print_compiler(stdout);
|
||||||
puts("===================================================================");
|
puts("===================================================================");
|
||||||
puts("Usage: retroarch [rom file] [options...]");
|
puts("Usage: retroarch [rom file] [options...]");
|
||||||
|
@ -2985,6 +2989,10 @@ int rarch_main_init(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
RARCH_LOG_OUTPUT("=== Build =======================================");
|
RARCH_LOG_OUTPUT("=== Build =======================================");
|
||||||
print_compiler(stderr);
|
print_compiler(stderr);
|
||||||
|
RARCH_LOG_OUTPUT("Version: %s\n", PACKAGE_VERSION);
|
||||||
|
#ifdef HAVE_GIT_VERSION
|
||||||
|
RARCH_LOG_OUTPUT("Git: %s\n", rarch_git_version);
|
||||||
|
#endif
|
||||||
RARCH_LOG_OUTPUT("=================================================\n");
|
RARCH_LOG_OUTPUT("=================================================\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue