-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile.in
55 lines (46 loc) · 1.68 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Here also go all build targets specific to this very newgrf
%.sfo: %.psfo
$(_V) cat $< \
| sed -e "s/$(REPLACE_TITLE)/$(REPO_TITLE)/" \
| sed -e "s/$(REPLACE_GRFID)/$(GRF_ID)/" \
| sed -e "s/$(REPLACE_REVISION)/$(NEWGRF_VERSION)/" \
| sed -e "s/$(REPLACE_FILENAME)/$(OUTPUT_FILENAME)/" \
> $@
$(_V) [ -z "$(UNIX2DOS)" ] || $(UNIX2DOS) $(UNIX2DOS_FLAGS) $@
MD5SUM ?= $(shell command -v md5sum 2>/dev/null)
$(SOUND_FILE): $(SRC_DIR)/$(BASE_FILENAME).sfo $(SOUND_FILES) Makefile Makefile.in Makefile.config
# replace the place holders for version and name by the respective variables:
$(_E) "[Generating] $@ with dep $^"
$(_E) "[CATCODEC] $@"
$(_V) $(CATCODEC) $(CATCODEC_FLAGS) $(SRC_DIR)/$@
$(_V) cp $(SRC_DIR)/$@ .
ifneq ("$(shell command -v $(MD5SUM) 2>/dev/null)","")
$(OBS_FILE): $(SOUND_FILE) $(LANG_FILES) Makefile Makefile.in Makefile.config
$(_E) "[Generating:] $@"
@echo "[metadata]" > $@
@echo "name = $(REPO_NAME)" >> $@
@echo "shortname = $(REPO_SHORTNAME)" >> $@
@echo "version = $(NEWGRF_VERSION)" >> $@
$(_V) $(SCRIPT_DIR)/translations.sh | sed 's/{TITLE}/$(REPO_TITLE)/' >> $@
@echo "" >> $@
@echo "[files]" >> $@
@echo "samples = $(SOUND_FILE)" >> $@
@echo "" >> $@
@echo "[md5s]" >> $@
@echo "$(SOUND_FILE) = `$(MD5SUM) $(SOUND_FILE) | cut -f1 -d\ `" >> $@
@echo "" >> $@
@echo "[origin]" >> $@
@echo "$(REPO_ORIGIN)" >> $@
$(_E) "[Done] Base sound set successfully generated."
$(_E) ""
else
$(OBS_FILE):
$(_E) "[Generating:] $@"
$(error Missing md5sum. It's needed to generate $@)
endif
sound: $(OBS_FILE)
clean::
$(_V) -rm -f $(OBS_FILE)
$(_V) -rm -f $(SOUND_FILE)
$(_V) -rm -f src/$(SOUND_FILE)
$(_V) -rm -f src/$(SFO_FILE)