Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | LEVEL = ../.. |
Daniel Dunbar | 073777f | 2009-03-24 03:00:12 +0000 | [diff] [blame] | 2 | DIRS := include lib tools docs |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 3 | |
Daniel Dunbar | 297b083 | 2009-11-15 00:22:33 +0000 | [diff] [blame] | 4 | PARALLEL_DIRS := |
| 5 | |
| 6 | ifeq ($(BUILD_EXAMPLES),1) |
| 7 | PARALLEL_DIRS += examples |
| 8 | endif |
| 9 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 10 | include $(LEVEL)/Makefile.common |
| 11 | |
Mike Stump | adc981a | 2009-01-20 21:10:41 +0000 | [diff] [blame] | 12 | ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) |
Daniel Dunbar | a9829ae | 2009-12-21 23:28:06 +0000 | [diff] [blame] | 13 | $(RecursiveTargets):: |
Mike Stump | adc981a | 2009-01-20 21:10:41 +0000 | [diff] [blame] | 14 | $(Verb) if [ ! -f test/Makefile ]; then \ |
| 15 | $(MKDIR) test; \ |
| 16 | $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \ |
| 17 | fi |
| 18 | endif |
| 19 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 20 | test:: |
Kovarththanan Rajaratnam | 61736b4 | 2010-03-18 13:56:20 +0000 | [diff] [blame] | 21 | @ $(MAKE) -C test |
Gabor Greif | ab72ffe | 2008-03-18 06:14:16 +0000 | [diff] [blame] | 22 | |
| 23 | report:: |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 24 | @ $(MAKE) -C test report |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 25 | |
| 26 | clean:: |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 27 | @ $(MAKE) -C test clean |
Gabor Greif | 5267d7c | 2008-03-20 14:28:22 +0000 | [diff] [blame] | 28 | |
Mike Stump | 8ba82b3 | 2009-02-12 02:25:47 +0000 | [diff] [blame] | 29 | tags:: |
Kovarththanan Rajaratnam | 61736b4 | 2010-03-18 13:56:20 +0000 | [diff] [blame] | 30 | $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \ |
| 31 | grep -v /lib/Headers | grep -v /test/` |
Mike Stump | 8ba82b3 | 2009-02-12 02:25:47 +0000 | [diff] [blame] | 32 | |
Daniel Dunbar | 432eeec | 2009-03-18 05:59:14 +0000 | [diff] [blame] | 33 | cscope.files: |
Daniel Dunbar | 073777f | 2009-03-24 03:00:12 +0000 | [diff] [blame] | 34 | find tools lib include -name '*.cpp' \ |
Daniel Dunbar | 432eeec | 2009-03-18 05:59:14 +0000 | [diff] [blame] | 35 | -or -name '*.def' \ |
| 36 | -or -name '*.td' \ |
| 37 | -or -name '*.h' > cscope.files |
| 38 | |
| 39 | .PHONY: test report clean cscope.files |
Douglas Gregor | 14ea569 | 2009-10-08 22:15:31 +0000 | [diff] [blame] | 40 | |
| 41 | install-local:: |
| 42 | $(Echo) Installing include files |
Chris Lattner | defd016 | 2010-03-10 21:26:01 +0000 | [diff] [blame] | 43 | $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir) |
Douglas Gregor | 14ea569 | 2009-10-08 22:15:31 +0000 | [diff] [blame] | 44 | $(Verb) if test -d "$(PROJ_SRC_ROOT)/tools/clang/include" ; then \ |
| 45 | cd $(PROJ_SRC_ROOT)/tools/clang/include && \ |
| 46 | for hdr in `find . -type f '!' '(' -name '*~' \ |
Axel Naumann | 1555c3a | 2009-10-12 16:42:18 +0000 | [diff] [blame] | 47 | -o -name '.#*' -o -name '*.in' -o -name '*.txt' \ |
| 48 | -o -name 'Makefile' -o -name '*.td' ')' -print \ |
Daniel Dunbar | 717a595 | 2009-11-25 03:46:30 +0000 | [diff] [blame] | 49 | | grep -v CVS | grep -v .svn | grep -v .dir` ; do \ |
Chris Lattner | defd016 | 2010-03-10 21:26:01 +0000 | [diff] [blame] | 50 | instdir=$(DESTDIR)`dirname "$(PROJ_includedir)/$$hdr"` ; \ |
Douglas Gregor | 14ea569 | 2009-10-08 22:15:31 +0000 | [diff] [blame] | 51 | if test \! -d "$$instdir" ; then \ |
| 52 | $(EchoCmd) Making install directory $$instdir ; \ |
| 53 | $(MKDIR) $$instdir ;\ |
| 54 | fi ; \ |
Chris Lattner | defd016 | 2010-03-10 21:26:01 +0000 | [diff] [blame] | 55 | $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ |
Douglas Gregor | 14ea569 | 2009-10-08 22:15:31 +0000 | [diff] [blame] | 56 | done ; \ |
| 57 | fi |
| 58 | ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) |
| 59 | $(Verb) if test -d "$(PROJ_OBJ_ROOT)/tools/clang/include" ; then \ |
| 60 | cd $(PROJ_OBJ_ROOT)/tools/clang/include && \ |
Axel Naumann | 1555c3a | 2009-10-12 16:42:18 +0000 | [diff] [blame] | 61 | for hdr in `find . -type f '!' '(' -name 'Makefile' ')' -print \ |
Daniel Dunbar | 717a595 | 2009-11-25 03:46:30 +0000 | [diff] [blame] | 62 | | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \ |
Chris Lattner | defd016 | 2010-03-10 21:26:01 +0000 | [diff] [blame] | 63 | $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ |
Douglas Gregor | 14ea569 | 2009-10-08 22:15:31 +0000 | [diff] [blame] | 64 | done ; \ |
| 65 | fi |
| 66 | endif |