Skip to content

Commit 5043b61

Browse files
committed
Change: [Makefile] Update to something like make-nml 0.4.3
1 parent 0b8b24c commit 5043b61

9 files changed

+600
-115
lines changed

Makefile

+569-62
Large diffs are not rendered by default.

Makefile.config

+24-47
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,37 @@
11
# This file defines the principal settings for this project
22

3-
REPO_NAME := OpenGFX
3+
# Definition of the grfs
4+
REPO_NAME ?= OpenGFX
45
REPO_SHORTNAME := OGFX
56
REPO_PALETTE = DOS
67
REPO_BLITTER = 8bpp
78
REPO_ORIGIN = default = Please redownload from official source.
89

9-
USE_NML := 1
10-
USE_OBG := 1
10+
BUNDLE_FILES ?= $(GRF_FILES) $(DOC_FILES) opengfx.obg
1111

12-
MAIN_FILENAME_TYPE := base arctic tropical logos toyland extra
12+
# This is the filename part common to the grf file, main source file and the tar name
13+
BASE_FILENAME ?= ogfx1_base ogfxc_arctic ogfxh_tropical ogfxt_toyland ogfxi_logos ogfxe_extra
14+
PROJECT_FILENAME ?= opengfx
1315

14-
TARGET_FILES = opengfx.obg ogfx1_base.grf ogfxc_arctic.grf ogfxh_tropical.grf ogfxi_logos.grf ogfxt_toyland.grf ogfxe_extra.grf
16+
# Documentation files
17+
DOC_FILES ?= docs/readme.txt docs/license.txt docs/changelog.txt
18+
19+
# Possible offset to NewGRF version. Increase by one, if a release
20+
# branch is added to the repository
21+
REPO_BRANCH_VERSION ?= 0
22+
23+
# Directory structure
24+
SCRIPT_DIR ?= scripts
25+
DESC_FILENAME_SRC := docs/descriptions.ptxt
26+
27+
# Uncomment in order to make use of gimp scripting. See the file
28+
# for a description of the format
29+
GFX_SCRIPT_LIST_FILES := sprites/png/terrain/waterfeatures/waterfeatures.xcf2png sprites/png/infrastructure/locks.xcf2png sprites/png/terrain/terrain.xcf2png sprites/png/trees/trees.xcf2png sprites/png/industries/coalmine.xcf2png sprites/png/industries/goldmine/goldmine.xcf2png sprites/png/industries/oilwell/oilwell.xcf2png
30+
31+
# If needed, declare the minimum NML requirements
32+
# REQUIRED_NML_BRANCH = 0.3
33+
# MIN_NML_REVISION = 0
1534

1635
# OpenTTD GUI sprites were added in NML r2049. We need 0.3 branch.
1736
NML_MIN_VERSION := 030
1837
NML_MIN_REVISION := 2049
19-
20-
GRAPHICS_SOURCE_LIST_FILES := $(shell cat sprites/graphics_source_lists)
21-
22-
# comment out those dirs which are not in use
23-
SRC_DIR := sprites
24-
DOC_DIR := docs
25-
SCRIPT_DIR := scripts
26-
# Add any dirs which shall be bundled in a source release additionally
27-
# to the dirs mentioned above.
28-
EXTRA_DIRS :=
29-
30-
# Documentation files:
31-
DOC_FILES = docs/readme.txt docs/license.txt docs/changelog.txt
32-
DESC_FILENAME_SRC := $(DOC_DIR)/descriptions.ptxt
33-
34-
# file extentions which indicate plain text source files,
35-
# parsable by a text editor
36-
FILE_SRC_EXTENSIONS = pnml
37-
38-
# file extensions which indicate binary source files
39-
FILE_INC_EXTENSIONS = png
40-
41-
# Replacement strings in the source and in the documentation
42-
# You may only change the values, not add new definitions
43-
# (unless you know where to add them in other places, too)
44-
REPO_TITLE_DUMMY := {{REPO_TITLE}}
45-
GRF_ID_DUMMY := {{GRF_ID}}
46-
REPO_REVISION_DUMMY := {{REPO_REVISION}}
47-
OUTPUT_FILENAME_DUMMY := {{FILENAME}}
48-
49-
# List of all files which will get shipped
50-
# DOC_FILES = readme, changelog and license
51-
# GRF_FILENAME = MAIN_FILENAME_SRC with the extention .grf
52-
# Add any additional, not usual files here, too, including
53-
# their relative path to the root of the repository
54-
# GRF_FILES = $(addsuffix .grf,$(basename $(MAIN_FILENAME_SRC)))
55-
BUNDLE_FILES = $(TARGET_FILES) $(DOC_FILES)
56-
57-
OUTPUT_FILENAME := $(MAIN_TARGET)
58-
59-
# Files which also need cleaning:
60-
CLEAN_ADD := docs/readme.txt

scripts/Makefile.in Makefile.in

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
%.obg: $(GRF_FILES) $(DESC_FILENAME) $(REV_FILENAME)
2+
%.obg: $(GRF_FILES) $(DESC_FILENAME_SRC)
33
$(_E) "[ASSEMBLING] $@"
44
@echo "[metadata]" > $@
55
@echo "name = $(REPO_NAME)" >> $@
66
@echo "shortname = $(REPO_SHORTNAME)" >> $@
7-
@echo "version = $(REPO_REVISION)" >> $@
7+
@echo "version = $(NEWGRF_VERSION)" >> $@
88
@echo "palette = $(REPO_PALETTE)" >> $@
99
@echo "blitter = $(REPO_BLITTER)" >> $@
1010
$(_V) cat $(DESC_FILENAME_SRC) | sed 's/$$/ [$(REPO_TITLE)]/' >> $@
@@ -21,14 +21,10 @@
2121
@echo "[origin]" >> $@
2222
@echo "$(REPO_ORIGIN)" >> $@
2323

24-
maintainer-clean::
25-
$(_V)-rm -rf $(shell cat $(GRAPHICS_SOURCE_LIST_FILES) | grep "\([pP][cCnN][xXgG]\)" | cut -d\ -f1)
26-
2724
test::
2825
$(_E) "Graphics source list: $(GRAPHICS_SOURCE_LIST_FILES)"
2926

3027

31-
3228
%.tags.txt:
3329
$(_E) "[LANG] $@"
3430
$(_V) echo "TITLE :OpenGFX" > $@
@@ -39,3 +35,8 @@ ogfxe_extra.tags.txt: $(REV_FILENAME)
3935
$(_V) echo "TITLE :$(REPO_TITLE)" >> $@
4036
$(_V) echo "FILENAME :$(TARGET_FILES)" >> $@
4137

38+
clean::
39+
$(_E) "[CLEAN] obg"
40+
$(_V) -rm opengfx.obg
41+
$(_V) -rm *.tags.txt
42+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)