2010-06-08 20:34:18 +00:00
|
|
|
##===- Makefile --------------------------------------------*- Makefile -*-===##
|
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
# If CLANG_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
|
|
|
|
# are being included from a subdirectory makefile.
|
|
|
|
|
|
|
|
ifndef CLANG_LEVEL
|
|
|
|
|
|
|
|
IS_TOP_LEVEL := 1
|
|
|
|
CLANG_LEVEL := .
|
2010-06-30 22:10:38 +00:00
|
|
|
DIRS := include lib tools runtime docs
|
2006-06-18 05:43:12 +00:00
|
|
|
|
2009-11-15 00:22:33 +00:00
|
|
|
PARALLEL_DIRS :=
|
|
|
|
|
|
|
|
ifeq ($(BUILD_EXAMPLES),1)
|
|
|
|
PARALLEL_DIRS += examples
|
|
|
|
endif
|
2010-06-08 20:34:18 +00:00
|
|
|
endif
|
|
|
|
|
2010-06-19 06:35:25 +00:00
|
|
|
ifeq ($(MAKECMDGOALS),libs-only)
|
|
|
|
DIRS := $(filter-out tools docs, $(DIRS))
|
|
|
|
OPTIONAL_DIRS :=
|
|
|
|
endif
|
|
|
|
|
2010-06-08 20:34:18 +00:00
|
|
|
###
|
|
|
|
# Common Makefile code, shared by all Clang Makefiles.
|
2009-11-15 00:22:33 +00:00
|
|
|
|
2010-06-08 20:34:18 +00:00
|
|
|
# Set LLVM source root level.
|
|
|
|
LEVEL := $(CLANG_LEVEL)/../..
|
|
|
|
|
|
|
|
# Include LLVM common makefile.
|
2006-06-18 05:43:12 +00:00
|
|
|
include $(LEVEL)/Makefile.common
|
2006-11-21 05:01:56 +00:00
|
|
|
|
2010-06-08 20:44:43 +00:00
|
|
|
# Set common Clang build flags.
|
|
|
|
CPP.Flags += -I$(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -I$(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include
|
|
|
|
ifdef CLANG_VENDOR
|
|
|
|
CPP.Flags += -DCLANG_VENDOR='"$(CLANG_VENDOR) "'
|
|
|
|
endif
|
|
|
|
|
2010-06-08 21:55:02 +00:00
|
|
|
# Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
|
|
|
|
# work with it enabled with GCC), Clang/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/Clang support it.
|
|
|
|
CXX.Flags += -fno-strict-aliasing
|
|
|
|
|
2010-06-08 20:34:18 +00:00
|
|
|
###
|
|
|
|
# Clang Top Level specific stuff.
|
|
|
|
|
|
|
|
ifeq ($(IS_TOP_LEVEL),1)
|
|
|
|
|
2009-01-20 21:10:41 +00:00
|
|
|
ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
|
2009-12-21 23:28:06 +00:00
|
|
|
$(RecursiveTargets)::
|
2009-01-20 21:10:41 +00:00
|
|
|
$(Verb) if [ ! -f test/Makefile ]; then \
|
|
|
|
$(MKDIR) test; \
|
|
|
|
$(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
|
|
|
|
fi
|
|
|
|
endif
|
|
|
|
|
2006-11-21 05:01:56 +00:00
|
|
|
test::
|
2010-03-18 13:56:20 +00:00
|
|
|
@ $(MAKE) -C test
|
2008-03-18 06:14:16 +00:00
|
|
|
|
|
|
|
report::
|
2008-04-06 22:32:01 +00:00
|
|
|
@ $(MAKE) -C test report
|
2007-01-15 02:06:47 +00:00
|
|
|
|
|
|
|
clean::
|
2008-04-06 22:32:01 +00:00
|
|
|
@ $(MAKE) -C test clean
|
2010-06-25 17:33:46 +00:00
|
|
|
|
2010-06-19 06:35:25 +00:00
|
|
|
libs-only: all
|
2008-03-20 14:28:22 +00:00
|
|
|
|
2009-02-12 02:25:47 +00:00
|
|
|
tags::
|
2010-03-18 13:56:20 +00:00
|
|
|
$(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
|
|
|
|
grep -v /lib/Headers | grep -v /test/`
|
2009-02-12 02:25:47 +00:00
|
|
|
|
2009-03-18 05:59:14 +00:00
|
|
|
cscope.files:
|
2009-03-24 03:00:12 +00:00
|
|
|
find tools lib include -name '*.cpp' \
|
2009-03-18 05:59:14 +00:00
|
|
|
-or -name '*.def' \
|
|
|
|
-or -name '*.td' \
|
|
|
|
-or -name '*.h' > cscope.files
|
|
|
|
|
|
|
|
.PHONY: test report clean cscope.files
|
2010-06-08 20:34:18 +00:00
|
|
|
|
|
|
|
endif
|