Skip to content

Commit d884385

Browse files
authored
Fix: [Makefile] make sure that filenames in the tarball are as OpenTTD expects (#24)
It looks for readme.txt, license.txt and changelog.txt by name. So no matter how we call it in the repository, make sure it matches with the expectation in the tarball.
1 parent 93becb9 commit d884385

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Makefile.vcs
66
Makefile.gfx
77
.version
88
custom_tags.txt
9-
docs/readme.txt
109
.nmlcache
1110

1211
*.scm

Makefile

+9-7
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ DOC_FILES ?= $(LICENSE_FILE) $(CHANGELOG_FILE) $(README_FILE)
3737
LNG_FILES ?= lang/*.lng
3838
GFX_FILES ?=
3939

40-
# List of all files which will get shipped
41-
# documentation files: readme, changelog and license, usually $(DOC_FILES)
42-
# grf file: the above defined grf file, usualls $(GRF_FILES)
43-
# Add any additional, not usual files here, too, including
44-
# their relative path to the root of the repository
45-
BUNDLE_FILES ?= $(GRF_FILES) $(DOC_FILES) $(OBG_FILENAME)
40+
# List of all files which will get shipped, minus documentation files.
41+
# Documentation files often are generated from other files.
42+
BUNDLE_FILES ?= $(GRF_FILES) $(OBG_FILENAME)
4643
BANANAS_INI ?= bananas.ini
4744

4845
# Replacement strings in the source and in the documentation
@@ -429,11 +426,16 @@ TAR_FILENAME := $(DIR_NAME).tar
429426
bundle: $(DIR_NAME)
430427
bundle_tar: $(TAR_FILENAME)
431428

432-
$(DIR_NAME): $(GFX_FILES) $(BUNDLE_FILES)
429+
$(DIR_NAME): $(GFX_FILES) $(BUNDLE_FILES) $(DOC_FILES)
433430
$(_E) "[BUNDLE] $@"
434431
$(_V) if [ -e $@ ]; then rm -rf $@; fi
435432
$(_V) mkdir $@
436433
$(_V) cp $(CP_FLAGS) $(BUNDLE_FILES) $@
434+
# OpenTTD is very picky about how these next few files are are named, so make
435+
# sure they have the correct name inside the tarball.
436+
$(_V) cp $(CP_FLAGS) $(LICENSE_FILE) $@/license.txt
437+
$(_V) cp $(CP_FLAGS) $(CHANGELOG_FILE) $@/changelog.txt
438+
$(_V) cp $(CP_FLAGS) $(README_FILE) $@/readme.txt
437439

438440
$(TAR_FILENAME): $(DIR_NAME)
439441
$(_E) "[BUNDLE TAR] $@"

0 commit comments

Comments
 (0)