-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreinstall.make
64 lines (54 loc) · 2.43 KB
/
reinstall.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
##
# 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@
##
#
# reinstall.make
#
# Rules for rebuilding an installed set of products for Windows, were we can
# not strip binaries after they are linked. Instead, we clone all the object
# files and strip them individually, creating a new set of directories to link from.
#
STRIPNAME = STRIPPED
GARBAGE += $(OBJROOT)/$(STRIPNAME) $(SYMROOT)/$(STRIPNAME)
ifeq "$(REINSTALLING)" "YES"
ifneq "$(STRIP_ON_INSTALL)" "NO"
STRIPO = $(NEXT_ROOT)$(SYSTEM_DEVELOPER_DIR)/Libraries/gcc-lib/$(ARCH)/StabsToCodeview.exe
STRIPDIRS = $(OBJROOT)/$(STRIPNAME) $(SYMROOT)/$(STRIPNAME)
CLONE_AND_STRIP = $(FIND) . '(' -name $(STRIPNAME) -prune ')' \
-o '(' -name lastbuildtimes -prune ')' \
-o '(' -type d -exec $(MKDIRS) $(STRIPNAME)/'{}' ';' ')' \
-o '(' -name '*.exe' -o -name '*.dll' -o -name '*.lib' -name 'lib*.a' ')' \
-o '(' -name '*.EXE' -o -name '*.DLL' -o -name '*.LIB' -name 'LIB*.A' ')' \
-o '(' -name '*.ofileList' -o -name '*.ofilelist' ')' \
-o '(' -name '*.o' -exec $(STRIPO) -g0 '{}' -o $(STRIPNAME)/'{}' ';' ')' \
-o -exec $(CP) -p '{}' $(STRIPNAME)/'{}' ';'
.PHONY: clone_and_strip reinstall-stripped
clone_and_strip:
$(MKDIRS) $(OBJROOT)/$(STRIPNAME) $(SYMROOT)/$(STRIPNAME)
cd $(OBJROOT) && $(CLONE_AND_STRIP)
cd $(SYMROOT) && $(CLONE_AND_STRIP)
reinstall-stripped: clone_and_strip
$(SILENT)if $(ECHO) $(OBJROOT) | $(GREP) -v $(STRIPNAME) $(BURY_STDERR) ; then \
cmd='$(MAKE) install OBJROOT=$(OBJROOT)/$(STRIPNAME) SYMROOT=$(SYMROOT)/$(STRIPNAME) DEBUG_SYMBOLS_CFLAG= SKIP_EXPORTING_HEADERS=YES' ; \
$(ECHO) $$cmd ; $$cmd ; \
fi
endif
endif