blob: fe2c515622751c023d0b7bf869491a4b47690dcc [file] [log] [blame]
Chris Lattnerbda0b622008-03-15 23:59:48 +00001##===- clang/lib/Basic/Makefile ----------------------------*- Makefile -*-===##
Jia Liuf8e5d4c2012-03-02 14:37:41 +00002#
Reid Spencer5f016e22007-07-11 17:01:13 +00003# The LLVM Compiler Infrastructure
4#
Chris Lattner6298b8c2007-12-29 20:02:25 +00005# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
Jia Liuf8e5d4c2012-03-02 14:37:41 +00007#
Reid Spencer5f016e22007-07-11 17:01:13 +00008##===----------------------------------------------------------------------===##
9#
10# This implements the Basic library for the C-Language front-end.
11#
12##===----------------------------------------------------------------------===##
13
Daniel Dunbarafed0992010-06-08 20:34:18 +000014CLANG_LEVEL := ../..
Reid Spencer5f016e22007-07-11 17:01:13 +000015LIBRARYNAME := clangBasic
Reid Spencer5f016e22007-07-11 17:01:13 +000016
Daniel Dunbarafed0992010-06-08 20:34:18 +000017include $(CLANG_LEVEL)/Makefile
Reid Spencer5f016e22007-07-11 17:01:13 +000018
Daniel Dunbar16a8fb72010-09-29 19:15:29 +000019SVN_REVISION := $(strip \
Jia Liuf8e5d4c2012-03-02 14:37:41 +000020 $(shell $(LLVM_SRC_ROOT)/utils/GetSourceVersion $(PROJ_SRC_DIR)/../..))
Douglas Gregorb8d11912009-10-05 20:33:49 +000021
Daniel Dunbar16a8fb72010-09-29 19:15:29 +000022SVN_REPOSITORY := $(strip \
Jia Liuf8e5d4c2012-03-02 14:37:41 +000023 $(shell $(LLVM_SRC_ROOT)/utils/GetRepositoryPath $(PROJ_SRC_DIR)/../..))
24
25LLVM_REVISION := $(strip \
26 $(shell $(LLVM_SRC_ROOT)/utils/GetSourceVersion $(LLVM_SRC_ROOT)))
27
28LLVM_REPOSITORY := $(strip \
29 $(shell $(LLVM_SRC_ROOT)/utils/GetRepositoryPath $(LLVM_SRC_ROOT)))
Daniel Dunbar640cf372010-09-29 17:57:10 +000030
Douglas Gregorb8d11912009-10-05 20:33:49 +000031CPP.Defines += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include \
Jia Liuf8e5d4c2012-03-02 14:37:41 +000032 -DSVN_REVISION='"$(SVN_REVISION)"' -DSVN_REPOSITORY='"$(SVN_REPOSITORY)"' \
33 -DLLVM_REVISION='"$(LLVM_REVISION)"' -DLLVM_REPOSITORY='"$(LLVM_REPOSITORY)"'
Douglas Gregorb8d11912009-10-05 20:33:49 +000034
35$(ObjDir)/.ver-svn .ver: $(ObjDir)/.dir
Benjamin Krameredd1cae2012-03-02 16:06:37 +000036 @if [ '$(SVN_REVISION) $(LLVM_REVISION)' != '$(shell cat $(ObjDir)/.ver-svn 2>/dev/null)' ]; then\
37 echo '$(SVN_REVISION) $(LLVM_REVISION)' > $(ObjDir)/.ver-svn; \
38 fi
Douglas Gregorb8d11912009-10-05 20:33:49 +000039$(ObjDir)/.ver-svn: .ver
40$(ObjDir)/Version.o: $(ObjDir)/.ver-svn