Changeset 8253 for trunk/make/setup.mak


Ignore:
Timestamp:
Apr 13, 2002, 6:40:01 AM (23 years ago)
Author:
bird
Message:

Cleanups. Fixed some issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/make/setup.mak

    r8213 r8253  
    1 # $Id: setup.mak,v 1.2 2002-04-07 22:43:25 bird Exp $
    2 
    3 #
    4 # Unix-like tools for OS/2
     1# $Id: setup.mak,v 1.3 2002-04-13 04:39:59 bird Exp $
     2
     3#
     4# Generic makefile system.
    55#
    66#   Setting up the build environment variables
    77#
     8#   Many of the variables are a subject to change from project to project.
    89#
    910
     
    1314
    1415
    15 
    16 # -----------
     16# -----------------------------------------------------------------------------
     17# Validate the build the requested environment setup.
     18# -----------------------------------------------------------------------------
     19
     20SHT_TRGPLTFRM=
     21!if "$(BUILD_PLATFORM)" == "OS2"
     22SHT_TRGPLTFRM=os2
     23!endif
     24!if "$(BUILD_PLATFORM)" == "WIN32"
     25SHT_TRGPLTFRM=win32
     26!endif
     27!if "$(SHT_TRGPLTFRM)" == ""
     28! error Fatal error: Env.var BUILD_PLATFORM is either unspecified or incorrect. ($(BUILD_PLATFORM)) Valid values: OS2 and WIN32
     29!endif
     30
     31
     32SHT_BLDMD=
     33!if "$(BUILD_MODE)" == "RELEASE"
     34SHT_BLDMD=rel
     35!endif
     36!if "$(BUILD_MODE)" == "DEBUG"
     37SHT_BLDMD=deb
     38!endif
     39!if "$(BUILD_MODE)" == "PROFILE"
     40SHT_BLDMD=prf
     41!endif
     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
     44!endif
     45
     46
     47SHT_BLDENV=
     48!if "$(BUILD_ENV)" == "VAC308"
     49SHT_BLDENV=vac308
     50!endif
     51!if "$(BUILD_ENV)" == "VAC365"
     52SHT_BLDENV=vac365
     53!endif
     54!if "$(BUILD_ENV)" == "VAC4"
     55SHT_BLDENV=vac4
     56!endif
     57!if "$(BUILD_ENV)" == "EMX"
     58SHT_BLDENV=emx
     59!endif
     60!if "$(BUILD_ENV)" == "MSCV6"
     61SHT_BLDENV=mscv6
     62!endif
     63!if "$(BUILD_ENV)" == "WAT11"
     64SHT_BLDENV=wat11
     65!endif
     66!if "$(BUILD_ENV)" == "WATCOM"
     67SHT_BLDENV=wat11
     68!endif
     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
     71!endif
     72
     73
     74
     75# -----------------------------------------------------------------------------
    1776# Directories
    18 # -----------
    19 
    20 # Note: external makefiles are supposed to set the
    21 # correct *RELATIVE* path to the projects root.
    22 # PATH_ROOT= .., ..\.., whatever
    23 !ifndef PATH_ROOT
    24 !error fatal error: PATH_ROOT undefined.
    25 !endif
    26 
    27 PATH_CURRENT=$(MAKEDIR)
    28 PATH_MAKE=$(PATH_ROOT)\make
    29 PATH_TOOLS=$(PATH_ROOT)\tools\bin
    30 PATH_INCLUDE=$(PATH_ROOT)\include;$(PATH_ROOT)\include\win
    31 PATH_BIN=$(PATH_ROOT)\bin\$(BUILD_MODE)
    32 PATH_LIB=$(PATH_ROOT)\lib\$(BUILD_MODE)
    33 PATH_DLL=$(PATH_ROOT)\bin\$(BUILD_MODE)
    34 PATH_SYS=$(PATH_ROOT)\bin\$(BUILD_MODE)
    35 PATH_DOC=$(PATH_ROOT)\bin\$(BUILD_MODE)
    36 
    37 BUILD_TIMESTAMP=$(TIMESTAMP)
    38 
    39 
    40 # -----------------------------------------------------------------------
    41 # Common variables
    42 # We provide some variables that can be overridden by the specific setups
    43 # -----------------------------------------------------------------------
    44 
    45 TOOL_MAKE=$(MAKE) -nologo
    46 
    47 
    48 # ----------------------
     77# -----------------------------------------------------------------------------
     78
     79# current directory.
     80PATH_CURRENT    = $(MAKEDIR)
     81# Where build system files are located. (like this file)
     82PATH_MAKE       = $(PATH_ROOT)\make
     83# Where the bulid system and other tools are located
     84PATH_TOOLS      = $(PATH_ROOT)\tools\bin
     85# Where platform-specific files are located. (like the .def files)
     86# (default) PATH_DEF        = $(SHT_TRGPLTFRM)
     87PATH_DEF        = .
     88# Where the include files are located.
     89PATH_INCLUDES   = $(PATH_ROOT)\include;$(PATH_ROOT)\include\win
     90
     91# Where the temporary files goes.
     92PATH_OBJ    = $(PATH_ROOT)\obj\$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV)
     93# Where the executable binaries goes.
     94PATH_BIN    = $(PATH_ROOT)\bin\$(BUILD_MODE)
     95# Where the public libraries goes.
     96PATH_LIB    = $(PATH_ROOT)\lib\$(BUILD_MODE)
     97# Where the dynamic link libraries goes.
     98PATH_DLL    = $(PATH_ROOT)\bin\$(BUILD_MODE)
     99# Where the drivers goes. (common for IFS and SYS.)
     100PATH_SYS    = $(PATH_ROOT)\bin\$(BUILD_MODE)
     101# Where the documentation goes.
     102PATH_DOC    = $(PATH_ROOT)\bin\$(BUILD_MODE)
     103# Where the helpfiles goes.
     104PATH_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.
     115!endif
     116
     117
     118# -----------------------------------------------------------------------------
     119# Common variables / Project variables
     120# -----------------------------------------------------------------------------
     121
     122# The default definitions.
     123BUILD_DEFINES = -D__WIN32OS2__ -D__WINE__ -D__i386__
     124
     125# This is the process file to include at end of the makefile.
     126MAKE_INCLUDE_PROCESS    = $(PATH_MAKE)\process.mak
     127
     128
     129
     130# -----------------------------------------------------------------------------
    49131# Build the environments
    50 # ----------------------
    51 
    52 # BUILD_PLATFORM: OS2, WIN32, ...
    53 # BUILD_ENV: VAC308, VAC365, VAC4, EMX, MSC6, WATCOM
    54 # BUILD_MODE: RELEASE, PROFILE, DEBUG
    55 
    56 !ifndef BUILD_PLATFORM
    57 !error Please set BUILD_PLATFORM to OS2, WIN32, ...
    58 !endif
    59 
    60 !ifndef BUILD_MODE
    61 !error Please set BUILD_MODE to RELEASE, PROFILE, or DEBUG
    62 !endif
    63 
    64 !ifndef BUILD_ENV
    65 !error Please set BUILD_ENV to VAC308, VAC365, VAC4, EMX, MSVC6, ...
    66 !endif
    67 
    68 
    69 # ----------------------
    70 # Build the environments
    71 # ----------------------
    72 
    73 # Build the appropriate setup.xxx name from the BUILD environment variables.
    74 
    75 !if "$(BUILD_PLATFORM)" == "OS2"
    76 NAME_1=os2
    77 !endif
    78 !if "$(BUILD_PLATFORM)" == "WIN32"
    79 NAME_1=win32
    80 !endif
    81 !if "$(NAME_1)" == ""
    82 ! error The current setting of BUILD_PLATFORM is unknown or incorrect ($(BUILD_PLATFORM)) (1)
    83 !endif
    84 
    85 
    86 !if "$(BUILD_MODE)" == "RELEASE"
    87 NAME_2=rel
    88 !endif
    89 !if "$(BUILD_MODE)" == "DEBUG"
    90 NAME_2=deb
    91 !endif
    92 !if "$(BUILD_MODE)" == "PROFILE"
    93 NAME_2=prf
    94 !endif
    95 !if "$(NAME_2)" == ""
    96 ! error The current setting of BUILD_MODE is unknown or incorrect ($(BUILD_MODE)) (2)
    97 !endif
    98 
    99 
    100 !if "$(BUILD_ENV)" == "VAC308"
    101 NAME_3=vac308
    102 !endif
    103 !if "$(BUILD_ENV)" == "VAC365"
    104 NAME_3=vac365
    105 !endif
    106 !if "$(BUILD_ENV)" == "VAC4"
    107 NAME_3=vac4
    108 !endif
    109 !if "$(BUILD_ENV)" == "EMX"
    110 NAME_3=emx
    111 !endif
    112 !if "$(BUILD_ENV)" == "MSCV6"
    113 NAME_3=mscv6
    114 !endif
    115 !if "$(BUILD_ENV)" == "WATCOM"
    116 NAME_3=wat11
    117 !endif
    118 !if "$(NAME_3)" == ""
    119 ! error The current setting of BUILD_ENV is unknown or incorrect ($(BUILD_ENV)) (3)
    120 !endif
    121 
    122 
    123 # build name from the fragments
    124 !include <$(PATH_MAKE)\setup.tools.mk>
    125 MAKE_INCLUDE_SETUP=$(PATH_MAKE)\setup.$(NAME_1)$(NAME_2)$(NAME_3).mk
    126 !if [$(ECHO) Including platform setup file $(CLRFIL)"$(MAKE_INCLUDE_SETUP)"$(CLRRST)]
    127 !endif
    128 !include <$(MAKE_INCLUDE_SETUP)>
    129 
    130 # set the path name for platform-specific generated files.
    131 PATH_OBJ=$(PATH_ROOT)\obj\$(NAME_1)$(NAME_2)$(NAME_3)
    132 
    133 # set the path name for platform-specific definitino files.
    134 PATH_DEF=
    135 
    136 # ensure this path exists
     132# -----------------------------------------------------------------------------
     133
     134# EXPERIMENTAL
     135!if 0
     136# These strings are passed on to the BuildEnv.cmd script to setup
     137# the correct environment.
     138BUILD_ENVS_BASE_POST    = toolkit40
     139BUILD_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
     168MAKE_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)]
     171! endif
     172!endif
     173!include $(MAKE_INCLUDE_SETUP)
     174
     175
     176# -----------------------------------------------------------------------------
     177# Verify the environment setups.
     178# -----------------------------------------------------------------------------
     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
     209# -----------------------------------------------------------------------------
     210# Ensure the output path exists
     211# -----------------------------------------------------------------------------
    137212!if "$(PATH_OBJ)" != ""
    138213! if [$(TOOL_EXISTS) $(PATH_OBJ)] != 0
    139 !  if [$(ECHO) Target path $(PATH_OBJ) does NOT exist. Creating. $(CLRRST)]
     214!  ifndef BUILD_QUIET
     215!   if [$(ECHO) Target path $(PATH_OBJ) does NOT exist. Creating. $(CLRRST)]
     216!   endif
    140217!  endif
    141218!  if [$(TOOL_CREATEPATH) $(PATH_OBJ)]
    142 !   error Could not create $(PATH_OBJ)
     219!   error Fatal error: Could not create $(PATH_OBJ).
    143220!  endif
    144221! endif
     
    146223
    147224
    148 # -----------------------
    149 # Verify the environments
    150 # Note: "foreach" is not used to provide compatibility with older NMAKEs.
    151 # -----------------------
    152 
    153 !ifndef ENV_NAME
    154 !error No environment signature has been defined ($(NAME_COMPLETE))
    155 !endif
    156 
    157 !ifndef MAKE_INCLUDE_SETUP
    158 !error No setup to include has been determined (MAKE_INCLUDE_SETUP)
    159 !endif
    160 
    161 !if "$(ENV_STATUS)" != "OK"
    162 !error Environment $(ENV_NAME) does work yet (ENV_STATUS is not OK).
    163 !endif
    164 
    165 !ifndef CC
    166 !error Environment $(ENV_NAME) does not define variable (CC).
    167 !endif
    168 
    169 !ifndef CD
    170 !error Environment $(ENV_NAME) does not define variable (CD).
    171 !endif
    172 
    173 !ifndef CC_FLAGS_EXE
    174 !error Environment $(ENV_NAME) does not define variable (CC_FLAGS_EXE).
    175 !endif
    176 
    177 !ifndef LINK
    178 !error Environment $(ENV_NAME) does not define variable (LINK).
    179 !endif
    180 
    181 !ifndef LINK_FLAGS_EXE
    182 !error Environment $(ENV_NAME) does not define variable (LINK_FLAGS_EXE).
    183 !endif
    184 
    185 
    186 # -----------------------------------------
    187 # Now we setup some final, common variables
    188 # -----------------------------------------
    189 MAKE_INCLUDE_PROCESS=$(PATH_MAKE)\process.mak
    190 
    191 
    192225!endif MAKE_SETUP_INCLUDED
     226
Note: See TracChangeset for help on using the changeset viewer.