]>
Commit | Line | Data |
---|---|---|
fdbff003 A |
1 | ## |
2 | # Makefile for Apple Release Control (GNU source projects) | |
3 | # | |
4 | # Wilfredo Sanchez | wsanchez@apple.com | |
5 | # Copyright (c) 1997-1999 Apple Computer, Inc. | |
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 | # Set these variables as needed, then include this file, then: | |
28 | # | |
29 | # Install_Prefix [ $(USRDIR) ] | |
30 | # Install_Man [ $(MANDIR) ] | |
31 | # Install_Info [ $(SHAREDIR)/info ] | |
32 | # Install_HTML [ <depends> ] | |
33 | # Install_Source [ $(NSSOURCEDIR)/Commands/$(ProjectName) ] | |
34 | # Configure [ $(Sources)/configure ] | |
35 | # Extra_Configure_Flags | |
36 | # Extra_Install_Flags | |
37 | # Passed_Targets [ check ] | |
38 | # | |
39 | # Additional variables inherited from ReleaseControl/Common.make | |
40 | ## | |
41 | ||
42 | ifndef CoreOSMakefiles | |
43 | CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS | |
44 | endif | |
45 | ||
46 | Passed_Targets += check | |
47 | ||
48 | include $(CoreOSMakefiles)/ReleaseControl/Common.make | |
49 | ||
50 | ## | |
51 | # My variables | |
52 | ## | |
53 | ||
54 | Sources = $(SRCROOT)/$(Project) | |
55 | ConfigStamp = $(BuildDirectory)/configure-stamp | |
56 | ||
57 | ifndef Install_Prefix | |
58 | Install_Prefix = $(USRDIR) | |
59 | endif | |
60 | ifndef Install_Man | |
61 | Install_Man = $(MANDIR) | |
62 | endif | |
63 | ifndef Install_Info | |
64 | Install_Info = $(SHAREDIR)/info | |
65 | endif | |
66 | ifndef Install_HTML | |
67 | ifeq "$(UserType)" "Developer" | |
a44896e3 | 68 | Install_HTML = $(SYSTEM_DEVELOPER_TOOLS_DOC_DIR)/$(ProjectName) |
fdbff003 A |
69 | else |
70 | Install_HTML = $(NSDOCUMENTATIONDIR)/$(ToolType)/$(ProjectName) | |
71 | endif | |
72 | endif | |
73 | ifndef Install_Source | |
74 | Install_Source = $(NSSOURCEDIR)/$(ToolType)/$(ProjectName) | |
75 | endif | |
76 | ||
77 | RC_Install_Prefix = $(DSTROOT)$(Install_Prefix) | |
78 | RC_Install_Man = $(DSTROOT)$(Install_Man) | |
79 | RC_Install_Info = $(DSTROOT)$(Install_Info) | |
80 | RC_Install_HTML = $(DSTROOT)$(Install_HTML) | |
81 | ifneq ($(Install_Source),) | |
82 | RC_Install_Source = $(DSTROOT)$(Install_Source) | |
83 | endif | |
84 | ||
85 | ifndef Configure | |
86 | Configure = $(Sources)/configure | |
87 | endif | |
88 | ||
89 | Environment += TEXI2HTML="$(TEXI2HTML) -subdir ." | |
90 | ||
75f10a5b A |
91 | # 4158518: gcc-4.0 no longer allows multiple archs with -M*, so projects |
92 | # that have dependency tracking on by default, fail. So we set | |
93 | # --disable-dependency-tracking to turn off dependency tracking. | |
fdbff003 A |
94 | Configure_Flags = --prefix="$(Install_Prefix)" \ |
95 | --mandir="$(Install_Man)" \ | |
75f10a5b A |
96 | --infodir="$(Install_Info)" \ |
97 | --disable-dependency-tracking \ | |
fdbff003 A |
98 | $(Extra_Configure_Flags) |
99 | ||
51ef2a1e A |
100 | ifndef Configure_Products |
101 | Configure_Products = config.h config.log | |
102 | endif | |
103 | ||
104 | # for backwards compatibility; many projects will probably want to override this | |
105 | Extra_Make_Flags ?= $(Environment) | |
106 | ||
107 | Make_Flags = $(Extra_Make_Flags) | |
108 | ||
fdbff003 A |
109 | Install_Flags = prefix="$(RC_Install_Prefix)" \ |
110 | mandir="$(RC_Install_Man)" \ | |
111 | infodir="$(RC_Install_Info)" \ | |
112 | htmldir="$(RC_Install_HTML)" \ | |
113 | $(Extra_Install_Flags) | |
114 | ||
115 | Install_Target = install-strip | |
116 | ||
117 | ## | |
118 | # Targets | |
119 | ## | |
120 | ||
121 | .PHONY: configure almostclean | |
122 | ||
123 | install:: build | |
124 | ifneq ($(GnuNoInstall),YES) | |
125 | @echo "Installing $(Project)..." | |
51ef2a1e | 126 | $(_v) umask $(Install_Mask) ; $(MAKE) -C $(BuildDirectory) $(Make_Flags) $(Install_Flags) $(Install_Target) |
a44896e3 A |
127 | $(_v) $(FIND) $(DSTROOT) $(Find_Cruft) -depth -exec $(RMDIR) "{}" \; |
128 | $(_v) $(FIND) $(SYMROOT) $(Find_Cruft) -depth -exec $(RMDIR) "{}" \; | |
fdbff003 | 129 | ifneq ($(GnuNoChown),YES) |
e50bb073 | 130 | $(_v)- $(CHOWN) -R $(Install_User):$(Install_Group) $(DSTROOT) $(SYMROOT) |
fdbff003 A |
131 | endif |
132 | endif | |
133 | ifdef GnuAfterInstall | |
134 | $(_v) $(MAKE) $(GnuAfterInstall) | |
135 | endif | |
136 | ||
137 | build:: configure | |
138 | ifneq ($(GnuNoBuild),YES) | |
139 | @echo "Building $(Project)..." | |
51ef2a1e | 140 | $(_v) $(MAKE) -C $(BuildDirectory) $(Make_Flags) |
fdbff003 A |
141 | endif |
142 | ||
143 | configure:: lazy_install_source $(ConfigStamp) | |
144 | ||
145 | reconfigure:: | |
146 | $(_v) $(RM) $(ConfigStamp) | |
147 | $(_v) $(MAKE) configure | |
148 | ||
149 | $(ConfigStamp): | |
150 | ifneq ($(GnuNoConfigure),YES) | |
151 | @echo "Configuring $(Project)..." | |
152 | $(_v) $(MKDIR) $(BuildDirectory) | |
611bdc3f | 153 | # Disable LD_TRACE_FILE during configure |
51ef2a1e A |
154 | $(_v) cd $(BuildDirectory) && $(Environment) $(Extra_Configure_Environment) LD_TRACE_FILE=/dev/null $(Configure) $(Configure_Flags) |
155 | ifneq ($(Configure_Products),) | |
156 | $(_v) - $(CP) $(foreach PRODUCT,$(Configure_Products),$(BuildDirectory)/$(PRODUCT)) $(SYMROOT) | |
157 | endif | |
fdbff003 A |
158 | endif |
159 | $(_v) touch $@ | |
160 | ||
161 | almostclean:: | |
162 | ifneq ($(GnuNoClean),YES) | |
163 | @echo "Cleaning $(Project)..." | |
164 | $(_v) $(MAKE) -C $(BuildDirectory) clean | |
165 | endif |