Permalink
Browse files

Use compiler options to pass version and copyright info into source c…

…ode instead of relying on generating 'version.h'.
  • Loading branch information...
NewCreature committed Jul 24, 2018
1 parent 09b1d93 commit c51501bea47ce351fee35b1399854d758f07ce40
Showing with 7 additions and 19 deletions.
  1. +0 −1 .gitignore
  2. +1 −2 src/command_line.c
  3. +2 −2 src/makefile.android
  4. +1 −10 src/makefile.common
  5. +1 −1 src/makefile.defines
  6. +2 −3 src/ui/about_dialog.c
@@ -44,7 +44,6 @@ bin/unrar
icons/macosx_icon.icns
icons/windows_icon.ico
win32/makeicon
src/version.h
# other files
src/php/settings.php
@@ -1,7 +1,6 @@
#include "t3f/t3f.h"
#include "t3f/file_utils.h"
#include "instance.h"
#include "version.h"
static void disable_codec_handler(OMO_CODEC_HANDLER_REGISTRY * rp, const char * name)
{
@@ -109,7 +108,7 @@ bool omo_process_command_line_arguments(APP_INSTANCE * app, int argc, char * arg
}
else if(!strcmp(argv[i], "--version"))
{
printf("%s v%s %s.\n\n", APP_TITLE, APP_VERSION, APP_COPYRIGHT);
printf("%s v%s %s.\n\n", T3F_APP_TITLE, T3F_APP_VERSION, T3F_APP_COPYRIGHT);
return false;
}
}
@@ -15,11 +15,11 @@ ANDROID_NATIVE_CALL_PREFIX = $(subst .,_,$(APP_ANDROID_PACKAGE))
include makefile.common
#generate Android package, rebuilds Allegro first to update package name
android_package: update_version build_temp build_allegro build_android $(ANDROID_PLATFORM_TARGET)
android_package: build_temp build_allegro build_android $(ANDROID_PLATFORM_TARGET)
rm -rf ../temp
#generate Android package, doesn't rebuild Allegro
android_repackage: update_version clean_packages build_temp build_android $(ANDROID_PLATFORM_TARGET)
android_repackage: clean_packages build_temp build_android $(ANDROID_PLATFORM_TARGET)
rm -rf ../temp
android_sign: ../$(APP_PACKAGE_NAME)-$(ANDROID_ARCHITECTURE)-unsigned.apk
@@ -23,7 +23,7 @@ APP_PACKAGE_FILENAME = $(APP_PACKAGE_NAME)-src.tar.gz
all : $(APP_EXE_NAME) $(PLATFORM_TARGET) $(APP_EXTRA_TARGET)
@echo All targets built!
$(APP_EXE_NAME) : update_version $(PROJECT_OBJECTS) update_changelog
$(APP_EXE_NAME) : $(PROJECT_OBJECTS) update_changelog
$(CC) $(LFLAGS) $(PROJECT_OBJECTS) $(PLATFORM_LIBS) $(APP_LIBS) $(T3F_DEPEND_LIBS) $(DEPEND_LIBS) -o $(APP_EXE_NAME)
@echo Executable built!
@@ -37,15 +37,6 @@ update_changelog: ../changelog
$(SED_COMMAND) "s|BUILD_DATE|`date -u +"%a, %d %b %Y %T"`|" ../docs/changelog
$(SED_COMMAND) "s|BUILD_VERSION|$(APP_VERSION)|" ../docs/changelog
update_version: makefile.defines
@$(DEL_COMMAND) version.h
@echo $(HASH)ifndef APP_VERSION_H > version.h
@echo $(HASH)define APP_VERSION_H >> version.h
@echo $(HASH)define APP_TITLE $(QUOTE)$(APP_TITLE)$(QUOTE) >> version.h
@echo $(HASH)define APP_VERSION $(QUOTE)$(APP_VERSION)$(QUOTE) >> version.h
@echo $(HASH)define APP_COPYRIGHT $(QUOTE)$(APP_COPYRIGHT)$(QUOTE) >> version.h
@echo $(HASH)endif >> version.h
clean: app_clean
@$(PLATFORM_CLEAN)
@$(DEL_COMMAND) $(subst /,$(PATH_SEPARATOR),$(PROJECT_OBJECTS))
@@ -31,7 +31,7 @@ app_clean:
################
# global stuff #
################
GLOBAL_CFLAGS = -O2 -fomit-frame-pointer -funroll-loops -Wall -I. -DT3F_DEVELOPER_NAME="\"$(APP_COMPANY)\"" -DT3F_PACKAGE_NAME="\"$(APP_NAME)\"" -DT3F_APP_VERSION="\"$(APP_VERSION)\"" -DT3F_APP_TITLE=\"$(APP_TITLE)\" -Icodec_handlers/midia5/MIDIA5
GLOBAL_CFLAGS = -O2 -fomit-frame-pointer -funroll-loops -Wall -I. -DT3F_DEVELOPER_NAME="\"$(APP_COMPANY)\"" -DT3F_PACKAGE_NAME="\"$(APP_NAME)\"" -DT3F_APP_VERSION="\"$(APP_VERSION)\"" -DT3F_APP_TITLE=\"$(APP_TITLE)\" -DT3F_APP_COPYRIGHT=\"$(APP_COPYRIGHT)\" -Icodec_handlers/midia5/MIDIA5
##################
# Mac OS X stuff #
@@ -6,16 +6,15 @@
#include "../cloud.h"
#include "dialog_proc.h"
#include "menu_proc.h"
#include "../version.h"
bool omo_open_about_dialog(OMO_UI * uip, void * data)
{
ALLEGRO_FONT * font;
const char * val;
int x, y;
int font_height;
char * text_line_1 = APP_TITLE " v" APP_VERSION;
char * text_line_2 = APP_COPYRIGHT ".";
char * text_line_1 = T3F_APP_TITLE " v" T3F_APP_VERSION;
char * text_line_2 = T3F_APP_COPYRIGHT ".";
font_height = al_get_font_line_height(uip->main_theme->gui_theme[OMO_THEME_GUI_THEME_LIST_BOX]->state[0].font[0]);

0 comments on commit c51501b

Please sign in to comment.