blob: f7e9e85bce83d20d4f81099e25cbd9a0771e0cd8 [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001LEVEL = ../..
Daniel Dunbar073777f2009-03-24 03:00:12 +00002DIRS := include lib tools docs
Reid Spencer5f016e22007-07-11 17:01:13 +00003
Daniel Dunbar297b0832009-11-15 00:22:33 +00004PARALLEL_DIRS :=
5
6ifeq ($(BUILD_EXAMPLES),1)
7 PARALLEL_DIRS += examples
8endif
9
Reid Spencer5f016e22007-07-11 17:01:13 +000010include $(LEVEL)/Makefile.common
11
Mike Stumpadc981a2009-01-20 21:10:41 +000012ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
Daniel Dunbara9829ae2009-12-21 23:28:06 +000013$(RecursiveTargets)::
Mike Stumpadc981a2009-01-20 21:10:41 +000014 $(Verb) if [ ! -f test/Makefile ]; then \
15 $(MKDIR) test; \
16 $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
17 fi
18endif
19
Reid Spencer5f016e22007-07-11 17:01:13 +000020test::
Kovarththanan Rajaratnam61736b42010-03-18 13:56:20 +000021 @ $(MAKE) -C test
Gabor Greifab72ffe2008-03-18 06:14:16 +000022
23report::
Chris Lattner9d294b92008-04-06 22:32:01 +000024 @ $(MAKE) -C test report
Reid Spencer5f016e22007-07-11 17:01:13 +000025
26clean::
Chris Lattner9d294b92008-04-06 22:32:01 +000027 @ $(MAKE) -C test clean
Gabor Greif5267d7c2008-03-20 14:28:22 +000028
Mike Stump8ba82b32009-02-12 02:25:47 +000029tags::
Kovarththanan Rajaratnam61736b42010-03-18 13:56:20 +000030 $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
31 grep -v /lib/Headers | grep -v /test/`
Mike Stump8ba82b32009-02-12 02:25:47 +000032
Daniel Dunbar432eeec2009-03-18 05:59:14 +000033cscope.files:
Daniel Dunbar073777f2009-03-24 03:00:12 +000034 find tools lib include -name '*.cpp' \
Daniel Dunbar432eeec2009-03-18 05:59:14 +000035 -or -name '*.def' \
36 -or -name '*.td' \
37 -or -name '*.h' > cscope.files
38
39.PHONY: test report clean cscope.files
Douglas Gregor14ea5692009-10-08 22:15:31 +000040
41install-local::
42 $(Echo) Installing include files
Chris Lattnerdefd0162010-03-10 21:26:01 +000043 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
Douglas Gregor14ea5692009-10-08 22:15:31 +000044 $(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 Naumann1555c3a2009-10-12 16:42:18 +000047 -o -name '.#*' -o -name '*.in' -o -name '*.txt' \
48 -o -name 'Makefile' -o -name '*.td' ')' -print \
Daniel Dunbar717a5952009-11-25 03:46:30 +000049 | grep -v CVS | grep -v .svn | grep -v .dir` ; do \
Chris Lattnerdefd0162010-03-10 21:26:01 +000050 instdir=$(DESTDIR)`dirname "$(PROJ_includedir)/$$hdr"` ; \
Douglas Gregor14ea5692009-10-08 22:15:31 +000051 if test \! -d "$$instdir" ; then \
52 $(EchoCmd) Making install directory $$instdir ; \
53 $(MKDIR) $$instdir ;\
54 fi ; \
Chris Lattnerdefd0162010-03-10 21:26:01 +000055 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
Douglas Gregor14ea5692009-10-08 22:15:31 +000056 done ; \
57 fi
58ifneq ($(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 Naumann1555c3a2009-10-12 16:42:18 +000061 for hdr in `find . -type f '!' '(' -name 'Makefile' ')' -print \
Daniel Dunbar717a5952009-11-25 03:46:30 +000062 | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \
Chris Lattnerdefd0162010-03-10 21:26:01 +000063 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
Douglas Gregor14ea5692009-10-08 22:15:31 +000064 done ; \
65 fi
66endif