Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 1 | ##===- Makefile --------------------------------------------*- Makefile -*-===## |
| 2 | # |
| 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
| 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
| 7 | # |
| 8 | ##===----------------------------------------------------------------------===## |
| 9 | |
| 10 | # If CLANG_LEVEL is not set, then we are the top-level Makefile. Otherwise, we |
| 11 | # are being included from a subdirectory makefile. |
| 12 | |
| 13 | ifndef CLANG_LEVEL |
| 14 | |
| 15 | IS_TOP_LEVEL := 1 |
| 16 | CLANG_LEVEL := . |
Daniel Dunbar | 073777f | 2009-03-24 03:00:12 +0000 | [diff] [blame] | 17 | DIRS := include lib tools docs |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 18 | |
Daniel Dunbar | 297b083 | 2009-11-15 00:22:33 +0000 | [diff] [blame] | 19 | PARALLEL_DIRS := |
| 20 | |
| 21 | ifeq ($(BUILD_EXAMPLES),1) |
| 22 | PARALLEL_DIRS += examples |
| 23 | endif |
Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 24 | endif |
Daniel Dunbar | 297b083 | 2009-11-15 00:22:33 +0000 | [diff] [blame] | 25 | |
Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 26 | ### |
| 27 | # Common Makefile code, shared by all Clang Makefiles. |
| 28 | |
| 29 | # Set LLVM source root level. |
| 30 | LEVEL := $(CLANG_LEVEL)/../.. |
| 31 | |
| 32 | # Include LLVM common makefile. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 33 | include $(LEVEL)/Makefile.common |
| 34 | |
Daniel Dunbar | c4dec1c | 2010-06-08 20:44:43 +0000 | [diff] [blame^] | 35 | # Set common Clang build flags. |
| 36 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -I$(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include |
| 37 | ifdef CLANG_VENDOR |
| 38 | CPP.Flags += -DCLANG_VENDOR='"$(CLANG_VENDOR) "' |
| 39 | endif |
| 40 | |
Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 41 | ### |
| 42 | # Clang Top Level specific stuff. |
| 43 | |
| 44 | ifeq ($(IS_TOP_LEVEL),1) |
| 45 | |
Mike Stump | adc981a | 2009-01-20 21:10:41 +0000 | [diff] [blame] | 46 | ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) |
Daniel Dunbar | a9829ae | 2009-12-21 23:28:06 +0000 | [diff] [blame] | 47 | $(RecursiveTargets):: |
Mike Stump | adc981a | 2009-01-20 21:10:41 +0000 | [diff] [blame] | 48 | $(Verb) if [ ! -f test/Makefile ]; then \ |
| 49 | $(MKDIR) test; \ |
| 50 | $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \ |
| 51 | fi |
| 52 | endif |
| 53 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 54 | test:: |
Kovarththanan Rajaratnam | 61736b4 | 2010-03-18 13:56:20 +0000 | [diff] [blame] | 55 | @ $(MAKE) -C test |
Gabor Greif | ab72ffe | 2008-03-18 06:14:16 +0000 | [diff] [blame] | 56 | |
| 57 | report:: |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 58 | @ $(MAKE) -C test report |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 59 | |
| 60 | clean:: |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 61 | @ $(MAKE) -C test clean |
Gabor Greif | 5267d7c | 2008-03-20 14:28:22 +0000 | [diff] [blame] | 62 | |
Mike Stump | 8ba82b3 | 2009-02-12 02:25:47 +0000 | [diff] [blame] | 63 | tags:: |
Kovarththanan Rajaratnam | 61736b4 | 2010-03-18 13:56:20 +0000 | [diff] [blame] | 64 | $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \ |
| 65 | grep -v /lib/Headers | grep -v /test/` |
Mike Stump | 8ba82b3 | 2009-02-12 02:25:47 +0000 | [diff] [blame] | 66 | |
Daniel Dunbar | 432eeec | 2009-03-18 05:59:14 +0000 | [diff] [blame] | 67 | cscope.files: |
Daniel Dunbar | 073777f | 2009-03-24 03:00:12 +0000 | [diff] [blame] | 68 | find tools lib include -name '*.cpp' \ |
Daniel Dunbar | 432eeec | 2009-03-18 05:59:14 +0000 | [diff] [blame] | 69 | -or -name '*.def' \ |
| 70 | -or -name '*.td' \ |
| 71 | -or -name '*.h' > cscope.files |
| 72 | |
| 73 | .PHONY: test report clean cscope.files |
Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 74 | |
| 75 | endif |