]> git.saurik.com Git - apple/coreosmakefiles.git/blob - ProjectBuilder/Makefile.Postamble.Common
CoreOSMakefiles-61.tar.gz
[apple/coreosmakefiles.git] / ProjectBuilder / Makefile.Postamble.Common
1 ##
2 # Common ProjectBuilder-style Postamble.
3 #
4 # Wilfredo Sanchez | wsanchez@apple.com
5 # Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
6 #
7 # @APPLE_LICENSE_HEADER_START@
8 #
9 # Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
10 # Reserved. This file contains Original Code and/or Modifications of
11 # Original Code as defined in and that are subject to the Apple Public
12 # Source License Version 1.1 (the "License"). You may not use this file
13 # except in compliance with the License. Please obtain a copy of the
14 # License at http://www.apple.com/publicsource and read it before using
15 # this file.
16 #
17 # The Original Code and all software distributed under the License are
18 # distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19 # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20 # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21 # FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
22 # License for the specific language governing rights and limitations
23 # under the License.
24 #
25 # @APPLE_LICENSE_HEADER_END@
26 ##
27
28 #########################
29 # Overridding variables #
30 #########################
31
32 ##
33 # Permissions
34 ##
35 INSTALL_AS_USER = $(Install_User)
36 INSTALL_AS_GROUP = $(Install_Group)
37 INSTALL_PERMISSIONS = $(Install_Program_Mode)
38
39 ##
40 # This is a command to let you hard link the product to another name.
41 # For example:
42 # AFTER_INSTALL += install-links
43 # install-links:
44 # $(LINKPRODUCT) $(DSTROOT)$(INSTALLDIR)/othername
45 ##
46 LINKPRODUCT = $(LN) -f $(DSTROOT)$(INSTALLDIR)/$(notdir $(PRODUCT))
47
48 ##
49 # If you set SHELLTOOL, then we know your program is a shell script.
50 # There's no need to compile it, just copy and set permissions.
51 ##
52 ifdef SHELLTOOL
53 $(PRODUCT): $(SHELLTOOL)
54 $(_v) $(INSTALL_PROGRAM) -c $(SHELLTOOL) $(PRODUCT)
55 endif
56
57 ##
58 # If the user running make is not root, then you can't do chown.
59 # We want to be able to compile as a regular user without having make
60 # stop due to errors in using chown, so we set CHOWN in that case to
61 # a noop.
62 ##
63 ifneq ($(shell whoami),root)
64 CHOWN = $(TRUE)
65 endif
66
67 ##
68 # PB Makefiles are wierd.
69 # Some some odd reason, RC used to need to set SRCROOT=OBJROOT=SYMROOT and
70 # make clean. That nukes subprojects without .tproj, etc extensions. This
71 # is a bug in PB Makefiles, and the following is a workaround.
72 ##
73 ifeq ($(SYMROOT),$(SRCROOT))
74 PRODUCT =
75 endif
76
77 ##
78 # If we are using shared Makefiles, we should install them with the sources.
79 ##
80 ifneq ($(wildcard Makefiles),)
81 IMPLICIT_SOURCE_FILES += Makefiles
82 endif
83
84 ##
85 # PB want to add "-S" to its strip commands. I don't think so.
86 # For libraries, that's a good default, otherwise, if we want,
87 # we'll ask for it.
88 ##
89 STRIPFLAGS =
90
91 ##
92 # Optimization
93 ##
94 OPTIMIZE_BUILD_CFLAGS = $(CC_Optimize)
95
96 ##
97 # Commands
98 ##
99 MKDIRS = $(MKDIR)
100
101 ###########
102 # Targets #
103 ###########
104
105 install-source:
106 ifneq ($(Install_Source),)
107 $(_v) $(MAKE) installsrc SRCROOT=$(DSTROOT)$(Install_Source)
108 $(_v) $(CHOWN) -R $(INSTALL_AS_USER):$(INSTALL_AS_GROUP) $(DSTROOT)$(Install_Source)
109 $(_v) $(CHMOD) -R -w $(DSTROOT)$(Install_Source)
110 endif
111
112 install-man: $(MANFILES)
113 ifneq ($(strip $(MAN0FILES)),)
114 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN0DIR)
115 $(_v) $(INSTALL_FILE) -c $(MAN1FILES) $(DSTROOT)$(MAN0DIR)
116 endif
117 ifneq ($(strip $(MAN1FILES)),)
118 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN1DIR)
119 $(_v) $(INSTALL_FILE) -c $(MAN1FILES) $(DSTROOT)$(MAN1DIR)
120 endif
121 ifneq ($(strip $(MAN2FILES)),)
122 $(_v) $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN2DIR)
123 $(_v) $(_v) $(INSTALL_FILE) -c $(MAN2FILES) $(DSTROOT)$(MAN2DIR)
124 endif
125 ifneq ($(strip $(MAN3FILES)),)
126 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN3DIR)
127 $(_v) $(INSTALL_FILE) -c $(MAN3FILES) $(DSTROOT)$(MAN3DIR)
128 endif
129 ifneq ($(strip $(MAN4FILES)),)
130 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN4DIR)
131 $(_v) $(INSTALL_FILE) -c $(MAN4FILES) $(DSTROOT)$(MAN4DIR)
132 endif
133 ifneq ($(strip $(MAN5FILES)),)
134 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN5DIR)
135 $(_v) $(INSTALL_FILE) -c $(MAN5FILES) $(DSTROOT)$(MAN5DIR)
136 endif
137 ifneq ($(strip $(MAN6FILES)),)
138 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN6DIR)
139 $(_v) $(INSTALL_FILE) -c $(MAN6FILES) $(DSTROOT)$(MAN6DIR)
140 endif
141 ifneq ($(strip $(MAN7FILES)),)
142 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN7DIR)
143 $(_v) $(INSTALL_FILE) -c $(MAN7FILES) $(DSTROOT)$(MAN7DIR)
144 endif
145 ifneq ($(strip $(MAN8FILES)),)
146 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN8DIR)
147 $(_v) $(INSTALL_FILE) -c $(MAN8FILES) $(DSTROOT)$(MAN8DIR)
148 endif
149 ifneq ($(strip $(MAN9FILES)),)
150 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN9DIR)
151 $(_v) $(INSTALL_FILE) -c $(MAN9FILES) $(DSTROOT)$(MAN9DIR)
152 endif
153
154 ##
155 # Libraries
156 ##
157
158 ifeq ($(PROJTYPE),LIBRARY)
159
160 # Don't strip all symbols
161 STRIPFLAGS = -S
162
163 # PB uses this recursively
164 INSTALL_PERMISSIONS = ugo+rX
165
166 # Create an object file list
167 install-ofilelist::
168 echo $(OFILES) | $(FMT) -1 > $(OFILE_DIR)/$(NAME).ofileList
169 $(CHMOD) 444 $(OFILE_DIR)/$(NAME).ofileList
170
171 endif
172
173 ##
174 # Frameworks
175 ##
176
177 ifeq ($(PROJECT_TYPE),Framework)
178
179 # Don't strip all symbols
180 STRIPFLAGS = -S
181
182 # PB uses this recursively
183 INSTALL_PERMISSIONS = ugo+rX
184
185 # PB creates this bogus ObjC file ($(DUMMY_SYMBOL_FILE)) and wants to link it
186 # into the framework. We don't want ObjC loading into clients of this framework,
187 # so we filter it our from the $(LOADABLES) list, and remove the info file that
188 # goes with it from the $(OTHER_INFO_FILES) list.
189 LOADABLES := $(patsubst $(DUMMY_SYMBOL).o,,$(LOADABLES))
190 OTHER_INFO_FILES := $(patsubst $(DUMMY_SYMBOL_INFO_FILE),,$(OTHER_INFO_FILES))
191
192 endif
193
194 ##
195 # Bundles
196 ##
197
198 ifeq ($(PROJECT_TYPE),Loadable Bundle)
199
200 # Don't strip all symbols
201 STRIPFLAGS = -S
202
203 # PB uses this recursively
204 INSTALL_PERMISSIONS = ugo+rX
205
206 endif