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 directy 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=$(WIN32RES)
37
38# Infrastructure
39OBJS += llvmjit.o llvmjit_error.o llvmjit_inline.o llvmjit_wrap.o
40# Code generation
41OBJS += llvmjit_expr.o llvmjit_deform.o
42
43all: all-shared-lib llvmjit_types.bc
44
45install: all installdirs install-lib install-types
46
47installdirs: installdirs-lib
48
49uninstall: uninstall-lib uninstall-types
50
51# Note this is intentionally not in bitcodedir, as it's not for inlining */
52install-types: llvmjit_types.bc
53	$(INSTALL_DATA) llvmjit_types.bc '$(DESTDIR)$(pkglibdir)'
54
55uninstall-types:
56	rm -f '$(DESTDIR)$(pkglibdir)/llvmjit_types.bc'
57
58include $(top_srcdir)/src/Makefile.shlib
59
60clean distclean maintainer-clean: clean-lib
61	rm -f $(OBJS)
62	rm -f llvmjit_types.bc
63