-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstallhdrs.make
123 lines (106 loc) · 4.2 KB
/
installhdrs.make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
##
# Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
#
# @APPLE_LICENSE_HEADER_START@
#
# The contents of this file constitute Original Code as defined in and
# are subject to the Apple Public Source License Version 1.1 (the
# "License"). You may not use this file except in compliance with the
# License. Please obtain a copy of the License at
# http://www.apple.com/publicsource and read it before using this file.
#
# This Original Code and all software distributed under the License are
# distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
# License for the specific language governing rights and limitations
# under the License.
#
# @APPLE_LICENSE_HEADER_END@
##
#
# installhdrs.make
#
# Rules for installing public and private header files of a project. This
# target is invoked automatically from the install target.
#
# PUBLIC TARGETS
# installhdrs: copies public and private header files to their
# final destination
#
# IMPORTED VARIABLES
# BEFORE_INSTALLHDRS: targets to build before installing headers for a subproject
# AFTER_INSTALLHDRS: targets to build after installing headers for a subproject
#
# EXPORTED VARIABLES
# PUBLIC_HDR_INSTALLDIR: where to install public headers. Don't forget
# to prefix this with DSTROOT when you use it.
# PRIVATE_HDR_INSTALLDIR: where to install private headers. Don't forget
# to prefix this with DSTROOT when you use it.
#
.PHONY: installhdrs local-installhdrs recursive-installhdrs
.PHONY: install-public-headers install-private-headers announce-installhdrs
#
# Variable definitions
#
ACTUAL_INSTALLHDRS = install-public-headers install-private-headers
#
# First we do local installation, then we recurse
#
ifneq "YES" "$(SUPPRESS_BUILD)"
installhdrs: local-installhdrs recursive-installhdrs
recursive-installhdrs: $(ALL_SUBPROJECTS:%=installhdrs@%) local-installhdrs
$(ALL_SUBPROJECTS:%=installhdrs@%): local-installhdrs
endif
#
# Local installation
#
local-installhdrs: announce-installhdrs $(BEFORE_INSTALLHDRS) $(ACTUAL_INSTALLHDRS) $(AFTER_INSTALLHDRS)
$(AFTER_INSTALLHDRS): announce-installhdrs $(BEFORE_INSTALLHDRS) $(ACTUAL_INSTALLHDRS)
$(ACTUAL_INSTALLHDRS): announce-installhdrs $(BEFORE_INSTALLHDRS)
$(BEFORE_INSTALLHDRS): announce-installhdrs
#
# Before we do anything we must announce our intentions
# We don't announce our intentions if we were hooked in from the
# postinstall recursion, since the postinstall has already been announced
#
announce-installhdrs:
ifeq "installhdrs" "$(RECURSING_ON_TARGET)"
ifndef RECURSING
$(SILENT) $(ECHO) Installing header files...
else
$(SILENT) $(ECHO) $(RECURSIVE_ELLIPSIS)in $(NAME)
endif
endif
#
# Ensure that important directories exist
#
installhdrs-directories: $(SFILE_DIR)
#
# If there are any public headers we must copy them to the destination directory
#
ifneq "" "$(PUBLIC_HEADERS)$(OTHER_PUBLIC_HEADERS)"
install-public-headers: installhdrs-directories $(DSTROOT)$(PUBLIC_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(PUBLIC_HEADERS) $(OTHER_PUBLIC_HEADERS)
ifneq "$(PUBLIC_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX)" ""
$(SILENT) $(FASTCP) $(PUBLIC_HEADERS) $(OTHER_PUBLIC_HEADERS) $(DSTROOT)$(PUBLIC_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX)
else
$(SILENT) $(ECHO) Must set a public header directory to install public headers. ; exit 1
endif
endif
#
# The same goes for private headers
#
ifneq "" "$(PRIVATE_HEADERS)$(OTHER_PRIVATE_HEADERS)"
install-private-headers: installhdrs-directories $(DSTROOT)$(PRIVATE_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(PRIVATE_HEADERS) $(OTHER_PRIVATE_HEADERS)
ifneq "$(PRIVATE_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX)" ""
$(SILENT) $(FASTCP) $(PRIVATE_HEADERS) $(OTHER_PRIVATE_HEADERS) $(DSTROOT)$(PRIVATE_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX)
else
$(SILENT) $(ECHO) Must set a private header directory to install private headers. ; exit 1
endif
endif
#
# Rules for creating directories
#
$(DSTROOT)$(PUBLIC_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(DSTROOT)$(PRIVATE_HDR_INSTALLDIR)$(PRIVATE_HEADER_DIR_SUFFIX):
$(MKDIRS) $@