]>
Commit | Line | Data |
---|---|---|
fdbff003 A |
1 | ## |
2 | # Implicit rules | |
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 | ||
28 | ## | |
29 | # Variables | |
30 | ## | |
31 | ||
32 | # CC Options | |
33 | CC_Archs = | |
34 | CC_Debug = -g | |
35 | ifeq ($(DEBUG),YES) | |
36 | CC_Optimize = | |
37 | LD_Prebind = | |
38 | else | |
e050961f | 39 | CC_Optimize = -Os |
fdbff003 A |
40 | endif |
41 | CC_Other = -pipe | |
42 | ||
43 | # OpenStep Frameworks | |
44 | Frameworks = $(Extra_Frameworks) | |
45 | ||
46 | # C Preprocessor Options | |
47 | CPP_Defines = $(Extra_CPP_Defines) | |
48 | CPP_Includes = $(Extra_CPP_Includes) | |
49 | ||
50 | # Linker Options | |
51 | LD_Libraries = $(Extra_LD_Libraries) | |
52 | ||
53 | # CC/CPP/LD Flags | |
54 | CPP_Flags = $(CPP_Defines) $(CPP_Includes) $(Extra_CPP_Flags) | |
55 | LD_Flags = $(CC_Archs) $(Frameworks) $(LD_Libraries) $(Extra_LD_Flags) | |
56 | CC_Flags = $(CC_Archs) $(CC_Debug) $(CC_Optimize) $(CC_Other) $(Extra_CC_Flags) | |
57 | Cxx_Flags = $(CC_Archs) $(CC_Debug) $(CC_Optimize) $(CC_Other) $(Extra_Cxx_Flags) | |
58 | ||
59 | # This is for compatibility with standard implicit rules | |
60 | CPPFLAGS = $(CPP_Flags) | |
61 | CFLAGS = $(CC_Flags) | |
62 | CXXFLAGS = $(Cxx_Flags) | |
63 | LDFLAGS = $(LD_Flags) | |
64 | ||
65 | ## | |
66 | # Targets | |
67 | ## | |
68 | ||
69 | # C / Objective-C / C++ Source | |
70 | ||
71 | %.o: %.c | |
72 | @echo "Compiling "$@"..." | |
73 | $(_v) $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ | |
74 | ||
75 | $(BuildDirectory)/%.o: %.c | |
76 | @echo "Compiling "$@"..." | |
77 | $(_v) $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ | |
78 | ||
79 | $(CC_Excecutable): $(CC_Objects) | |
80 | @echo "Linking "$@"..." | |
81 | $(_v) $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ | |
82 | ||
83 | %: %.o | |
84 | @echo "Linking "$@"..." | |
85 | $(_v) $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ | |
86 | ||
87 | # Shell scripts | |
88 | ||
89 | %: %.sh | |
90 | @echo "Copying shell script "$@"..." | |
91 | $(_v) $(CP) $< $@ | |
92 | $(_v) $(CHMOD) ugo+x $@ | |
93 | ||
94 | $(BuildDirectory)/%: %.sh | |
95 | @echo "Copying shell script "$@"..." | |
96 | $(_v) $(CP) $< $@ | |
97 | $(_v) $(CHMOD) ugo+x $@ |