[8253] | 1 | # $Id: setup.mak,v 1.3 2002-04-13 04:39:59 bird Exp $
|
---|
[8197] | 2 |
|
---|
| 3 | #
|
---|
[8253] | 4 | # Generic makefile system.
|
---|
[8197] | 5 | #
|
---|
| 6 | # Setting up the build environment variables
|
---|
| 7 | #
|
---|
[8253] | 8 | # Many of the variables are a subject to change from project to project.
|
---|
[8197] | 9 | #
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 | !ifndef MAKE_SETUP_INCLUDED
|
---|
| 13 | MAKE_SETUP_INCLUDED=YES
|
---|
| 14 |
|
---|
| 15 |
|
---|
[8253] | 16 | # -----------------------------------------------------------------------------
|
---|
| 17 | # Validate the build the requested environment setup.
|
---|
| 18 | # -----------------------------------------------------------------------------
|
---|
[8197] | 19 |
|
---|
[8253] | 20 | SHT_TRGPLTFRM=
|
---|
[8197] | 21 | !if "$(BUILD_PLATFORM)" == "OS2"
|
---|
[8253] | 22 | SHT_TRGPLTFRM=os2
|
---|
[8197] | 23 | !endif
|
---|
| 24 | !if "$(BUILD_PLATFORM)" == "WIN32"
|
---|
[8253] | 25 | SHT_TRGPLTFRM=win32
|
---|
[8197] | 26 | !endif
|
---|
[8253] | 27 | !if "$(SHT_TRGPLTFRM)" == ""
|
---|
| 28 | ! error Fatal error: Env.var BUILD_PLATFORM is either unspecified or incorrect. ($(BUILD_PLATFORM)) Valid values: OS2 and WIN32
|
---|
[8197] | 29 | !endif
|
---|
| 30 |
|
---|
| 31 |
|
---|
[8253] | 32 | SHT_BLDMD=
|
---|
[8197] | 33 | !if "$(BUILD_MODE)" == "RELEASE"
|
---|
[8253] | 34 | SHT_BLDMD=rel
|
---|
[8197] | 35 | !endif
|
---|
| 36 | !if "$(BUILD_MODE)" == "DEBUG"
|
---|
[8253] | 37 | SHT_BLDMD=deb
|
---|
[8197] | 38 | !endif
|
---|
| 39 | !if "$(BUILD_MODE)" == "PROFILE"
|
---|
[8253] | 40 | SHT_BLDMD=prf
|
---|
[8197] | 41 | !endif
|
---|
[8253] | 42 | !if "$(SHT_BLDMD)" == ""
|
---|
| 43 | ! error Fatal error: Env.var BUILD_MODE is either unspecified or incorrect. ($(BUILD_MODE)) Valid values: RELEASE, DEBUG and PROFILE
|
---|
[8197] | 44 | !endif
|
---|
| 45 |
|
---|
| 46 |
|
---|
[8253] | 47 | SHT_BLDENV=
|
---|
[8197] | 48 | !if "$(BUILD_ENV)" == "VAC308"
|
---|
[8253] | 49 | SHT_BLDENV=vac308
|
---|
[8197] | 50 | !endif
|
---|
| 51 | !if "$(BUILD_ENV)" == "VAC365"
|
---|
[8253] | 52 | SHT_BLDENV=vac365
|
---|
[8197] | 53 | !endif
|
---|
| 54 | !if "$(BUILD_ENV)" == "VAC4"
|
---|
[8253] | 55 | SHT_BLDENV=vac4
|
---|
[8197] | 56 | !endif
|
---|
| 57 | !if "$(BUILD_ENV)" == "EMX"
|
---|
[8253] | 58 | SHT_BLDENV=emx
|
---|
[8197] | 59 | !endif
|
---|
| 60 | !if "$(BUILD_ENV)" == "MSCV6"
|
---|
[8253] | 61 | SHT_BLDENV=mscv6
|
---|
[8197] | 62 | !endif
|
---|
[8253] | 63 | !if "$(BUILD_ENV)" == "WAT11"
|
---|
| 64 | SHT_BLDENV=wat11
|
---|
| 65 | !endif
|
---|
[8197] | 66 | !if "$(BUILD_ENV)" == "WATCOM"
|
---|
[8253] | 67 | SHT_BLDENV=wat11
|
---|
[8197] | 68 | !endif
|
---|
[8253] | 69 | !if "$(SHT_BLDENV)" == ""
|
---|
| 70 | ! error Fatal error: Env.var BUILD_ENV is either unspecified or incorrect. ($(BUILD_MODE)) Valid values: VAC308, VAC365, VAC4, EMX, MSCV6 and WATCOM
|
---|
[8197] | 71 | !endif
|
---|
| 72 |
|
---|
| 73 |
|
---|
[8253] | 74 |
|
---|
| 75 | # -----------------------------------------------------------------------------
|
---|
| 76 | # Directories
|
---|
| 77 | # -----------------------------------------------------------------------------
|
---|
| 78 |
|
---|
| 79 | # current directory.
|
---|
| 80 | PATH_CURRENT = $(MAKEDIR)
|
---|
| 81 | # Where build system files are located. (like this file)
|
---|
| 82 | PATH_MAKE = $(PATH_ROOT)\make
|
---|
| 83 | # Where the bulid system and other tools are located
|
---|
| 84 | PATH_TOOLS = $(PATH_ROOT)\tools\bin
|
---|
| 85 | # Where platform-specific files are located. (like the .def files)
|
---|
| 86 | # (default) PATH_DEF = $(SHT_TRGPLTFRM)
|
---|
| 87 | PATH_DEF = .
|
---|
| 88 | # Where the include files are located.
|
---|
| 89 | PATH_INCLUDES = $(PATH_ROOT)\include;$(PATH_ROOT)\include\win
|
---|
| 90 |
|
---|
| 91 | # Where the temporary files goes.
|
---|
| 92 | PATH_OBJ = $(PATH_ROOT)\obj\$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV)
|
---|
| 93 | # Where the executable binaries goes.
|
---|
| 94 | PATH_BIN = $(PATH_ROOT)\bin\$(BUILD_MODE)
|
---|
| 95 | # Where the public libraries goes.
|
---|
| 96 | PATH_LIB = $(PATH_ROOT)\lib\$(BUILD_MODE)
|
---|
| 97 | # Where the dynamic link libraries goes.
|
---|
| 98 | PATH_DLL = $(PATH_ROOT)\bin\$(BUILD_MODE)
|
---|
| 99 | # Where the drivers goes. (common for IFS and SYS.)
|
---|
| 100 | PATH_SYS = $(PATH_ROOT)\bin\$(BUILD_MODE)
|
---|
| 101 | # Where the documentation goes.
|
---|
| 102 | PATH_DOC = $(PATH_ROOT)\bin\$(BUILD_MODE)
|
---|
| 103 | # Where the helpfiles goes.
|
---|
| 104 | PATH_HLP = $(PATH_ROOT)\bin\$(BUILD_MODE)
|
---|
| 105 |
|
---|
| 106 |
|
---|
| 107 | # Note: Makefiles are supposed to set the correct *RELATIVE* path to the
|
---|
| 108 | # projects root. Using '\' slashes please. No trailing slash.
|
---|
| 109 | #
|
---|
| 110 | # Example:
|
---|
| 111 | # PATH_ROOT= ..\..\..
|
---|
| 112 | # Assert PATH_ROOT
|
---|
| 113 | !if "$(PATH_ROOT)" == ""
|
---|
| 114 | !error fatal error: PATH_ROOT empty or undefined.
|
---|
[8197] | 115 | !endif
|
---|
| 116 |
|
---|
| 117 |
|
---|
[8253] | 118 | # -----------------------------------------------------------------------------
|
---|
| 119 | # Common variables / Project variables
|
---|
| 120 | # -----------------------------------------------------------------------------
|
---|
[8197] | 121 |
|
---|
[8253] | 122 | # The default definitions.
|
---|
| 123 | BUILD_DEFINES = -D__WIN32OS2__ -D__WINE__ -D__i386__
|
---|
| 124 |
|
---|
| 125 | # This is the process file to include at end of the makefile.
|
---|
| 126 | MAKE_INCLUDE_PROCESS = $(PATH_MAKE)\process.mak
|
---|
| 127 |
|
---|
| 128 |
|
---|
| 129 |
|
---|
| 130 | # -----------------------------------------------------------------------------
|
---|
| 131 | # Build the environments
|
---|
| 132 | # -----------------------------------------------------------------------------
|
---|
| 133 |
|
---|
| 134 | # EXPERIMENTAL
|
---|
| 135 | !if 0
|
---|
| 136 | # These strings are passed on to the BuildEnv.cmd script to setup
|
---|
| 137 | # the correct environment.
|
---|
| 138 | BUILD_ENVS_BASE_POST = toolkit40
|
---|
| 139 | BUILD_ENVS_BASE_PRE =
|
---|
| 140 |
|
---|
| 141 | # Check for forced change in default compiler environment.
|
---|
| 142 | !ifdef BUILD_ENV_FORCE
|
---|
| 143 | !if "$(BUILD_ENV)" != "$(BUILD_ENV_FORCE)" || "$(BUILD_ENVS_PRE)" != "" || "$(BUILD_ENVS_POST)" != ""
|
---|
| 144 | #
|
---|
| 145 | # Remove old compiler and insert new compiler into the environment.
|
---|
| 146 | # The individual makefiles requests changes using BUILD_ENVS_[PRE|POST].
|
---|
| 147 | #
|
---|
| 148 | !if [echo call $(PATH_TOOLS)\BuildEnv.cmd $(BUILD_ENV)- $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(BUILD_ENV_FORCE) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)]
|
---|
| 149 | !endif
|
---|
| 150 | !if [call $(PATH_TOOLS)\BuildEnv.cmd $(BUILD_ENV)- $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(BUILD_ENV_FORCE) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)]
|
---|
| 151 | !endif
|
---|
| 152 | #BUILD_ENV = $(BUILD_ENV_FORCE)
|
---|
| 153 | !endif
|
---|
| 154 | !endif
|
---|
| 155 |
|
---|
| 156 | !endif
|
---|
| 157 |
|
---|
| 158 |
|
---|
| 159 |
|
---|
| 160 | # -----------------------------------------------------------------------------
|
---|
| 161 | # Include the setup.
|
---|
| 162 | # First the default common tools setup is included.
|
---|
| 163 | # The the environment specific setup.
|
---|
| 164 | # -----------------------------------------------------------------------------
|
---|
| 165 |
|
---|
| 166 | !include $(PATH_MAKE)\setup.tools.mk
|
---|
| 167 |
|
---|
| 168 | MAKE_INCLUDE_SETUP = $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV).mk
|
---|
| 169 | !ifndef BUILD_QUIET
|
---|
| 170 | ! if [$(ECHO) Including platform setup file $(CLRFIL)"$(MAKE_INCLUDE_SETUP)"$(CLRRST)]
|
---|
[8197] | 171 | ! endif
|
---|
| 172 | !endif
|
---|
[8253] | 173 | !include $(MAKE_INCLUDE_SETUP)
|
---|
[8197] | 174 |
|
---|
| 175 |
|
---|
[8253] | 176 | # -----------------------------------------------------------------------------
|
---|
| 177 | # Verify the environment setups.
|
---|
| 178 | # -----------------------------------------------------------------------------
|
---|
[8197] | 179 |
|
---|
| 180 | !ifndef ENV_NAME
|
---|
| 181 | !error No environment signature has been defined ($(NAME_COMPLETE))
|
---|
| 182 | !endif
|
---|
| 183 |
|
---|
| 184 | !ifndef MAKE_INCLUDE_SETUP
|
---|
| 185 | !error No setup to include has been determined (MAKE_INCLUDE_SETUP)
|
---|
| 186 | !endif
|
---|
| 187 |
|
---|
| 188 | !if "$(ENV_STATUS)" != "OK"
|
---|
| 189 | !error Environment $(ENV_NAME) does work yet (ENV_STATUS is not OK).
|
---|
| 190 | !endif
|
---|
| 191 |
|
---|
| 192 | !ifndef CC
|
---|
| 193 | !error Environment $(ENV_NAME) does not define variable (CC).
|
---|
| 194 | !endif
|
---|
| 195 |
|
---|
| 196 | !ifndef CC_FLAGS_EXE
|
---|
| 197 | !error Environment $(ENV_NAME) does not define variable (CC_FLAGS_EXE).
|
---|
| 198 | !endif
|
---|
| 199 |
|
---|
| 200 | !ifndef LINK
|
---|
| 201 | !error Environment $(ENV_NAME) does not define variable (LINK).
|
---|
| 202 | !endif
|
---|
| 203 |
|
---|
| 204 | !ifndef LINK_FLAGS_EXE
|
---|
| 205 | !error Environment $(ENV_NAME) does not define variable (LINK_FLAGS_EXE).
|
---|
| 206 | !endif
|
---|
| 207 |
|
---|
| 208 |
|
---|
[8253] | 209 | # -----------------------------------------------------------------------------
|
---|
| 210 | # Ensure the output path exists
|
---|
| 211 | # -----------------------------------------------------------------------------
|
---|
| 212 | !if "$(PATH_OBJ)" != ""
|
---|
| 213 | ! if [$(TOOL_EXISTS) $(PATH_OBJ)] != 0
|
---|
| 214 | ! ifndef BUILD_QUIET
|
---|
| 215 | ! if [$(ECHO) Target path $(PATH_OBJ) does NOT exist. Creating. $(CLRRST)]
|
---|
| 216 | ! endif
|
---|
| 217 | ! endif
|
---|
| 218 | ! if [$(TOOL_CREATEPATH) $(PATH_OBJ)]
|
---|
| 219 | ! error Fatal error: Could not create $(PATH_OBJ).
|
---|
| 220 | ! endif
|
---|
| 221 | ! endif
|
---|
| 222 | !endif
|
---|
[8197] | 223 |
|
---|
| 224 |
|
---|
| 225 | !endif MAKE_SETUP_INCLUDED
|
---|
[8253] | 226 |
|
---|