Skip to content

Commit 6783e9a

Browse files
committed
Fixed dependency declaration in Makefile
1 parent 1e3a7e7 commit 6783e9a

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

source/Makefile

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ HEXFILE_DIR=Hexfile
2020
OUTPUT_DIR_BASE=Objects
2121
OUTPUT_DIR=Objects/$(model)
2222

23+
# Get the directory containing this Makefile
24+
MAKEFILE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
25+
26+
# Translations folder
27+
TRANSLATIONS_DIR=$(MAKEFILE_DIR)../Translations
28+
2329
ALL_LANGUAGES=BE BG CS DA DE EL EN ES ET FI FR HR HU IT JA_JP LT NB NL_BE NL PL PT RO RU SK SL SR_CYRL SR_LATN SV TR UK UZ VI YUE_HK ZH_CN ZH_TW
2430

2531
LANGUAGE_GROUP_CJK_LANGS=EN JA_JP YUE_HK ZH_TW ZH_CN
@@ -547,16 +553,16 @@ $(OUT_OBJS_S): $(OUTPUT_DIR)/%.o: %.S Makefile
547553
@echo 'Building file: $<'
548554
@$(AS) -c $(AFLAGS) $< -o $@
549555

550-
Core/Gen/Translation.%.cpp $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle: ../Translations/translation_%.json \
551-
../Translations/make_translation.py \
552-
../Translations/translations_definitions.json \
553-
../Translations/font_tables.py \
554-
Makefile ../Translations/wqy-bitmapsong/wenquanyi_9pt.bdf \
556+
Core/Gen/Translation.%.cpp $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle: $(TRANSLATIONS_DIR)/translation_%.json \
557+
$(TRANSLATIONS_DIR)/make_translation.py \
558+
$(TRANSLATIONS_DIR)/translations_definitions.json \
559+
$(TRANSLATIONS_DIR)/font_tables.py \
560+
Makefile $(TRANSLATIONS_DIR)/wqy-bitmapsong/wenquanyi_9pt.bdf \
555561
Core/Gen/macros.txt
556562
@test -d Core/Gen || mkdir -p Core/Gen
557563
@test -d $(OUTPUT_DIR)/Core/Gen/translation.files || mkdir -p $(OUTPUT_DIR)/Core/Gen/translation.files
558564
@echo 'Generating translations for language $*'
559-
@$(HOST_PYTHON) ../Translations/make_translation.py \
565+
@$(HOST_PYTHON) $(TRANSLATIONS_DIR)/make_translation.py \
560566
--macros "$(CURDIR)/Core/Gen/macros.txt" \
561567
-o "$(CURDIR)/Core/Gen/Translation.$*.cpp" \
562568
--output-pickled "$(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle" \
@@ -586,7 +592,7 @@ $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so: Core/brieflz/brieflz.c Core/brieflz/de
586592
Core/Gen/Translation_brieflz.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.o $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so Core/Gen/macros.txt
587593
@test -d $(@D) || mkdir -p $(@D)
588594
@echo Generating BriefLZ compressed translation for $*
589-
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \
595+
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) $(TRANSLATIONS_DIR)/make_translation.py \
590596
--macros "$(CURDIR)/Core/Gen/macros.txt" \
591597
-o "$(CURDIR)/Core/Gen/Translation_brieflz.$*.cpp" \
592598
--input-pickled "$(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle" \
@@ -596,7 +602,7 @@ Core/Gen/Translation_brieflz.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.o
596602
Core/Gen/Translation_brieflz_font.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so Core/Gen/macros.txt
597603
@test -d $(@D) || mkdir -p $(@D)
598604
@echo Generating BriefLZ compressed translation font for $*
599-
@$(HOST_PYTHON) ../Translations/make_translation.py \
605+
@$(HOST_PYTHON) $(TRANSLATIONS_DIR)/make_translation.py \
600606
--macros $(PWD)/Core/Gen/macros.txt \
601607
-o $(PWD)/Core/Gen/Translation_brieflz_font.$*.cpp \
602608
--input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle \
@@ -632,16 +638,16 @@ $(HEXFILE_DIR)/$(model)_multi_compressed_$(2).elf: \
632638
$(OUTPUT_DIR)/Core/LangSupport/lang_multi.o \
633639
$(LIBS) $(LINKER_FLAGS) -o$$@ -Wl,-Map=$$@.map
634640

635-
Core/Gen/Translation_multi.$(1).cpp: $(patsubst %,../Translations/translation_%.json,$(3)) \
636-
../Translations/make_translation.py \
637-
../Translations/translations_definitions.json \
638-
../Translations/font_tables.py \
639-
Makefile ../Translations/wqy-bitmapsong/wenquanyi_9pt.bdf \
641+
Core/Gen/Translation_multi.$(1).cpp: $(patsubst %,$(TRANSLATIONS_DIR)/translation_%.json,$(3)) \
642+
$(TRANSLATIONS_DIR)/make_translation.py \
643+
$(TRANSLATIONS_DIR)/translations_definitions.json \
644+
$(TRANSLATIONS_DIR)/font_tables.py \
645+
Makefile $(TRANSLATIONS_DIR)/wqy-bitmapsong/wenquanyi_9pt.bdf \
640646
Core/Gen/macros.txt
641647
@test -d Core/Gen || mkdir -p Core/Gen
642648
@test -d $(OUTPUT_DIR)/Core/Gen/translation.files || mkdir -p $(OUTPUT_DIR)/Core/Gen/translation.files
643649
@echo 'Generating translations for multi-language $(2)'
644-
@$(HOST_PYTHON) ../Translations/make_translation.py \
650+
@$(HOST_PYTHON) $(TRANSLATIONS_DIR)/make_translation.py \
645651
--macros "$(CURDIR)/Core/Gen/macros.txt" \
646652
-o "$(CURDIR)/Core/Gen/Translation_multi.$(1).cpp" \
647653
--output-pickled "$(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle" \
@@ -652,7 +658,7 @@ $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle: Core/Gen/Translation
652658
Core/Gen/Translation_brieflz_multi.$(1).cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).o $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so Core/Gen/macros.txt
653659
@test -d $$(@D) || mkdir -p $$(@D)
654660
@echo Generating BriefLZ compressed translation for multi-language $(2)
655-
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \
661+
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) $(TRANSLATIONS_DIR)/make_translation.py \
656662
--macros "$(CURDIR)/Core/Gen/macros.txt" \
657663
-o "$(CURDIR)/Core/Gen/Translation_brieflz_multi.$(1).cpp" \
658664
--input-pickled "$(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle" \
@@ -671,7 +677,7 @@ clean:
671677
rm -Rf Core/Gen
672678
rm -Rf $(OUTPUT_DIR_BASE)
673679
rm -Rf $(HEXFILE_DIR)/*
674-
rm -Rf ../Translations/__pycache__
680+
rm -Rf $(TRANSLATIONS_DIR)/__pycache__
675681

676682
clean-all: clean
677683
rm -Rf $(HEXFILE_DIR)

0 commit comments

Comments
 (0)