blob: cb36e84319a14ec24dfe18ae40ff1a3a29611567 [file] [log] [blame]
Chris Lattnerbda0b622008-03-15 23:59:48 +00001##===- clang/lib/Headers/Makefile --------------------------*- Makefile -*-===##
Chris Lattneraba51222008-03-03 01:22:28 +00002#
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
Chris Lattnerbda0b622008-03-15 23:59:48 +000010LEVEL = ../../../..
Chris Lattneraba51222008-03-03 01:22:28 +000011include $(LEVEL)/Makefile.common
12
Mike Stumpf918b8f2009-09-16 01:26:05 +000013CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER)
14
15HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)/include
Chris Lattneraba51222008-03-03 01:22:28 +000016
17HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h))
18
19OBJHEADERS := $(addprefix $(HeaderDir)/, $(HEADERS))
20
21
22$(OBJHEADERS): $(HeaderDir)/%.h: $(PROJ_SRC_DIR)/%.h $(HeaderDir)/.dir
Chris Lattner0ec82422008-03-09 01:29:23 +000023 $(Verb) cp $< $@
Daniel Dunbaradcf5b32009-02-21 20:52:41 +000024 $(Echo) Copying $(notdir $<) to build dir
25
Chris Lattneraba51222008-03-03 01:22:28 +000026# Hook into the standard Makefile rules.
27all-local:: $(OBJHEADERS)
28
Mike Stumpf918b8f2009-09-16 01:26:05 +000029PROJ_headers := $(DESTDIR)$(PROJ_prefix)/lib/clang/$(CLANG_VERSION)/include
Chris Lattneraba51222008-03-03 01:22:28 +000030
31INSTHEADERS := $(addprefix $(PROJ_headers)/, $(HEADERS))
32
Mike Stump37338312009-01-22 02:53:03 +000033$(PROJ_headers):
34 $(Verb) $(MKDIR) $@
35
36$(INSTHEADERS): $(PROJ_headers)/%.h: $(HeaderDir)/%.h | $(PROJ_headers)
Chris Lattneraba51222008-03-03 01:22:28 +000037 $(Verb) $(DataInstall) $< $(PROJ_headers)
Daniel Dunbaradcf5b32009-02-21 20:52:41 +000038 $(Echo) Installing compiler include file: $(notdir $<)
Chris Lattneraba51222008-03-03 01:22:28 +000039
40install-local:: $(INSTHEADERS)