1VERSION = 1.22.1
2
3# Use libfirm subdir if it exists, otherwise use pkg-config
4ifneq ("$(wildcard $(top_srcdir)/libfirm)", "")
5FIRM_HOME     ?= $(top_srcdir)/libfirm
6FIRM_CPPFLAGS ?= -I$(FIRM_HOME)/include -I$(FIRM_HOME)/build/gen/include/libfirm
7FIRM_LIBS     ?= -lm
8LIBFIRM_FILE_BASE ?= build/$(variant)/libfirm.a
9LIBFIRM_FILE  ?= $(FIRM_HOME)/$(LIBFIRM_FILE_BASE)
10LIBFIRM_FILE_DLL_BASE ?= build/$(variant)/libfirm$(DLLEXT)
11LIBFIRM_FILE_DLL ?= $(FIRM_HOME)/$(LIBFIRM_FILE_DLL_BASE)
12else
13PKG_CONFIG    ?= pkg-config
14FIRM_CPPFLAGS ?= $(shell $(PKG_CONFIG) --cflags libfirm)
15FIRM_LIBS     ?= $(shell $(PKG_CONFIG) --libs   libfirm)
16LIBFIRM_FILE =
17LIBFIRM_FILE_DLL =
18endif
19
20ifeq ("$(shell uname)", "Darwin")
21# Query xcrun if /usr/include does not exist (new darwin versions)
22ifeq ("$(wildcard /usr/include)", "")
23SYSTEM_INCLUDE_DIR ?= "$(shell xcrun -show-sdk-path)/usr/include"
24endif
25endif
26
27# location of the system/libc headers
28SYSTEM_INCLUDE_DIR ?= /usr/include
29# if MULTILIB_M32_TRIPLE is defined, then we append a directory with the
30# machine triple to the system and local directory. i.e. if the target triple
31# is i386-linux-gnu we append $SYSTEM_INCLUDE_DIR/i386-linux-gnu and
32ifneq ("$(wildcard $(SYSTEM_INCLUDE_DIR)/x86_64-linux-gnu)","")
33# $LOCAL_INCLUDE_DIR/i386-linux-gnu.
34# -m32 triple:
35MULTILIB_M32_TRIPLE ?= i386-linux-gnu
36# -m64 triple:
37MULTILIB_M64_TRIPLE ?= x86_64-linux-gnu
38endif
39
40# location of additional headers
41LOCAL_INCLUDE_DIR ?= /usr/local/include
42# location of the compiler provided headers. If PREFIX is not set we assume that
43# we have a developer who wants to run cparser from source/builddir without
44# installing it.
45ifndef PREFIX
46COMPILER_INCLUDE_DIR ?= "$(abspath $(srcdir))/include"
47else
48COMPILER_INCLUDE_DIR ?= $(PREFIX)/lib/cparser/$(VERSION)/include
49endif
50