Automatically update the copyright year

This commit is contained in:
Lior Halphon 2022-08-14 19:10:00 +03:00
parent 6ecc2f15b5
commit 2c7343a6ad
6 changed files with 11 additions and 10 deletions

View File

@ -130,7 +130,7 @@
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015-2022 Lior Halphon</string>
<string>Copyright © 2015-@COPYRIGHT_YEAR Lior Halphon</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>

View File

@ -30,7 +30,7 @@
<h1>SameBoy</h1>
<h2>MIT License</h2>
<h3>Copyright © 2015-2022 Lior Halphon</h3>
<h3>Copyright © 2015-@COPYRIGHT_YEAR Lior Halphon</h3>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -48,6 +48,7 @@ MAKECMDGOALS := $(DEFAULT)
endif
include version.mk
COPYRIGHT_YEAR := $(shell grep -oE "20[2-9][0-9]" LICENSE)
export VERSION
CONF ?= debug
@ -126,7 +127,7 @@ endif
CFLAGS += $(WARNINGS)
CFLAGS += -std=gnu11 -D_GNU_SOURCE -DGB_VERSION='"$(VERSION)"' -I. -D_USE_MATH_DEFINES
CFLAGS += -std=gnu11 -D_GNU_SOURCE -DGB_VERSION='"$(VERSION)"' -DGB_COPYRIGHT_YEAR='"$(COPYRIGHT_YEAR)"' -I. -D_USE_MATH_DEFINES
ifneq (,$(UPDATE_SUPPORT))
CFLAGS += -DUPDATE_SUPPORT
endif
@ -330,8 +331,8 @@ $(BIN)/SameBoy.app: $(BIN)/SameBoy.app/Contents/MacOS/SameBoy \
Shaders
$(MKDIR) -p $(BIN)/SameBoy.app/Contents/Resources
cp Cocoa/*.icns Cocoa/*.png Misc/registers.sym $(BIN)/SameBoy.app/Contents/Resources/
sed s/@VERSION/$(VERSION)/ < Cocoa/Info.plist > $(BIN)/SameBoy.app/Contents/Info.plist
cp Cocoa/License.html $(BIN)/SameBoy.app/Contents/Resources/Credits.html
sed "s/@VERSION/$(VERSION)/;s/@COPYRIGHT_YEAR/$(COPYRIGHT_YEAR)/" < Cocoa/Info.plist > $(BIN)/SameBoy.app/Contents/Info.plist
sed "s/@COPYRIGHT_YEAR/$(COPYRIGHT_YEAR)/" < Cocoa/License.html > $(BIN)/SameBoy.app/Contents/Resources/Credits.html
$(MKDIR) -p $(BIN)/SameBoy.app/Contents/Resources/Shaders
cp Shaders/*.fsh Shaders/*.metal $(BIN)/SameBoy.app/Contents/Resources/Shaders
$(MKDIR) -p $(BIN)/SameBoy.app/Contents/Library/QuickLook/
@ -358,7 +359,7 @@ $(BIN)/SameBoy.qlgenerator: $(BIN)/SameBoy.qlgenerator/Contents/MacOS/SameBoyQL
$(BIN)/SameBoy.qlgenerator/Contents/Resources/cgb_boot_fast.bin
$(MKDIR) -p $(BIN)/SameBoy.qlgenerator/Contents/Resources
cp QuickLook/*.png $(BIN)/SameBoy.qlgenerator/Contents/Resources/
sed s/@VERSION/$(VERSION)/ < QuickLook/Info.plist > $(BIN)/SameBoy.qlgenerator/Contents/Info.plist
sed "s/@VERSION/$(VERSION)/;s/@COPYRIGHT_YEAR/$(COPYRIGHT_YEAR)/" < QuickLook/Info.plist > $(BIN)/SameBoy.qlgenerator/Contents/Info.plist
ifeq ($(CONF), release)
$(CODESIGN) $@
endif
@ -401,11 +402,11 @@ $(BIN)/SDL/sameboy_debugger.exe: $(CORE_OBJECTS) $(SDL_OBJECTS) $(OBJ)/Windows/r
ifneq ($(USE_WINDRES),)
$(OBJ)/%.o: %.rc
-@$(MKDIR) -p $(dir $@)
windres --preprocessor cpp -DVERSION=\"$(VERSION)\" $^ $@
windres --preprocessor cpp -DVERSION=\"$(VERSION)\" -DCOPYRIGHT_YEAR=\"$(COPYRIGHT_YEAR)\" $^ $@
else
$(OBJ)/%.res: %.rc
-@$(MKDIR) -p $(dir $@)
rc /fo $@ /dVERSION=\"$(VERSION)\" $^
rc /fo $@ /dVERSION=\"$(VERSION)\" /dCOPYRIGHT_YEAR=\"$(COPYRIGHT_YEAR)\" $^
%.o: %.res
cvtres /OUT:"$@" $^

View File

@ -48,7 +48,7 @@
<key>CFPlugInUnloadFunction</key>
<string></string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015-2022 Lior Halphon</string>
<string>Copyright © 2015-@COPYRIGHT_YEAR Lior Halphon</string>
<key>QLNeedsToBeRunInMainThread</key>
<false/>
<key>QLPreviewHeight</key>

View File

@ -95,7 +95,7 @@ static const char *help[] = {
"\n"
"SameBoy\n"
"Version " GB_VERSION "\n\n"
"Copyright " COPYRIGHT_STRING " 2015-2022\n"
"Copyright " COPYRIGHT_STRING " 2015-" GB_COPYRIGHT_YEAR "\n"
"Lior Halphon\n\n"
"Licensed under the MIT\n"
"license, see LICENSE for\n"

Binary file not shown.