diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/src/llvmtranslate/local.am | |
Diffstat (limited to 'tiger-compiler/src/llvmtranslate/local.am')
| -rw-r--r-- | tiger-compiler/src/llvmtranslate/local.am | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tiger-compiler/src/llvmtranslate/local.am b/tiger-compiler/src/llvmtranslate/local.am new file mode 100644 index 0000000..d5a752b --- /dev/null +++ b/tiger-compiler/src/llvmtranslate/local.am @@ -0,0 +1,39 @@ +# Compile the LLVM Tiger runtime +EXTRA_DIST += %D%/tiger-runtime.c +CLEANFILES += %D%/runtime.ll +%D%/runtime.ll: %D%/tiger-runtime.c + $(AM_V_CC)$(CLANG) -c -m32 -std=c99 -emit-llvm -S -o $@ $^ + +LLVM_RUNTIME_GENERATION = %D%/generate-runtime.sh +EXTRA_DIST += $(LLVM_RUNTIME_GENERATION) +CLEANFILES += %D%/runtime.cc +%D%/runtime.cc: %D%/runtime.ll + $(AM_V_GEN)$(srcdir)/$(LLVM_RUNTIME_GENERATION) $< $@ + +## llvmtranslate module. +src_libtc_la_SOURCES += \ + %D%/escapes-collector.cc %D%/escapes-collector.hh \ + %D%/translator.hh %D%/translator.hxx %D%/translator.cc \ + %D%/libllvmtranslate.cc %D%/libllvmtranslate.hh \ + %D%/llvm-type-visitor.cc %D%/llvm-type-visitor.hh \ + %D%/fwd.hh + +nodist_src_libtc_la_SOURCES += %D%/runtime.cc + +## FIXME: Add SWIG support for this module + +## LLVM flags are found using `llvm-config`. + +if STATIC_LLVM +EXTRA_LLVM_CONFIG_FLAGS = --link-static +else +EXTRA_LLVM_CONFIG_FLAGS = +endif + +AM_CXXFLAGS += `$(LLVM_CONFIG) $(EXTRA_LLVM_CONFIG_FLAGS) --cppflags` +src_libtc_la_LDFLAGS += \ + `$(LLVM_CONFIG) $(EXTRA_LLVM_CONFIG_FLAGS) --ldflags` \ + `$(LLVM_CONFIG) $(EXTRA_LLVM_CONFIG_FLAGS) --libs core linker asmparser irprinter` \ + `$(LLVM_CONFIG) $(EXTRA_LLVM_CONFIG_FLAGS) --system-libs` + +TASKS += %D%/tasks.hh %D%/tasks.cc |
