]> git.saurik.com Git - apple/coreosmakefiles.git/blame_incremental - ProjectBuilder/Makefile.Postamble.Common
CoreOSMakefiles-61.tar.gz
[apple/coreosmakefiles.git] / ProjectBuilder / Makefile.Postamble.Common
... / ...
CommitLineData
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##
35INSTALL_AS_USER = $(Install_User)
36INSTALL_AS_GROUP = $(Install_Group)
37INSTALL_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##
46LINKPRODUCT = $(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##
52ifdef SHELLTOOL
53$(PRODUCT): $(SHELLTOOL)
54 $(_v) $(INSTALL_PROGRAM) -c $(SHELLTOOL) $(PRODUCT)
55endif
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##
63ifneq ($(shell whoami),root)
64CHOWN = $(TRUE)
65endif
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##
73ifeq ($(SYMROOT),$(SRCROOT))
74PRODUCT =
75endif
76
77##
78# If we are using shared Makefiles, we should install them with the sources.
79##
80ifneq ($(wildcard Makefiles),)
81IMPLICIT_SOURCE_FILES += Makefiles
82endif
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##
89STRIPFLAGS =
90
91##
92# Optimization
93##
94OPTIMIZE_BUILD_CFLAGS = $(CC_Optimize)
95
96##
97# Commands
98##
99MKDIRS = $(MKDIR)
100
101###########
102# Targets #
103###########
104
105install-source:
106ifneq ($(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)
110endif
111
112install-man: $(MANFILES)
113ifneq ($(strip $(MAN0FILES)),)
114 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN0DIR)
115 $(_v) $(INSTALL_FILE) -c $(MAN1FILES) $(DSTROOT)$(MAN0DIR)
116endif
117ifneq ($(strip $(MAN1FILES)),)
118 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN1DIR)
119 $(_v) $(INSTALL_FILE) -c $(MAN1FILES) $(DSTROOT)$(MAN1DIR)
120endif
121ifneq ($(strip $(MAN2FILES)),)
122 $(_v) $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN2DIR)
123 $(_v) $(_v) $(INSTALL_FILE) -c $(MAN2FILES) $(DSTROOT)$(MAN2DIR)
124endif
125ifneq ($(strip $(MAN3FILES)),)
126 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN3DIR)
127 $(_v) $(INSTALL_FILE) -c $(MAN3FILES) $(DSTROOT)$(MAN3DIR)
128endif
129ifneq ($(strip $(MAN4FILES)),)
130 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN4DIR)
131 $(_v) $(INSTALL_FILE) -c $(MAN4FILES) $(DSTROOT)$(MAN4DIR)
132endif
133ifneq ($(strip $(MAN5FILES)),)
134 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN5DIR)
135 $(_v) $(INSTALL_FILE) -c $(MAN5FILES) $(DSTROOT)$(MAN5DIR)
136endif
137ifneq ($(strip $(MAN6FILES)),)
138 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN6DIR)
139 $(_v) $(INSTALL_FILE) -c $(MAN6FILES) $(DSTROOT)$(MAN6DIR)
140endif
141ifneq ($(strip $(MAN7FILES)),)
142 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN7DIR)
143 $(_v) $(INSTALL_FILE) -c $(MAN7FILES) $(DSTROOT)$(MAN7DIR)
144endif
145ifneq ($(strip $(MAN8FILES)),)
146 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN8DIR)
147 $(_v) $(INSTALL_FILE) -c $(MAN8FILES) $(DSTROOT)$(MAN8DIR)
148endif
149ifneq ($(strip $(MAN9FILES)),)
150 $(_v) $(INSTALL_DIRECTORY) $(DSTROOT)$(MAN9DIR)
151 $(_v) $(INSTALL_FILE) -c $(MAN9FILES) $(DSTROOT)$(MAN9DIR)
152endif
153
154##
155# Libraries
156##
157
158ifeq ($(PROJTYPE),LIBRARY)
159
160# Don't strip all symbols
161STRIPFLAGS = -S
162
163# PB uses this recursively
164INSTALL_PERMISSIONS = ugo+rX
165
166# Create an object file list
167install-ofilelist::
168 echo $(OFILES) | $(FMT) -1 > $(OFILE_DIR)/$(NAME).ofileList
169 $(CHMOD) 444 $(OFILE_DIR)/$(NAME).ofileList
170
171endif
172
173##
174# Frameworks
175##
176
177ifeq ($(PROJECT_TYPE),Framework)
178
179# Don't strip all symbols
180STRIPFLAGS = -S
181
182# PB uses this recursively
183INSTALL_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.
189LOADABLES := $(patsubst $(DUMMY_SYMBOL).o,,$(LOADABLES))
190OTHER_INFO_FILES := $(patsubst $(DUMMY_SYMBOL_INFO_FILE),,$(OTHER_INFO_FILES))
191
192endif
193
194##
195# Bundles
196##
197
198ifeq ($(PROJECT_TYPE),Loadable Bundle)
199
200# Don't strip all symbols
201STRIPFLAGS = -S
202
203# PB uses this recursively
204INSTALL_PERMISSIONS = ugo+rX
205
206endif