| 1 |
#------------------------------------------------------------------------- |
| 2 |
# |
| 3 |
# Makefile-- |
| 4 |
# Makefile the LLVM JIT provider, building it into a shared library. |
| 5 |
# |
| 6 |
# Note that this file is recursed into from src/Makefile, not by the |
| 7 |
# parent directory.. |
| 8 |
# |
| 9 |
# IDENTIFICATION |
| 10 |
# src/backend/jit/llvm/Makefile |
| 11 |
# |
| 12 |
#------------------------------------------------------------------------- |
| 13 |
|
| 14 |
subdir = src/backend/jit/llvm |
| 15 |
top_builddir = ../../../.. |
| 16 |
include $(top_builddir)/src/Makefile.global |
| 17 |
|
| 18 |
ifneq ($(with_llvm), yes) |
| 19 |
$(error "not building with LLVM support") |
| 20 |
endif |
| 21 |
|
| 22 |
PGFILEDESC = "llvmjit - JIT using LLVM" |
| 23 |
NAME = llvmjit |
| 24 |
|
| 25 |
# All files in this directory use LLVM. |
| 26 |
CFLAGS += $(LLVM_CFLAGS) |
| 27 |
CXXFLAGS += $(LLVM_CXXFLAGS) |
| 28 |
override CPPFLAGS += $(LLVM_CPPFLAGS) |
| 29 |
SHLIB_LINK += $(LLVM_LIBS) |
| 30 |
|
| 31 |
# Because this module includes C++ files, we need to use a C++ |
| 32 |
# compiler for linking. Makefile.shlib uses $(COMPILER) to build |
| 33 |
# loadable modules. |
| 34 |
override COMPILER = $(CXX) $(CXXFLAGS) |
| 35 |
|
| 36 |
OBJS = \ |
| 37 |
$(WIN32RES) |
| 38 |
|
| 39 |
# Infrastructure |
| 40 |
OBJS += \ |
| 41 |
llvmjit.o \ |
| 42 |
llvmjit_error.o \ |
| 43 |
llvmjit_inline.o \ |
| 44 |
llvmjit_wrap.o \ |
| 45 |
SectionMemoryManager.o |
| 46 |
|
| 47 |
# Code generation |
| 48 |
OBJS += \ |
| 49 |
llvmjit_deform.o \ |
| 50 |
llvmjit_expr.o |
| 51 |
|
| 52 |
all: all-shared-lib llvmjit_types.bc |
| 53 |
|
| 54 |
install: all installdirs install-lib install-types |
| 55 |
|
| 56 |
installdirs: installdirs-lib |
| 57 |
|
| 58 |
uninstall: uninstall-lib uninstall-types |
| 59 |
|
| 60 |
# Note this is intentionally not in bitcodedir, as it's not for inlining */ |
| 61 |
install-types: llvmjit_types.bc |
| 62 |
$(INSTALL_DATA) llvmjit_types.bc '$(DESTDIR)$(pkglibdir)' |
| 63 |
|
| 64 |
uninstall-types: |
| 65 |
rm -f '$(DESTDIR)$(pkglibdir)/llvmjit_types.bc' |
| 66 |
|
| 67 |
include $(top_srcdir)/src/Makefile.shlib |
| 68 |
|
| 69 |
clean distclean: clean-lib |
| 70 |
rm -f $(OBJS) |
| 71 |
rm -f llvmjit_types.bc |