[37] | 1 | ###############################################################################
|
---|
[60] | 2 | # makefile.mif :: Make Include File -- Defines Cross Platform Stuff. [wmake] #
|
---|
[37] | 3 | ###############################################################################
|
---|
| 4 |
|
---|
| 5 | #
|
---|
| 6 | # This file can be included by Open Watcom Makefiles.
|
---|
| 7 | # It tests several conditions and defines macros to build
|
---|
| 8 | # under DOS, OS/2, Win32 and Linux.
|
---|
| 9 | #
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 | #
|
---|
| 13 | # The below does not work because the other make-utility *still* processes
|
---|
| 14 | # stuff outside the !ifndef and barks on wmake specific constructs.
|
---|
| 15 | # This essentially disables forwarding for these other make utils.
|
---|
| 16 | # So we prohibit their use altogether.
|
---|
| 17 | #
|
---|
| 18 | #!ifndef __MAKEFILES__
|
---|
| 19 | #front-end:
|
---|
| 20 | # @echo Invoking WMake for $(MAKE)
|
---|
| 21 | # @wmake
|
---|
| 22 | # @echo.
|
---|
| 23 | # @echo == Other Make Utility "$(MAKE)" used, please use "wmake" ==
|
---|
| 24 | # @echo.
|
---|
| 25 | #!endif
|
---|
| 26 | #
|
---|
| 27 |
|
---|
| 28 | #
|
---|
| 29 | # Prohibit processing with other Make Utilities.
|
---|
| 30 | # Because WMake expands $(MAKE) to a full path-name, we cannot use it to
|
---|
| 31 | # to string-compare it to "wmake". So we assume the __MAKEFILES__ macro
|
---|
| 32 | # is unique to WMake. If it's not defined it must be a non-WMake utility.
|
---|
| 33 | # GNU Make is not in the list below because it first looks for GNUmakefile.
|
---|
| 34 | # Where a Makefile is used, a special GNUmakefile is present that forwards
|
---|
| 35 | # to WMake, including selective targets.
|
---|
| 36 | #
|
---|
| 37 | !ifndef __MAKEFILES__
|
---|
| 38 | ERR_NOT_WMAKE=Please use Open Watcom "wmake"
|
---|
| 39 | # Borland make
|
---|
| 40 | ! if "$(MAKE)"=="MAKE"
|
---|
| 41 | ! error (make): $(ERR_NOT_WMAKE).
|
---|
| 42 | ! endif
|
---|
| 43 | ! if "$(MAKE)"=="BMAKE"
|
---|
| 44 | ! error (make): $(ERR_NOT_WMAKE).
|
---|
| 45 | ! endif
|
---|
| 46 | # VisualAge v3 nmake and MS nmake
|
---|
| 47 | ! if "$(MAKE)"=="nmake"
|
---|
| 48 | ! error (nmake): $(ERR_NOT_WMAKE).
|
---|
| 49 | ! endif
|
---|
| 50 | ! if "$(MAKE)"=="Nmake"
|
---|
| 51 | ! error (nmake): $(ERR_NOT_WMAKE).
|
---|
| 52 | ! endif
|
---|
| 53 | ! if "$(MAKE)"=="NMake"
|
---|
| 54 | ! error (nmake): $(ERR_NOT_WMAKE).
|
---|
| 55 | ! endif
|
---|
| 56 | ! if "$(MAKE)"=="NMAKE"
|
---|
| 57 | ! error (nmake): $(ERR_NOT_WMAKE).
|
---|
| 58 | ! endif
|
---|
| 59 | # OS/2 ToolKit v4.5 nmake32
|
---|
| 60 | ! if "$(MAKE)"=="nmake32"
|
---|
| 61 | ! error ERROR (nmake32): $(ERR_NOT_WMAKE).
|
---|
| 62 | ! endif
|
---|
| 63 | ! if "$(MAKE)"=="Nmake32"
|
---|
| 64 | ! error ERROR (nmake32): $(ERR_NOT_WMAKE).
|
---|
| 65 | ! endif
|
---|
| 66 | ! if "$(MAKE)"=="NMake32"
|
---|
| 67 | ! error ERROR (nmake32): $(ERR_NOT_WMAKE).
|
---|
| 68 | ! endif
|
---|
| 69 | ! if "$(MAKE)"=="NMAKE32"
|
---|
| 70 | ! error ERROR (nmake32): $(ERR_NOT_WMAKE).
|
---|
| 71 | # Unknown Make Utility (like a renamed one)
|
---|
| 72 | ! else
|
---|
| 73 | ! error ERR: $(ERR_NOT_WMAKE).
|
---|
| 74 | ! endif
|
---|
| 75 | !endif
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | # ===============================
|
---|
| 81 | # == From here we're "WMaking" ==
|
---|
| 82 | # ===============================
|
---|
| 83 |
|
---|
| 84 | #
|
---|
| 85 | # The first thing we need is the Open Watcom tool-chain.
|
---|
| 86 | #
|
---|
| 87 | !ifndef %WATCOM
|
---|
| 88 | ! error No WATCOM Environment Variable set !
|
---|
| 89 | !endif
|
---|
| 90 |
|
---|
| 91 | #
|
---|
| 92 | # Messages.
|
---|
| 93 | #
|
---|
| 94 | MSG_SUCCESS=has been built successfully !
|
---|
| 95 |
|
---|
| 96 | #
|
---|
| 97 | # Warnings.
|
---|
| 98 | #
|
---|
| 99 | WARN_DOS_BLD_ENV=Warning: The DOS build-environment has limited functionality !
|
---|
[46] | 100 | WARN_OVERLAP_NOT_SUPPORTED=Warning: Overlap Checking not supported for assembler: "$(ASM)" !
|
---|
[37] | 101 |
|
---|
| 102 | #
|
---|
| 103 | # Variables defined here will be placed into the environment
|
---|
| 104 | # and are available in spawned Makefiles or Scripts.
|
---|
| 105 | #
|
---|
| 106 | %ZVAR=This variable will be placed in the Environment
|
---|
| 107 |
|
---|
| 108 | #
|
---|
[182] | 109 | # Set the '*UNKNOWN*' value for Vendor and BuildMachine if undefined or empty
|
---|
| 110 | #
|
---|
| 111 | !if "$(%BLDLVL_VENDOR)"==""
|
---|
| 112 | %BLDLVL_VENDOR=*UNKNOWN*
|
---|
| 113 | !endif
|
---|
| 114 | !if "$(%BLDLVL_MACHINE)"==""
|
---|
| 115 | %BLDLVL_MACHINE=*UNKNOWN*
|
---|
| 116 | !endif
|
---|
| 117 |
|
---|
| 118 | #
|
---|
[188] | 119 | # Clear the ASM and CC definitions
|
---|
| 120 | #
|
---|
| 121 | %JWASM_DEFINES=
|
---|
| 122 | %CC_DEFINES=
|
---|
| 123 |
|
---|
| 124 | #
|
---|
| 125 | # Force a RELEASE build if specified
|
---|
| 126 | #
|
---|
| 127 | !if "$(%RELEASE)"=="y"
|
---|
| 128 | %JWASM_DEFINES += -DRELEASE
|
---|
| 129 | %CC_DEFINES += -dRELEASE
|
---|
| 130 | !endif
|
---|
| 131 |
|
---|
| 132 | #
|
---|
[182] | 133 | # Compose JWasm defines to pass on command-line
|
---|
| 134 | #
|
---|
| 135 | %JWASM_DEFINES += -DBLDLVL_VENDOR="'$(%BLDLVL_VENDOR)'"
|
---|
| 136 | %JWASM_DEFINES += -DBLDLVL_MACHINE="'$(%BLDLVL_MACHINE)'"
|
---|
| 137 |
|
---|
| 138 | #
|
---|
[184] | 139 | # Disable code CRC-check -- used for debugging
|
---|
| 140 | #
|
---|
| 141 | !if "$(%CRC_IGNORE)"=="y"
|
---|
| 142 | %JWASM_DEFINES += -DCRC_IGNORE
|
---|
| 143 | !endif
|
---|
| 144 |
|
---|
| 145 | #
|
---|
[182] | 146 | # Compose C-Compiler defines to pass on command-line
|
---|
| 147 | #
|
---|
| 148 | !ifdef __LINUX__
|
---|
| 149 | %CC_DEFINES += -dBLDLVL_VENDOR='"$(%BLDLVL_VENDOR)"'
|
---|
| 150 | %CC_DEFINES += -dBLDLVL_MACHINE='"$(%BLDLVL_MACHINE)"'
|
---|
| 151 | !else
|
---|
| 152 | %CC_DEFINES += -dBLDLVL_VENDOR="$(%BLDLVL_VENDOR)"
|
---|
| 153 | %CC_DEFINES += -dBLDLVL_MACHINE="$(%BLDLVL_MACHINE)"
|
---|
| 154 | !endif
|
---|
| 155 |
|
---|
| 156 | #
|
---|
[37] | 157 | # Define how a spawning shell is invoked.
|
---|
| 158 | #
|
---|
| 159 | DOSSHELL = COMMAND.COM /c
|
---|
| 160 | OS2SHELL = CMD.EXE /c
|
---|
| 161 | WINSHELL = CMD.EXE /c
|
---|
| 162 | LINSHELL = bash -c
|
---|
| 163 |
|
---|
| 164 | #
|
---|
| 165 | # WMake is invoked under DOS.
|
---|
| 166 | #
|
---|
| 167 | !ifdef __MSDOS__
|
---|
| 168 | LP = aap noot mies
|
---|
| 169 | LS = dir
|
---|
| 170 | CP = copy
|
---|
| 171 | MV = ren
|
---|
| 172 | RM = del
|
---|
| 173 | STRIP = wstrip
|
---|
| 174 | DS = \
|
---|
| 175 | PS = ;
|
---|
[46] | 176 | NULDEV = nul:
|
---|
[37] | 177 | BS = _build.bat
|
---|
| 178 | SHELL = $(DOSSHELL)
|
---|
| 179 | !endif
|
---|
| 180 |
|
---|
| 181 | #
|
---|
| 182 | # WMake is invoked under OS/2.
|
---|
| 183 | #
|
---|
| 184 | !ifdef __OS2__
|
---|
| 185 | LP = wim zus jet
|
---|
| 186 | LS = dir
|
---|
| 187 | CP = copy
|
---|
| 188 | MV = ren
|
---|
| 189 | RM = del
|
---|
| 190 | STRIP = wstrip
|
---|
| 191 | DS = \
|
---|
| 192 | PS = ;
|
---|
[46] | 193 | NULDEV = nul:
|
---|
[37] | 194 | BS = _build.cmd
|
---|
| 195 | SHELL = $(OS2SHELL)
|
---|
| 196 | !endif
|
---|
| 197 |
|
---|
| 198 | #
|
---|
| 199 | # WMake is invoked under Win32.
|
---|
| 200 | #
|
---|
| 201 | !ifdef __NT__
|
---|
| 202 | LP = teun vuur gijs
|
---|
| 203 | LS = dir
|
---|
| 204 | CP = copy
|
---|
| 205 | MV = ren
|
---|
| 206 | RM = del
|
---|
| 207 | STRIP = wstrip
|
---|
| 208 | DS = \
|
---|
| 209 | PS = ;
|
---|
[46] | 210 | NULDEV = nul:
|
---|
[37] | 211 | BS = _build.cmd
|
---|
| 212 | SHELL = $(WINSHELL)
|
---|
| 213 | !endif
|
---|
| 214 |
|
---|
| 215 | #
|
---|
| 216 | # WMake is invoked under Linux.
|
---|
| 217 | #
|
---|
| 218 | !ifdef __LINUX__
|
---|
| 219 | LP = lam kees bok
|
---|
| 220 | LS = 'ls -1'
|
---|
| 221 | CP = cp -a
|
---|
| 222 | MV = mv
|
---|
| 223 | RM = rm
|
---|
| 224 | STRIP = strip
|
---|
| 225 | DS = /
|
---|
| 226 | PS = :
|
---|
[46] | 227 | NULDEV = /dev/null
|
---|
[37] | 228 | BS = _build.bash
|
---|
| 229 | SHELL = $(LINSHELL)
|
---|
[68] | 230 | %TEMP = /var/tmp
|
---|
[37] | 231 | !endif
|
---|
| 232 |
|
---|