
TRANSLATOR_MODULES0 = \
  theme-d-address-environment \
  theme-d-binder \
  theme-d-builtins \
  theme-d-builtin-type-finalization \
  theme-d-common-procedure-utilities \
  theme-d-common \
  theme-d-compilation-errors \
  theme-d-compilation-utilities \
  theme-d-compilation1 \
  theme-d-compilation2 \
  theme-d-compiler-core-def \
  theme-d-compile-unit \
  theme-d-constructors \
  theme-d-cycles \
  theme-d-debug \
  theme-d-entities \
  theme-d-errors-common \
  theme-d-expression-cloning \
  theme-d-expression-rebinding \
  theme-d-expression-translation \
  theme-d-expressions \
  theme-d-fields \
  theme-d-file-handling \
  theme-d-hash-tables \
  theme-d-implementation-pcode-reading \
  theme-d-interface-pcode-reading \
  theme-d-keywords \
  theme-d-letrec-compilation \
  theme-d-linker-core-def \
  theme-d-linker-errors \
  theme-d-linker-instantiation \
  theme-d-link-program \
  theme-d-macro-config \
  theme-d-macros \
  theme-d-param-cache \
  theme-d-parametrized-definitions \
  theme-d-parametrized-instances \
  theme-d-pcode-common \
  theme-d-phase2-compilation \
  theme-d-print-target-object \
  theme-d-procedure-utilities \
  theme-d-representation \
  theme-d-scheme0-target-compilation \
  theme-d-scheme-target-compilation \
  theme-d-special-procedures \
  theme-d-stripping \
  theme-d-symbol-table \
  theme-d-target-compilation-common \
  theme-d-translation-common \
  theme-d-tree-il-target-compilation \
  theme-d-type-system \
  theme-d-type-translation \
  theme-d-var-names

TRANSLATOR_COMP0 = $(TRANSLATOR_MODULES0:%=%.go)

TRANSLATOR_MODULES = $(TRANSLATOR_MODULES0) \
 theme-d-compiler theme-d-linker

translatordir = $(THEME_D_TRANSLATOR_DIR)

translator_DATA = $(TRANSLATOR_MODULES:%=%.go)

scriptdir = $(THEME_D_SCRIPT_DIR)
script_DATA = theme-d-compile.scm theme-d-link.scm

%.go : %.scm
	GUILE_LOAD_PATH=../.. guild compile -o $@ $<

# Not sure if the following is necessary.
install-data-hook ::
	chmod 755 $(DESTDIR)/$(THEME_D_SCRIPT_DIR)/theme-d-compile.scm
	chmod 755 $(DESTDIR)/$(THEME_D_SCRIPT_DIR)/theme-d-link.scm

.PHONY:  mostlyclean-local-check

mostlyclean-local : mostlyclean-local-check

mostlyclean-local-check:
	-rm -f *.go
	-rm -f theme-d-compile.scm theme-d-link.scm

theme-d-compile.scm : theme-d-compile.scm.in
	sed -e 's|@guile_version@|$(MY_GUILE_VERSION)|g' $< > $@
	chmod 755 theme-d-compile.scm

theme-d-link.scm : theme-d-link.scm.in
	sed -e 's|@guile_version@|$(MY_GUILE_VERSION)|g' $< > $@
	chmod 755 theme-d-link.scm

theme-d-compiler.go :: $(TRANSLATOR_COMP0)

theme-d-linker.go :: $(TRANSLATOR_COMP0)
