Mercurial > ecos-v3_0-branch
annotate packages/pkgconf/makevars @ 66:bf00f99aec69 ecos-sw-2000-02-02
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
| author | jlarmour |
|---|---|
| date | Wed, 02 Feb 2000 19:57:02 +0000 |
| parents | c38311975d4f |
| children |
| rev | line source |
|---|---|
| 0 | 1 #=============================================================================== |
| 2 # | |
| 3 # makevars | |
| 4 # | |
| 5 # This file allows users to control some aspects of the build process. | |
| 6 # | |
| 7 #=============================================================================== | |
| 8 #####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
9 # |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
10 # ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
11 # The contents of this file are subject to the Red Hat eCos Public License |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
12 # Version 1.1 (the "License"); you may not use this file except in |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
13 # compliance with the License. You may obtain a copy of the License at |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
14 # http://www.redhat.com/ |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
15 # |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
16 # Software distributed under the License is distributed on an "AS IS" |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
17 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
18 # License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
19 # the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
20 # |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
21 # The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
22 # released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
23 # |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
24 # The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
25 # Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
26 # Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
27 # All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
28 # ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
4
diff
changeset
|
29 # |
| 0 | 30 #####COPYRIGHTEND#### |
| 31 #=============================================================================== | |
| 32 | |
| 33 # | |
| 34 # Some of the commands used to do builds should generally be specified by | |
| 35 # pkgconf. This is because the commands are target-specific, and it is | |
| 36 # pkgconf that knows about the target architecture and the information held | |
| 37 # in the targets file. Never the less it is desirable to allow users to | |
| 38 # redefine the commands. | |
| 39 # | |
| 40 # First, make automatically defines a number of variables unless it is | |
| 41 # given the -r or --no-builtin-rules arguments. The built-in values are | |
| 42 # unlikely to be correct when doing cross compilation. The following | |
| 43 # checks eliminate any such built-in definitions. | |
| 44 ifeq ($(origin CC),default) | |
| 45 CC := | |
| 46 endif | |
| 47 ifeq ($(origin CXX),default) | |
| 48 CXX := | |
| 49 endif | |
| 50 ifeq ($(origin AR),default) | |
| 51 AR := | |
| 52 endif | |
| 53 ifeq ($(origin LD),default) | |
| 54 LD := | |
| 55 endif | |
| 56 ifeq ($(origin CP),default) | |
| 57 CP := | |
| 58 endif | |
| 59 ifeq ($(origin RM),default) | |
| 60 RM := | |
| 61 endif | |
| 62 ifeq ($(origin TOUCH),default) | |
| 63 TOUCH := | |
| 64 endif | |
| 65 ifeq ($(origin CAT),default) | |
| 66 CAT := | |
| 67 endif | |
| 68 ifeq ($(origin TAIL),default) | |
| 69 TAIL := | |
| 70 endif | |
| 71 | |
| 72 # | |
| 73 # At this stage all of the variables identifying commands will be empty | |
| 74 # or undefined strings, or they will have been set on the make command | |
| 75 # line or in environment variables. | |
| 76 # | |
| 77 # For each command that is not currently defined, a default value | |
| 78 # is defined here. Users may make a persistent change to the commands by | |
| 79 # commenting out the default value and filling in an alternative one. | |
| 80 # | |
| 81 ifeq ($(CC),) | |
| 82 CC := $(PKGCONF_CC) | |
| 83 #CC := | |
| 84 endif | |
| 85 ifeq ($(CXX),) | |
| 86 CXX := $(PKGCONF_CXX) | |
| 87 #CXX := | |
| 88 endif | |
| 89 ifeq ($(AR),) | |
| 90 AR := $(PKGCONF_AR) | |
| 91 #AR := | |
| 92 endif | |
| 93 ifeq ($(LD),) | |
| 94 LD := $(PKGCONF_LD) | |
| 95 #LD := | |
| 96 endif | |
| 97 ifeq ($(OBJCOPY),) | |
| 98 OBJCOPY := $(PKGCONF_OBJCOPY) | |
| 99 #OBJCOPY := | |
| 100 endif | |
| 101 ifeq ($(CP),) | |
| 102 CP := install -m 0644 | |
| 103 #CP := | |
| 104 endif | |
| 105 ifeq ($(RM),) | |
| 106 RM := rm -f | |
| 107 #RM := | |
| 108 endif | |
| 109 ifeq ($(TOUCH),) | |
| 110 TOUCH := touch | |
| 111 #TOUCH := | |
| 112 endif | |
| 113 ifeq ($(CAT),) | |
| 114 CAT := cat | |
| 115 #CAT := | |
| 116 endif | |
| 117 ifeq ($(TAIL),) | |
| 118 TAIL := tail | |
| 119 #tail := | |
| 120 endif | |
| 121 | |
| 122 # | |
| 123 # Next deal with the various compiler flags. None of the flags should | |
| 124 # conflict with any built-in variables, so it is sufficient to check | |
| 125 # that a given flag has not been defined on the make command line or via | |
| 126 # an environment variable. | |
| 127 # | |
| 128 # As with the command variables, users can disable the default | |
| 129 # settings by commenting out one line and filling in the next line. | |
| 130 # | |
| 131 # There are five categories of flags: | |
| 132 # 1) architecture-related, i.e. -mthis -mthat -mthe-other | |
| 133 # 2) error and warning related, e.g. -Wall -Werror | |
| 134 # 3) language-related, e.g. -fno-rtti for C++ code | |
| 135 # 4) debug and code generation, e.g. -g -O2 | |
| 136 # 5) everything else, e.g. -DCYG_RELEASE_DEBUG | |
| 137 # | |
| 138 # For each category there are four variables. The first one, e.g. | |
| 139 # ARCHFLAGS, is used for all build operations. The second, e.g. | |
| 140 # CARCHFLAGS, is used only when compiling to C code (in addition to | |
| 141 # the generic ARCHFLAGS). The third, e.g. CXXARCHFLAGS is used when | |
| 142 # compiling C++ code and the last, LDARCHFLAGS, is used when linking | |
| 143 # executables (typically test programs). | |
| 144 # | |
| 145 | |
| 146 ifeq ($(ARCHFLAGS),) | |
| 147 ARCHFLAGS := $(PKGCONF_ARCHFLAGS) | |
| 148 #ARCHFLAGS := | |
| 149 endif | |
| 150 ifeq ($(CARCHFLAGS),) | |
| 151 CARCHFLAGS := $(PKGCONF_CARCHFLAGS) | |
| 152 #CARCHFLAGS := | |
| 153 endif | |
| 154 ifeq ($(CXXARCHFLAGS),) | |
| 155 CXXARCHFLAGS := $(PKGCONF_CXXARCHFLAGS) | |
| 156 #CXXARCHFLAGS := | |
| 157 endif | |
| 158 ifeq ($(LDARCHFLAGS),) | |
| 159 LDARCHFLAGS := $(PKGCONF_LDARCHFLAGS) | |
| 160 #LDARCHFLAGS := | |
| 161 endif | |
| 162 ifeq ($(ERRFLAGS),) | |
| 163 ERRFLAGS := $(PKGCONF_ERRFLAGS) | |
| 164 #ERRFLAGS := | |
| 165 endif | |
| 166 ifeq ($(CERRFLAGS),) | |
| 167 CERRFLAGS := $(PKGCONF_CERRFLAGS) | |
| 168 #CERRFLAGS := | |
| 169 endif | |
| 170 ifeq ($(CXXERRFLAGS),) | |
| 171 CXXERRFLAGS := $(PKGCONF_CXXERRFLAGS) | |
| 172 #CXXERRFLAGS := | |
| 173 endif | |
| 174 ifeq ($(LDERRFLAGS),) | |
| 175 LDERRFLAGS := $(PKGCONF_LDERRFLAGS) | |
| 176 #LDERRFLAGS := | |
| 177 endif | |
| 178 ifeq ($(LANGFLAGS),) | |
| 179 LANGFLAGS := $(PKGCONF_LANGFLAGS) | |
| 180 #LANGFLAGS := | |
| 181 endif | |
| 182 ifeq ($(CLANGFLAGS),) | |
| 183 CLANGFLAGS := $(PKGCONF_CLANGFLAGS) | |
| 184 #CLANGFLAGS := | |
| 185 endif | |
| 186 ifeq ($(CXXLANGFLAGS),) | |
| 187 CXXLANGFLAGS := $(PKGCONF_CXXLANGFLAGS) | |
| 188 #CXXLANGFLAGS := | |
| 189 endif | |
| 190 ifeq ($(LDLANGFLAGS),) | |
| 191 LDLANGFLAGS := $(PKGCONF_LDLANGFLAGS) | |
| 192 #LDLANGFLAGS := | |
| 193 endif | |
| 194 ifeq ($(DBGFLAGS),) | |
| 195 DBGFLAGS := $(PKGCONF_DBGFLAGS) | |
| 196 #DBGFLAGS := | |
| 197 endif | |
| 198 ifeq ($(CDBGFLAGS),) | |
| 199 CDBGFLAGS := $(PKGCONF_CDBGFLAGS) | |
| 200 #CDBGFLAGS := | |
| 201 endif | |
| 202 ifeq ($(CXXDBGFLAGS),) | |
| 203 CXXDBGFLAGS := $(PKGCONF_CXXDBGFLAGS) | |
| 204 #CXXDBGFLAGS := | |
| 205 endif | |
| 206 ifeq ($(LDDBGFLAGS),) | |
| 207 LDDBGFLAGS := $(PKGCONF_LDDBGFLAGS) | |
| 208 #LDDBGFLAGS := | |
| 209 endif | |
| 210 ifeq ($(EXTRAFLAGS),) | |
| 211 EXTRAFLAGS := $(PKGCONF_EXTRAFLAGS) | |
| 212 #EXTRAFLAGS := | |
| 213 endif | |
| 214 ifeq ($(CEXTRAFLAGS),) | |
| 215 CEXTRAFLAGS := $(PKGCONF_CEXTRAFLAGS) | |
| 216 #CEXTRAFLAGS := | |
| 217 endif | |
| 218 ifeq ($(CXXEXTRAFLAGS),) | |
| 219 CXXEXTRAFLAGS := $(PKGCONF_CXXEXTRAFLAGS) | |
| 220 #CXXEXTRAFLAGS := | |
| 221 endif | |
| 222 ifeq ($(LDEXTRAFLAGS),) | |
| 223 LDEXTRAFLAGS := $(PKGCONF_LDEXTRAFLAGS) | |
| 224 #LDEXTRAFLAGS := | |
| 225 endif | |
| 226 | |
| 227 # | |
| 228 # Now combine all the above flags, so that the build rules are actually legible. | |
| 229 # | |
| 230 CFLAGS := $(ARCHFLAGS) $(CARCHFLAGS) | |
| 231 CFLAGS := $(CFLAGS) $(ERRFLAGS) $(CERRFLAGS) | |
| 232 CFLAGS := $(CFLAGS) $(LANGFLAGS) $(CLANGFLAGS) | |
| 233 CFLAGS := $(CFLAGS) $(DBGFLAGS) $(CDBGFLAGS) | |
| 234 CFLAGS := $(CFLAGS) $(EXTRAFLAGS) $(CEXTRAFLAGS) | |
| 235 CFLAGS := $(strip $(CFLAGS)) | |
| 236 | |
| 237 CXXFLAGS := $(ARCHFLAGS) $(CXXARCHFLAGS) | |
| 238 CXXFLAGS := $(CXXFLAGS) $(ERRFLAGS) $(CXXERRFLAGS) | |
| 239 CXXFLAGS := $(CXXFLAGS) $(LANGFLAGS) $(CXXLANGFLAGS) | |
| 240 CXXFLAGS := $(CXXFLAGS) $(DBGFLAGS) $(CXXDBGFLAGS) | |
| 241 CXXFLAGS := $(CXXFLAGS) $(EXTRAFLAGS) $(CXXEXTRAFLAGS) | |
| 242 CXXFLAGS := $(strip $(CXXFLAGS)) | |
| 243 | |
| 244 LDFLAGS := $(ARCHFLAGS) $(LDARCHFLAGS) | |
| 245 LDFLAGS := $(LDFLAGS) $(ERRFLAGS) $(LDERRFLAGS) | |
| 246 LDFLAGS := $(LDFLAGS) $(LANGFLAGS) $(LDLANGFLAGS) | |
| 247 LDFLAGS := $(LDFLAGS) $(DBGFLAGS) $(LDDBGFLAGS) | |
| 248 LDFLAGS := $(LDFLAGS) $(EXTRAFLAGS) $(LDEXTRAFLAGS) | |
| 249 LDFLAGS := $(strip $(LDFLAGS)) | |
| 250 | |
| 251 # | |
| 252 # Clear the default INCLUDE_PATH. This will be set up in | |
| 253 # makrules.src et al. on the basis of the VPATH environment | |
| 254 # variable. | |
| 255 INCLUDE_PATH := | |
| 256 | |
| 257 # | |
| 258 # Finally, it is possible for users to change the rules that actually | |
| 259 # perform most of the build operations. | |
| 260 | |
| 261 $(PACKAGE)_%.o : %.c | |
| 2 | 262 $(CC) -c $(INCLUDE_PATH) $(CFLAGS) $($(notdir $<)-CFLAGS) -Wp,-MD,$(@:.o=.tmp) -o $@ $< |
| 263 @echo > $(@:.o=.d) | |
| 264 @echo $@ ':' $< '\' >> $(@:.o=.d) | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
265 @$(TAIL) +2 $(@:.o=.tmp) >> $(@:.o=.d) |
| 0 | 266 @$(RM) $(@:.o=.tmp) |
| 267 | |
| 268 $(PACKAGE)_%.o : %.cxx | |
| 2 | 269 $(CXX) -c $(INCLUDE_PATH) $(CXXFLAGS) $($(notdir $<)-CXXFLAGS) -Wp,-MD,$(@:.o=.tmp) -o $@ $< |
| 270 @echo > $(@:.o=.d) | |
| 271 @echo $@ ':' $< '\' >> $(@:.o=.d) | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
272 @$(TAIL) +2 $(@:.o=.tmp) >> $(@:.o=.d) |
| 0 | 273 @$(RM) $(@:.o=.tmp) |
| 274 | |
| 275 $(PACKAGE)_%.o : %.S | |
| 276 $(CXX) -c $(INCLUDE_PATH) $(CFLAGS) -Wp,-MD,$(@:.o=.tmp) -o $@ $< | |
| 2 | 277 @echo > $(@:.o=.d) |
| 278 @echo $@ ':' $< '\' >> $(@:.o=.d) | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
279 @$(TAIL) +2 $(@:.o=.tmp) >> $(@:.o=.d) |
| 0 | 280 @$(RM) $(@:.o=.tmp) |
| 281 | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
282 $(PREFIX)/lib/libextras.a(%) : % |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
283 $(AR) rcs $(PREFIX)/lib/libextras.a $< |
