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
14subdir = src/backend/jit/llvm
15top_builddir = ../../../..
16include $(top_builddir)/src/Makefile.global
17
18ifneq ($(with_llvm), yes)
19    $(error "not building with LLVM support")
20endif
21
22PGFILEDESC = "llvmjit - JIT using LLVM"
23NAME = llvmjit
24
25# All files in this directory use LLVM.
26CFLAGS += $(LLVM_CFLAGS)
27CXXFLAGS += $(LLVM_CXXFLAGS)
28override CPPFLAGS := $(LLVM_CPPFLAGS) $(CPPFLAGS)
29SHLIB_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.
34override COMPILER = $(CXX) $(CFLAGS)
35
36OBJS = \
37	$(WIN32RES)
38
39# Infrastructure
40OBJS += \
41	llvmjit.o \
42	llvmjit_error.o \
43	llvmjit_inline.o \
44	llvmjit_wrap.o
45
46# Code generation
47OBJS += \
48	llvmjit_deform.o \
49	llvmjit_expr.o
50
51all: all-shared-lib llvmjit_types.bc
52
53install: all installdirs install-lib install-types
54
55installdirs: installdirs-lib
56
57uninstall: uninstall-lib uninstall-types
58
59# Note this is intentionally not in bitcodedir, as it's not for inlining */
60install-types: llvmjit_types.bc
61	$(INSTALL_DATA) llvmjit_types.bc '$(DESTDIR)$(pkglibdir)'
62
63uninstall-types:
64	rm -f '$(DESTDIR)$(pkglibdir)/llvmjit_types.bc'
65
66include $(top_srcdir)/src/Makefile.shlib
67
68clean distclean maintainer-clean: clean-lib
69	rm -f $(OBJS)
70	rm -f llvmjit_types.bc
71