2012-09-05 13:37:39 +04:00
##===- Makefile --------------------------------------------*- Makefile -*-===##
#
2014-01-07 12:55:59 +04:00
# The Cling Interpreter
2012-09-05 13:37:39 +04:00
#
2014-01-07 12:55:59 +04:00
# This file is dual-licensed: you can choose to license it under the University
# of Illinois Open Source License or the GNU Lesser General Public License. See
# LICENSE.TXT for details.
2012-09-05 13:37:39 +04:00
#
##===----------------------------------------------------------------------===##
# If CLING_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
# are being included from a subdirectory makefile.
i f n d e f C L I N G _ L E V E L
IS_TOP_LEVEL := 1
CLING_LEVEL := .
DIRS := include lib tools docs
PARALLEL_DIRS :=
i f e q ( $( BUILD_EXAMPLES ) , 1 )
PARALLEL_DIRS += examples
e n d i f
e n d i f
i f e q ( $( MAKECMDGOALS ) , l i b s - o n l y )
DIRS := $( filter-out tools docs, $( DIRS) )
OPTIONAL_DIRS :=
e n d i f
###
# Common Makefile code, shared by all Cling Makefiles.
# Set LLVM source root level.
LEVEL := $( CLING_LEVEL) /../..
# Include LLVM common makefile.
i n c l u d e $( LEVEL ) / M a k e f i l e . c o m m o n
i f n e q ( $( ENABLE_DOCS ) , 1 )
DIRS := $( filter-out docs, $( DIRS) )
e n d i f
# Set common Cling build flags.
CPP.Flags += -I$( PROJ_SRC_DIR) /$( CLING_LEVEL) /include -I$( PROJ_OBJ_DIR) /$( CLING_LEVEL) /include
i f d e f C L I N G _ V E N D O R
CPP.Flags += -DCLING_VENDOR= '"$(CLING_VENDOR) "'
e n d i f
# Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
# work with it enabled with GCC), Cling/llvm-gc don't support it yet, and newer
# GCC's have false positive warnings with it on Linux (which prove a pain to
# fix). For example:
# http://gcc.gnu.org/PR41874
# http://gcc.gnu.org/PR41838
#
# We can revisit this when LLVM/Cling support it.
CXX.Flags += -fno-strict-aliasing
2014-05-09 16:46:58 +04:00
# Determine cling's version:
2014-05-14 22:18:54 +04:00
CLING_VERSION = $( shell cat $( PROJ_SRC_DIR) /$( CLING_LEVEL) /VERSION)
2014-05-09 17:16:50 +04:00
CPP.Flags += -DCLING_VERSION= '"$(CLING_VERSION) "'
2014-05-09 16:46:58 +04:00
2012-09-05 13:37:39 +04:00
###
# Cling Top Level specific stuff.
i f e q ( $( IS_TOP_LEVEL ) , 1 )
i f n e q ( $( PROJ_SRC_ROOT ) , $( PROJ_OBJ_ROOT ) )
$(RecursiveTargets) ::
$( Verb) if [ ! -f test/Makefile ] ; then \
$( MKDIR) test; \
$( CP) $( PROJ_SRC_DIR) /test/Makefile test/Makefile; \
fi
e n d i f
test ::
@ $( MAKE) -C test
report ::
@ $( MAKE) -C test report
clean ::
@ $( MAKE) -C test clean
libs-only : all
tags ::
$( Verb) etags ` find . -type f -name '*.h' -or -name '*.cpp' | \
grep -v /lib/Headers | grep -v /test/`
cscope.files :
find tools lib include -name '*.cpp' \
-or -name '*.def' \
-or -name '*.td' \
-or -name '*.h' > cscope.files
.PHONY : test report clean cscope .files
e n d i f