| 1 | # $Id: process.forwarder.mak,v 1.16 2002-09-20 03:38:43 bird Exp $
|
|---|
| 2 |
|
|---|
| 3 | #
|
|---|
| 4 | # Generic makefile system.
|
|---|
| 5 | #
|
|---|
| 6 | # The common build process rules for the case
|
|---|
| 7 | # where we forward to a different compiler environment.
|
|---|
| 8 | #
|
|---|
| 9 | # Note: this makefile is supposed to be included from the
|
|---|
| 10 | # current source path.
|
|---|
| 11 | #
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | # -----------------------------------------------------------------------------
|
|---|
| 15 | # Assertions.
|
|---|
| 16 | # This makefile expects setup.mak and the specific setup to be included
|
|---|
| 17 | # already.
|
|---|
| 18 | # It also requires the TARGET_NAME to be specified in the makefile.
|
|---|
| 19 | # -----------------------------------------------------------------------------
|
|---|
| 20 | !if "$(MAKE_SETUP_INCLUDED)" != "YES"
|
|---|
| 21 | !error Fatal error: You must include setup.mak before process.mak in the makefile.
|
|---|
| 22 | !endif
|
|---|
| 23 | !if "$(ENV_STATUS)" != "OK"
|
|---|
| 24 | !error Fatal error: The environment is not valid. Bad setup.mak?
|
|---|
| 25 | !endif
|
|---|
| 26 |
|
|---|
| 27 | !if "$(TARGET_NAME)" == "" && "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "DEPEND"
|
|---|
| 28 | !error Fatal error: TARGET_NAME is not defined! Should be set in the makefile.
|
|---|
| 29 | !endif
|
|---|
| 30 |
|
|---|
| 31 | # -----------------------------------------------------------------------------
|
|---|
| 32 | # Set necessary defaults.
|
|---|
| 33 | # -----------------------------------------------------------------------------
|
|---|
| 34 |
|
|---|
| 35 | # just make it shut up for now.
|
|---|
| 36 | TARGET = process.forwarder.mak
|
|---|
| 37 |
|
|---|
| 38 | # Default makefile names.
|
|---|
| 39 | !ifndef BUILD_MAKEFILE
|
|---|
| 40 | BUILD_MAKEFILE = Makefile
|
|---|
| 41 | !endif
|
|---|
| 42 |
|
|---|
| 43 | # Default makefile name.
|
|---|
| 44 | !ifndef MAKEFILE
|
|---|
| 45 | MAKEFILE = $(BUILD_MAKEFILE)
|
|---|
| 46 | !endif
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 | # -----------------------------------------------------------------------------
|
|---|
| 50 | # Tell user what we're doing.
|
|---|
| 51 | # -----------------------------------------------------------------------------
|
|---|
| 52 | !ifndef BUILD_QUIET
|
|---|
| 53 | ! ifndef MAKEVER
|
|---|
| 54 | ! if [$(ECHO) Forwarding to another (shell) environment setup...$(CLRRST)]
|
|---|
| 55 | ! endif
|
|---|
| 56 | ! else
|
|---|
| 57 | $(ECHO) Forwarding to another (shell) environment setup...$(CLRRST)
|
|---|
| 58 | ! endif
|
|---|
| 59 | !endif
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 | # -----------------------------------------------------------------------------
|
|---|
| 63 | # Common inference rules
|
|---|
| 64 | # -----------------------------------------------------------------------------
|
|---|
| 65 |
|
|---|
| 66 | .SUFFIXES:
|
|---|
| 67 | .SUFFIXES: .c .cpp .asm .$(EXT_OBJ) .rc .$(EXT_RES) .ii .s .ipp .ipf .$(EXT_INF) .$(EXT_HLP)
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 | # Assembling assembly source.
|
|---|
| 71 | .asm{$(PATH_TARGET)}.$(EXT_OBJ):
|
|---|
| 72 | \
|
|---|
| 73 | !ifndef BUILD_VERBOSE
|
|---|
| 74 | @ \
|
|---|
| 75 | !endif
|
|---|
| 76 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 77 |
|
|---|
| 78 | .asm.$(EXT_OBJ):
|
|---|
| 79 | \
|
|---|
| 80 | !ifndef BUILD_VERBOSE
|
|---|
| 81 | @ \
|
|---|
| 82 | !endif
|
|---|
| 83 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 | # Compiling C++ source.
|
|---|
| 87 | .cpp{$(PATH_TARGET)}.$(EXT_OBJ):
|
|---|
| 88 | \
|
|---|
| 89 | !ifndef BUILD_VERBOSE
|
|---|
| 90 | @ \
|
|---|
| 91 | !endif
|
|---|
| 92 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 93 |
|
|---|
| 94 | .cpp.$(EXT_OBJ):
|
|---|
| 95 | \
|
|---|
| 96 | !ifndef BUILD_VERBOSE
|
|---|
| 97 | @ \
|
|---|
| 98 | !endif
|
|---|
| 99 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 | # Pre-Compiling C++ source.
|
|---|
| 103 | .cpp.ii:
|
|---|
| 104 | \
|
|---|
| 105 | !ifndef BUILD_VERBOSE
|
|---|
| 106 | @ \
|
|---|
| 107 | !endif
|
|---|
| 108 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 | # Compiler C++ source to assembly.
|
|---|
| 112 | .cpp.s:
|
|---|
| 113 | \
|
|---|
| 114 | !ifndef BUILD_VERBOSE
|
|---|
| 115 | @ \
|
|---|
| 116 | !endif
|
|---|
| 117 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 | # Compiling C source.
|
|---|
| 121 | .c{$(PATH_TARGET)}.$(EXT_OBJ):
|
|---|
| 122 | \
|
|---|
| 123 | !ifndef BUILD_VERBOSE
|
|---|
| 124 | @ \
|
|---|
| 125 | !endif
|
|---|
| 126 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 127 |
|
|---|
| 128 | .c.$(EXT_OBJ):
|
|---|
| 129 | \
|
|---|
| 130 | !ifndef BUILD_VERBOSE
|
|---|
| 131 | @ \
|
|---|
| 132 | !endif
|
|---|
| 133 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 | # Pre-Compiling C source.
|
|---|
| 137 | .c.ii:
|
|---|
| 138 | \
|
|---|
| 139 | !ifndef BUILD_VERBOSE
|
|---|
| 140 | @ \
|
|---|
| 141 | !endif
|
|---|
| 142 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 | # Compiler C source to assembly.
|
|---|
| 146 | .c.s:
|
|---|
| 147 | \
|
|---|
| 148 | !ifndef BUILD_VERBOSE
|
|---|
| 149 | @ \
|
|---|
| 150 | !endif
|
|---|
| 151 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 | # Compiling resources.
|
|---|
| 155 | .rc{$(PATH_TARGET)}.$(EXT_RES):
|
|---|
| 156 | \
|
|---|
| 157 | !ifndef BUILD_VERBOSE
|
|---|
| 158 | @ \
|
|---|
| 159 | !endif
|
|---|
| 160 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 161 |
|
|---|
| 162 | .rc.res:
|
|---|
| 163 | \
|
|---|
| 164 | !ifndef BUILD_VERBOSE
|
|---|
| 165 | @ \
|
|---|
| 166 | !endif
|
|---|
| 167 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 | # Compiling INFs.
|
|---|
| 171 | .ipf{$(PATH_TARGET)}.$(EXT_INF):
|
|---|
| 172 | \
|
|---|
| 173 | !ifndef BUILD_VERBOSE
|
|---|
| 174 | @ \
|
|---|
| 175 | !endif
|
|---|
| 176 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 177 |
|
|---|
| 178 | .ipf.inf:
|
|---|
| 179 | \
|
|---|
| 180 | !ifndef BUILD_VERBOSE
|
|---|
| 181 | @ \
|
|---|
| 182 | !endif
|
|---|
| 183 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 | # Compiling INFs with pre-compiling
|
|---|
| 187 | .ipp{$(PATH_TARGET)}.$(EXT_INF):
|
|---|
| 188 | \
|
|---|
| 189 | !ifndef BUILD_VERBOSE
|
|---|
| 190 | @ \
|
|---|
| 191 | !endif
|
|---|
| 192 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 193 |
|
|---|
| 194 | .ipp.inf:
|
|---|
| 195 | \
|
|---|
| 196 | !ifndef BUILD_VERBOSE
|
|---|
| 197 | @ \
|
|---|
| 198 | !endif
|
|---|
| 199 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 | # Compiling HLPs
|
|---|
| 203 | .ipf{$(PATH_TARGET)}.$(EXT_HLP):
|
|---|
| 204 | \
|
|---|
| 205 | !ifndef BUILD_VERBOSE
|
|---|
| 206 | @ \
|
|---|
| 207 | !endif
|
|---|
| 208 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 209 |
|
|---|
| 210 | .ipf.hlp:
|
|---|
| 211 | \
|
|---|
| 212 | !ifndef BUILD_VERBOSE
|
|---|
| 213 | @ \
|
|---|
| 214 | !endif
|
|---|
| 215 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 | # Compiling HLPs with pre-compiling
|
|---|
| 219 | .ipp{$(PATH_TARGET)}.$(EXT_HLP):
|
|---|
| 220 | \
|
|---|
| 221 | !ifndef BUILD_VERBOSE
|
|---|
| 222 | @ \
|
|---|
| 223 | !endif
|
|---|
| 224 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 225 |
|
|---|
| 226 | .ipp.hlp:
|
|---|
| 227 | \
|
|---|
| 228 | !ifndef BUILD_VERBOSE
|
|---|
| 229 | @ \
|
|---|
| 230 | !endif
|
|---|
| 231 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 |
|
|---|
| 235 |
|
|---|
| 236 | # -----------------------------------------------------------------------------
|
|---|
| 237 | # The all rule - The default one, as it's the first rule in the file.
|
|---|
| 238 | # -----------------------------------------------------------------------------
|
|---|
| 239 | all: build
|
|---|
| 240 |
|
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 | # -----------------------------------------------------------------------------
|
|---|
| 244 | # Generic forwarder
|
|---|
| 245 | # -----------------------------------------------------------------------------
|
|---|
| 246 | build rebuild clean dep needed lib binary misc \
|
|---|
| 247 | !if "$(TARGET_MODE)" == "DEPEND"
|
|---|
| 248 | $(TARGET) \
|
|---|
| 249 | !endif
|
|---|
| 250 | $(TARGET_ILIB) \
|
|---|
| 251 | $(RULES_FORWARD) \
|
|---|
| 252 | publish publish_target testcase nothing target packing \
|
|---|
| 253 | pass1 pass2 pass3 pass4 pass5 pass6 quick \
|
|---|
| 254 | # obsoletes:
|
|---|
| 255 | miscellaneous executable :
|
|---|
| 256 | \
|
|---|
| 257 | !ifndef BUILD_VERBOSE
|
|---|
| 258 | @ \
|
|---|
| 259 | !endif
|
|---|
| 260 | !ifndef _BUILD_PROJECT # workaround for buggy SET implementation in NMAKE.
|
|---|
| 261 | echo . && SET _BUILD_PROJECT=$(BUILD_PROJECT) && \
|
|---|
| 262 | !endif
|
|---|
| 263 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 | # -----------------------------------------------------------------------------
|
|---|
| 267 | # The shell rule - Setup the correcte shell environment and start a shell.
|
|---|
| 268 | # -----------------------------------------------------------------------------
|
|---|
| 269 | shell:
|
|---|
| 270 | \
|
|---|
| 271 | !ifndef BUILD_VERBOSE
|
|---|
| 272 | @ \
|
|---|
| 273 | !endif
|
|---|
| 274 | !ifndef _BUILD_PROJECT # workaround for buggy SET implementation in NMAKE.
|
|---|
| 275 | echo . && SET _BUILD_PROJECT=$(BUILD_PROJECT) && \
|
|---|
| 276 | !endif
|
|---|
| 277 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(COMSPEC)
|
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 |
|
|---|
| 281 | # -----------------------------------------------------------------------------
|
|---|
| 282 | # The $(TARGET) rule - For EMPTY & DEPEND targets.
|
|---|
| 283 | # -----------------------------------------------------------------------------
|
|---|
| 284 | !if "$(TARGET_MODE)" == "DEPEND"
|
|---|
| 285 | $(TARGET):
|
|---|
| 286 | @$(ECHO) .
|
|---|
| 287 | !endif
|
|---|
| 288 |
|
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 | # -----------------------------------------------------------------------------
|
|---|
| 292 | # The .force rule - Force a remake of something everytime.
|
|---|
| 293 | # -----------------------------------------------------------------------------
|
|---|
| 294 | .force:
|
|---|
| 295 | \
|
|---|
| 296 | !ifndef BUILD_VERBOSE
|
|---|
| 297 | @$(ECHO) .
|
|---|
| 298 | !else
|
|---|
| 299 | @$(ECHO) . (force) .
|
|---|
| 300 | !endif
|
|---|
| 301 |
|
|---|