lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | # ------------------------------------------------------------------------ #
|
| 2 | # Compiler makefile for Microsoft Visual C++ 6.0 #
|
| 3 | # ------------------------------------------------------------------------ #
|
| 4 | .PHONY :
|
| 5 |
|
| 6 | # ------------------------------------------------------------------------ #
|
| 7 | # Compiler tools
|
| 8 | # ------------------------------------------------------------------------ #
|
| 9 | CC = cl.exe
|
| 10 | CPP = cl.exe
|
| 11 | THUMBCC = cl.exe
|
| 12 | THUMBCPP = cl.exe
|
| 13 | ASM =
|
| 14 | LINK = link.exe
|
| 15 | CONV =
|
| 16 | AR = lib.exe
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 | # ---------------------------------------------------------------------------
|
| 21 | # Apply Rational Realtime when CODECOVERAGE=YES
|
| 22 | # ---------------------------------------------------------------------------
|
| 23 | # todo: for backward compatibility, should be removed later
|
| 24 | ifeq '$(DEBUGINFO)' ''
|
| 25 | ifeq '$(BUILDMODE)' 'DEBUG'
|
| 26 | DEBUGINFO=YES
|
| 27 | endif
|
| 28 | endif
|
| 29 |
|
| 30 | ifeq '${CODECOVERAGE}' 'YES'
|
| 31 | ifeq '${TESTENVIRONMENT}' 'URRCM'
|
| 32 | ifneq '$(findstring ${BUILD_LIB},urrc urrcbp urrcdc urrcm)' ''
|
| 33 | CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
|
| 34 | endif # ifneq '$(findstring ${BUILD_LIB},urrc urrcbp urrcdc urrcm)' ''
|
| 35 | endif # ifeq '${TESTENVIRONMENT}' 'URRCM'
|
| 36 |
|
| 37 | ifeq '${TESTENVIRONMENT}' 'UPDCP'
|
| 38 | ifneq '$(findstring ${BUILD_LIB},urabmupdcp sif)' ''
|
| 39 | CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
|
| 40 | endif # ifneq '$(findstring ${BUILD_LIB},urabmupdcp sif)' ''
|
| 41 | endif # ifeq '${TESTENVIRONMENT}' 'UPDCP'
|
| 42 |
|
| 43 | ifeq '${TESTENVIRONMENT}' 'URLC'
|
| 44 | ifneq '$(findstring ${BUILD_LIB},urlcc urlcdl urlcul)' ''
|
| 45 | CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
|
| 46 | endif # ifneq '$(findstring ${BUILD_LIB},urlcc urlcdl urlcul)' ''
|
| 47 | endif # ifeq '${TESTENVIRONMENT}' 'URLC'
|
| 48 |
|
| 49 | ifeq '${TESTENVIRONMENT}' 'UMAC'
|
| 50 | ifneq '$(findstring ${BUILD_LIB},umac security ugdci)' ''
|
| 51 | CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
|
| 52 | endif # ifneq '$(findstring ${BUILD_LIB},umac security ugdci)' ''
|
| 53 | endif # ifeq '${TESTENVIRONMENT}' 'UMAC'
|
| 54 |
|
| 55 | ifeq '${TESTENVIRONMENT}' 'USIM'
|
| 56 | ifneq '$(findstring ${BUILD_LIB},usim)' ''
|
| 57 | CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
|
| 58 | endif # ifneq '$(findstring ${BUILD_LIB},usim)' ''
|
| 59 | endif # ifeq '${TESTENVIRONMENT}' 'USIM'
|
| 60 |
|
| 61 | endif # ifeq '${CODECOVERAGE}' 'YES'
|
| 62 |
|
| 63 | # ------------------------------------------------------------------------ #
|
| 64 | # Extensions for standard files
|
| 65 | # ------------------------------------------------------------------------ #
|
| 66 | OBJFILEEXT = obj
|
| 67 | DEPFILEEXT = dep
|
| 68 | OUTPUTFILEEXT = exe
|
| 69 | SRCFILEEXT = src
|
| 70 | MAPFILEEXT = map
|
| 71 | LIBFILEEXT = lib
|
| 72 | ERRFILEEXT = err
|
| 73 | SBRFILEEXT = sbr
|
| 74 | PDBFILEEXT = pdb
|
| 75 |
|
| 76 | CC_DEFPREFIX = -D
|
| 77 | CC_INCPREFIX = -I
|
| 78 |
|
| 79 | export COMPILER_VERSION := $(shell $(CC) 2>&1 | $(SED) -n "s/.*Version *\([0-9]*\).*/\1/p")
|
| 80 |
|
| 81 | msvc_version :
|
| 82 | -@$(ECHO) "COMPILER VERSION: $(COMPILER_VERSION)"
|
| 83 |
|
| 84 |
|
| 85 | # ======================================================================== #
|
| 86 | # Common compiler switches for C and C++ compiler
|
| 87 | # ======================================================================== #
|
| 88 | CC_CPP_OPTIONS = /nologo # no logo and info messages
|
| 89 |
|
| 90 | ifeq '$(WARNINGS)' 'YES'
|
| 91 | CC_CPP_OPTIONS += /W3 # Warning level 3 - recommended for production purposes
|
| 92 | else
|
| 93 | ifeq '$(WARNINGS)' 'NO'
|
| 94 | CC_CPP_OPTIONS += /W0 # Warning level 0 - disable all warnings
|
| 95 | else
|
| 96 | CC_CPP_OPTIONS += /W3 # Warning level 3 - default
|
| 97 | endif
|
| 98 | endif
|
| 99 |
|
| 100 | CC_CPP_OPTIONS += /c # compile without linking
|
| 101 | CC_CPP_OPTIONS += /Od # no optimization, speed compilation, debugging
|
| 102 | CC_CPP_OPTIONS += ${CC_DEFPREFIX}_MBCS # default define:
|
| 103 | CC_CPP_OPTIONS += ${CC_DEFPREFIX}_MSC # default define:
|
| 104 | CC_CPP_OPTIONS += ${CC_DEFPREFIX}_CONSOLE # default define:
|
| 105 | CC_CPP_OPTIONS += ${CC_DEFPREFIX}_LIB # default define:
|
| 106 | CC_CPP_OPTIONS += ${CC_DEFPREFIX}_Windows # default define:
|
| 107 | CC_CPP_OPTIONS += ${CC_DEFPREFIX}MSVCWIN # default define:
|
| 108 | CC_CPP_OPTIONS += ${CC_DEFPREFIX}_WIN32 # default define:
|
| 109 |
|
| 110 | ifeq '$(DEBUGINFO)' 'YES' # --- debug info
|
| 111 | CC_CPP_OPTIONS += ${CC_DEFPREFIX}_DEBUG
|
| 112 | CC_CPP_OPTIONS += /MTd # multithread debug
|
| 113 | ifeq '$(COMPILER_VERSION)' '14'
|
| 114 | CC_CPP_OPTIONS += /RTC1 # catch release build errors
|
| 115 | else
|
| 116 | CC_CPP_OPTIONS += /GZ # catch release build errors
|
| 117 | endif
|
| 118 | CC_CPP_OPTIONS += /Zi # create additional debug library
|
| 119 | CC_CPP_OPTIONS += /Fd${LIBDIR}/$(basename ${BUILD_LIB}).${PDBFILEEXT} # location of PDB library
|
| 120 | else # --- release mode
|
| 121 | CC_CPP_OPTIONS += /MT # multithread
|
| 122 | CC_CPP_OPTIONS += /Gi- # dissable incremental compilation
|
| 123 | endif
|
| 124 |
|
| 125 | ifneq '$(TESTENVIRONMENT)' ''
|
| 126 | CC_CPP_OPTIONS += /D__thumb # compile test build like target build
|
| 127 | CC_CPP_OPTIONS += /DUNITEST # define UniTest build
|
| 128 | CC_CPP_OPTIONS += /DSID_DEFINED #
|
| 129 | CC_CPP_OPTIONS += /DWIN32_LEAN_AND_MEAN # don't include unwanted Microsoft specific header files
|
| 130 | CC_CPP_OPTIONS += /DNOGDI # ditto
|
| 131 | CC_CPP_OPTIONS += /DNOCRYPT # ditto
|
| 132 | endif
|
| 133 |
|
| 134 | # --- add compiler and library specific compile switches
|
| 135 | CC_CPP_OPTIONS += ${MSVC_OPTIONS} $(MSVC_CC_CPP_OPTIONS_$(BUILD_LIB))
|
| 136 |
|
| 137 | # --- assembler files - not used yet
|
| 138 | ifneq '$(ASMCODEGEN)' ''
|
| 139 | endif
|
| 140 |
|
| 141 | # --- the *_CMD variable contains options that may not go into via-file
|
| 142 | CC_CPP_OPTIONS_CMD += /Fo${OBJDIR}/${BUILD_LIB}/$(@F) # specifiy obj name
|
| 143 | CC_CPP_OPTIONS_CMD += $(subst \,/,$<) # source file
|
| 144 | ifneq '$(TESTENVIRONMENT)' ''
|
| 145 | CC_CPP_OPTIONS_CMD += /FR${SBRDIR}/${BUILD_LIB}/$(basename ${@F}).${SBRFILEEXT} # create browse info file
|
| 146 | endif
|
| 147 | ifeq '${ERRORLOG}' 'YES'
|
| 148 | CC_CPP_OPTIONS_CMD += 2>&1 > ${ERRDIR}/${BUILD_LIB}/$(basename ${@F}).${ERRFILEEXT}
|
| 149 | endif
|
| 150 |
|
| 151 |
|
| 152 | # ======================================================================== #
|
| 153 | # C and C++ specific compiler switches
|
| 154 | # ======================================================================== #
|
| 155 | CC_INCL = $(strip $(addprefix ${CC_INCPREFIX}, \
|
| 156 | ${CC_INCLUDE} \
|
| 157 | ${${BUILD_LIB}_INC} \
|
| 158 | ) )
|
| 159 | CC_DEF = $(strip $(addprefix ${CC_DEFPREFIX},$(SYSTEM_DEFS) \
|
| 160 | ${L1_DEFS} \
|
| 161 | ${CC_DEFS} \
|
| 162 | ${CCC_DEFS_PLATFORM} ) )
|
| 163 | CPP_INCL = $(strip $(addprefix ${CC_INCPREFIX}, \
|
| 164 | ${CPP_INCLUDE} \
|
| 165 | ${${BUILD_LIB}_INC}\
|
| 166 | ) )
|
| 167 | CPP_DEF = $(strip $(addprefix ${CC_DEFPREFIX},${SYSTEM_DEFS} \
|
| 168 | ${L1_DEFS} \
|
| 169 | ${CPP_DEFS} \
|
| 170 | ${CPP_DEFS_PLATFORM} ) )
|
| 171 |
|
| 172 | CC_OPTIONS = ${CC_INCL} ${CC_DEF} ${MSVC_CC_OPTIONS} $(MSVC_CC_OPTIONS_$(BUILD_LIB))
|
| 173 | CPP_OPTIONS = ${CPP_INCL} ${CPP_DEF} ${MSVC_CPP_OPTIONS} $(MSVC_CPP_OPTIONS_$(BUILD_LIB))
|
| 174 | CPP_OPTIONS+= -we4150 # turn warning C4150 into error since it's to serious
|
| 175 |
|
| 176 | # precompiled header are only supported for cpp
|
| 177 | ifeq '$(findstring hpp,${PCH_FILE})' 'hpp'
|
| 178 | PCH_FILENAME = ${OBJDIR}/$(BUILD_LIB)/$(basename $(PCH_BUILD_FILE)).pch
|
| 179 | # add pch-options to source-options
|
| 180 | PCH_USE_OPTIONS += /Yu${PCH_FILE} /Fp${PCH_FILENAME}
|
| 181 | # build specific pch-options
|
| 182 | PCH_CREATE_OPTIONS += /Yc${PCH_FILE} /Fp${PCH_FILENAME}
|
| 183 | endif
|
| 184 |
|
| 185 |
|
| 186 | # ======================================================================== #
|
| 187 | # combining, via files
|
| 188 | # ======================================================================== #
|
| 189 | CC_COMPLETE_TMP = ${CC_CPP_OPTIONS} ${CC_OPTIONS}
|
| 190 | CPP_COMPLETE_TMP = ${CC_CPP_OPTIONS} ${CPP_OPTIONS} ${PCH_USE_OPTIONS}
|
| 191 | PCH_COMPLETE_TMP = ${CC_CPP_OPTIONS} ${CPP_OPTIONS} ${PCH_CREATE_OPTIONS}
|
| 192 |
|
| 193 | ifeq '${VIAFILE}' 'YES'
|
| 194 | VIA_CC_COMPLETE = ${CC_COMPLETE_TMP}
|
| 195 | VIA_CPP_COMPLETE = ${CPP_COMPLETE_TMP}
|
| 196 | VIA_PCH_COMPLETE = ${PCH_COMPLETE_TMP}
|
| 197 | CC_COMPLETE = @${OBJDIR}/${BUILD_LIB}/cc.via
|
| 198 | CPP_COMPLETE = @${OBJDIR}/${BUILD_LIB}/cpp.via
|
| 199 | PCH_COMPLETE = @${OBJDIR}/${BUILD_LIB}/pch.via
|
| 200 | else
|
| 201 | CC_COMPLETE = ${CC_COMPLETE_TMP}
|
| 202 | CPP_COMPLETE = ${CPP_COMPLETE_TMP}
|
| 203 | PCH_COMPLETE = ${PCH_COMPLETE_TMP}
|
| 204 | endif # VIAFILE
|
| 205 |
|
| 206 |
|
| 207 | # ======================================================================== #
|
| 208 | # command lines
|
| 209 | # ======================================================================== #
|
| 210 | ASM_CMDLINE = # we're not using an assembler on win32
|
| 211 | ifeq '$(ERRORLOG)' 'YES'
|
| 212 | CMDLINE_ERROR_POSTPROC=|| ( $(CAT) ${ERRDIR}/${BUILD_LIB}/$(basename ${@F}).${ERRFILEEXT} && exit 3)
|
| 213 | endif
|
| 214 |
|
| 215 | ASM_CMDLINE = # we're not using an assembler on win32
|
| 216 | CC_CMDLINE = $(strip ${CC} ${CC_COMPLETE} ${CC_CPP_OPTIONS_CMD} ) $(CMDLINE_ERROR_POSTPROC)
|
| 217 | CPP_CMDLINE = $(strip ${CPP} ${CPP_COMPLETE} ${CC_CPP_OPTIONS_CMD} ) $(CMDLINE_ERROR_POSTPROC)
|
| 218 | PCH_CMDLINE = $(strip ${CPP} ${PCH_COMPLETE} ${CC_CPP_OPTIONS_CMD} ) $(CMDLINE_ERROR_POSTPROC)
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 | # no specific THUMB-stuff!
|
| 223 | THUMBCC_CMDLINE = ${CC_CMDLINE}
|
| 224 | THUMBCPP_CMDLINE = ${CPP_CMDLINE}
|
| 225 |
|
| 226 |
|
| 227 | # ------------------------------------------------------------------------ #
|
| 228 | # Howto make dependencies per file
|
| 229 | # ------------------------------------------------------------------------ #
|
| 230 | # jwo: dep/file deactivated as we build dep-file on a per-lib base
|
| 231 | ifeq '0' '1'
|
| 232 | CC_MAKEDEP_CMDLINE = ${MKDEP} \
|
| 233 | $(addprefix /I ,$(subst /,\,${${BUILD_LIB}_INC})) \
|
| 234 | /T "" \
|
| 235 | /X \
|
| 236 | /o $(subst /,\,${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.${DEPFILEEXT}) \
|
| 237 | $(subst /,\,$^)
|
| 238 | THUMBCC_MAKEDEP_CMDLINE = ${CC_MAKEDEP_CMDLINE}
|
| 239 | CPP_MAKEDEP_CMDLINE = ${CC_MAKEDEP_CMDLINE}
|
| 240 | THUMBCPP_MAKEDEP_CMDLINE = ${CC_MAKEDEP_CMDLINE}
|
| 241 | endif
|
| 242 |
|
| 243 | # ------------------------------------------------------------------------ #
|
| 244 | # How to run the SDL code generation
|
| 245 | # ------------------------------------------------------------------------ #
|
| 246 | runsdlcmd:
|
| 247 | $(SDL_MAKE_CMD)
|
| 248 |
|
| 249 |
|
| 250 | # ------------------------------------------------------------------------ #
|
| 251 | # Target rule for 'all'
|
| 252 | # ------------------------------------------------------------------------ #
|
| 253 | ifeq '${SDLCODEGEN}' 'YES'
|
| 254 | all: runsdlcmd runsdlscr config createdirs ${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT}
|
| 255 | else # SDLCODEGEN
|
| 256 | ifeq '${SDLSCR}' 'YES'
|
| 257 | all: runsdlscr config createdirs ${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT}
|
| 258 | else # SDLSCR
|
| 259 | all: config createdirs ${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT}
|
| 260 | endif # SDL source code reduction
|
| 261 | endif # SDLCODEGEN
|
| 262 |
|
| 263 |
|
| 264 | # ------------------------------------------------------------------------ #
|
| 265 | # creating the .lib
|
| 266 | # ------------------------------------------------------------------------ #
|
| 267 | L_OPTIONS = /nologo
|
| 268 | LINKER_CMDLINE=${AR}
|
| 269 | FILTEROUTFILE = $(notdir $(LIB_DEPFILE)) # jwo probably using $^ instead of ^F would be smarter
|
| 270 | ifeq '${VIAFILE}' 'YES'
|
| 271 | LINKER_CMDLINE += @${OBJDIR}/${BUILD_LIB}/lib.via
|
| 272 | VIA_LIB_COMPLETE = \
|
| 273 | ${L_OPTIONS} \
|
| 274 | /MACHINE:IX86 \
|
| 275 | /out:${LIBDIR}/${BUILD_LIB}.${LIBFILEEXT} \
|
| 276 | $(addprefix ${OBJDIR}/${BUILD_LIB}/,$(filter-out ${FILTEROUTFILE},$(^F))) \
|
| 277 | ${OBJSTOLINK}
|
| 278 | else
|
| 279 | LINKER_CMDLINE += \
|
| 280 | ${L_OPTIONS} \
|
| 281 | /MACHINE:IX86 \
|
| 282 | /out:${LIBDIR}/${BUILD_LIB}.${LIBFILEEXT} \
|
| 283 | $(addprefix ${OBJDIR}/${BUILD_LIB}/,$(filter-out ${FILTEROUTFILE},$(^F))) \
|
| 284 | ${OBJSTOLINK}
|
| 285 | endif
|
| 286 |
|
| 287 |
|
| 288 | # ------------------------------------------------------------------------ #
|
| 289 | # Linker
|
| 290 | # ------------------------------------------------------------------------ #
|
| 291 | L_FLAGS = /subsystem:console
|
| 292 | L_FLAGS += /machine:I386
|
| 293 | L_FLAGS += /pdbtype:sept
|
| 294 | L_FLAGS += /verbose:lib
|
| 295 | L_FLAGS += /nodefaultlib:libc.lib
|
| 296 | L_FLAGS += /nodefaultlib:libcd.lib
|
| 297 | L_FLAGS += /nodefaultlib:libcmt.lib
|
| 298 | L_FLAGS += /nodefaultlib:libcmtd.lib
|
| 299 |
|
| 300 | L_STANDARDLIBS = # init
|
| 301 | ifeq '$(DEBUGINFO)' 'YES'
|
| 302 | L_STANDARDLIBS += libcmtd.lib
|
| 303 | else
|
| 304 | L_STANDARDLIBS += libcmt.lib
|
| 305 | endif
|
| 306 | L_STANDARDLIBS += kernel32.lib
|
| 307 | L_STANDARDLIBS += user32.lib
|
| 308 | L_STANDARDLIBS += ws2_32.lib
|
| 309 | L_STANDARDLIBS += netapi32.lib
|
| 310 | L_STANDARDLIBS += comctl32.lib
|
| 311 | L_STANDARDLIBS += gdi32.lib
|
| 312 | L_STANDARDLIBS += comdlg32.lib
|
| 313 | L_STANDARDLIBS += advapi32.lib
|
| 314 | L_STANDARDLIBS += winmm.lib
|
| 315 | L_STANDARDLIBS += imagehlp.lib
|
| 316 | L_STANDARDLIBS += shell32.lib
|
| 317 |
|
| 318 | # todo: check & fix this, why do apoxi need DEBUG always?
|
| 319 | ifeq '$(findstring APOXI,${APPLICATIONS})' 'APOXI'
|
| 320 | L_FLAGS += /DEBUG
|
| 321 | else # APOXI
|
| 322 | ifeq '$(DEBUGINFO)' 'YES'
|
| 323 | L_FLAGS += /DEBUG
|
| 324 | else
|
| 325 | ifeq '$(findstring ${BUILD_LIB},${DEBUGLIBS})' '${BUILD_LIB}'
|
| 326 | L_FLAGS += /DEBUG
|
| 327 | endif # DEBUGMODE
|
| 328 | endif # DEBUGMODE
|
| 329 | endif # APOXI
|
| 330 |
|
| 331 |
|
| 332 | # ------------------------------------------------------------------------ #
|
| 333 | # Target rule for 'link'ing executable
|
| 334 | # ------------------------------------------------------------------------ #
|
| 335 | ARC_CMDLINE = ${LINK} ${L_FLAGS}
|
| 336 | ARC_CMDLINE += /out:${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT}
|
| 337 | ifeq '$(DEBUGINFO)' 'YES'
|
| 338 | ARC_CMDLINE += /pdb:${MAKEDIR}/${PROJECTNAME}.pdb
|
| 339 | endif
|
| 340 | ARC_CMDLINE += /libpath:${LIBDIR}
|
| 341 | ARC_CMDLINE += /libpath:${GLOBALPATH}/stack-interface/sdl/msvc50
|
| 342 | ARC_CMDLINE += ${L_STANDARDLIBS}
|
| 343 | ARC_CMDLINE += ${LIBSTOBUILD} ${LIBSTOLINK}
|
| 344 |
|
| 345 | link: ${MAKEDIR}/sys_version.c
|
| 346 | $(ECHO) Creating executable $(MAKEDIR)/$(PROJECTNAME).${OUTPUTFILEEXT} ...
|
| 347 | ${ARC_CMDLINE}
|
| 348 | ifneq '${CMDPEREXE}' ''
|
| 349 | ${CMDPEREXE}
|
| 350 | endif # CMDPEREXE
|
| 351 |
|
| 352 |
|
| 353 | # ------------------------------------------------------------------------ #
|
| 354 | # Rule to build the executable
|
| 355 | # ------------------------------------------------------------------------ #
|
| 356 | ${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT} : ${LIBSTOBUILD}
|
| 357 | $(MAKE) link
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 | # ------------------------------------------------------------------------
|
| 362 | # create a dependency file per lib
|
| 363 | # msvc doesn't provide dep-generation so mkdep.exe (comneon-made, not to be
|
| 364 | # mixed up with gnu's mkdep) is used
|
| 365 | # there is one dependency file per library <lib>.dep
|
| 366 | # ------------------------------------------------------------------------
|
| 367 | #
|
| 368 | ifneq '$(DEPENDENCIES)' 'NO'
|
| 369 | LIB_DEPFILE=${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.$(DEPFILEEXT)
|
| 370 | endif
|
| 371 |
|
| 372 | # adapt pathes to cygwin
|
| 373 | ifeq '${BUILDPCOS}' 'WIN32'
|
| 374 | PATH_DELIM=\\
|
| 375 | else
|
| 376 | PATH_DELIM=/
|
| 377 | endif
|
| 378 |
|
| 379 | # adapt path of executable
|
| 380 | MKDEP := $(subst \,${PATH_DELIM},${MKDEP})
|
| 381 |
|
| 382 | # this is tricky, but mkdep expects INCLUDE_DEP to contain a ";" separated list of directories
|
| 383 | # add a ":" before and after each token, then we replace ": :" with ";" and remove single ":" (start & end)
|
| 384 | NULL:=
|
| 385 | SPACE:= $(NULL) # this is a space
|
| 386 | # we don't modify INCLUDE as this is used by compilers; muc uses "include" (lowercase)
|
| 387 | export INCLUDE_DEP=$(strip $(INCLUDE))$(strip $(include))
|
| 388 | INCLUDE_DEP +=$(strip $(subst :,,$(subst : :,;,$(addprefix :,$(addsuffix :,${${BUILD_LIB}_INC})))))
|
| 389 | INCLUDE_DEP:=$(subst ;$(SPACE),;,$(INCLUDE_DEP))
|
| 390 |
|
| 391 | ${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.$(DEPFILEEXT) : \
|
| 392 | ${${BUILD_LIB}_THUMB_FILES} \
|
| 393 | ${${BUILD_LIB}_FILES}
|
| 394 | -@$(ECHO) --- generating dependency file $@ ---
|
| 395 | # this command get's too long most of the time so we create a viafile anyway
|
| 396 | $(shell echo $(wordlist 1,1,$($^)) > ${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.via )
|
| 397 | $(foreach str, $^, $(shell echo ${str} >> ${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.via) )
|
| 398 | ${MKDEP} \
|
| 399 | /T "$(OBJ_DIR)" \
|
| 400 | /X \
|
| 401 | /E INCLUDE_DEP \
|
| 402 | /o $(subst /,${PATH_DELIM},${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.${DEPFILEEXT}) \
|
| 403 | @$(subst /,${PATH_DELIM},${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.via)
|
| 404 | # /T <dir> obj file directory <dir>
|
| 405 | # /X enable unix style ("/") support
|
| 406 | # /o write output to file <file>
|
| 407 | # /v verbose output
|
| 408 | # /S<c> file separator (\ by default)
|
| 409 | # /i<c> inc path seperator (; by default)
|
| 410 | # /x o generate dependencies with .o files (.obj is default)
|
| 411 | # $(addprefix /I ,$(subst /,\,${${BUILD_LIB}_INC}))
|
| 412 |
|