| 1 | # $Id: odin32.mk,v 1.7 2001-10-01 01:27:54 bird Exp $
 | 
|---|
| 2 | 
 | 
|---|
| 3 | #
 | 
|---|
| 4 | # Odin32 API
 | 
|---|
| 5 | #
 | 
|---|
| 6 | #      Create:      cdmckill@novice.uwaterloo.ca, January 4th, 1998
 | 
|---|
| 7 | #      Modified:    phaller@gmx.net, May 27th, 1999
 | 
|---|
| 8 | #                   knut.stange.osmundsen@mynd.no, 2nd Dec. 2000
 | 
|---|
| 9 | #
 | 
|---|
| 10 | 
 | 
|---|
| 11 | #
 | 
|---|
| 12 | # defines
 | 
|---|
| 13 | #    DEBUG - build a debug version instead of release version
 | 
|---|
| 14 | #    PROFILE - build a profile debug version instead of release version
 | 
|---|
| 15 | #    CCENV:
 | 
|---|
| 16 | #      VAC3  - use IBM VisualAge for C++ 3 compiler environment (default).
 | 
|---|
| 17 | #      VAC36 - use IBM VisualAge for C++ 3.6.5 compiler environment.
 | 
|---|
| 18 | #      WAT   - use Watcom C/C++ v11.x compiler environment.
 | 
|---|
| 19 | #      EMX   - use GNU/EMX compiler environment. (don't work!)
 | 
|---|
| 20 | #
 | 
|---|
| 21 | 
 | 
|---|
| 22 | #
 | 
|---|
| 23 | # Determin compiler environment
 | 
|---|
| 24 | #
 | 
|---|
| 25 | !ifndef __VERSION__
 | 
|---|
| 26 | NMAKE   = 1
 | 
|---|
| 27 | !   ifndef CCENV
 | 
|---|
| 28 | CCENV   = VAC3
 | 
|---|
| 29 | MKFILE  = $(CCENV)
 | 
|---|
| 30 | DIREXT  =
 | 
|---|
| 31 | VAC3    = 1
 | 
|---|
| 32 | !   else
 | 
|---|
| 33 | !       if "$(CCENV)" == "VAC36"
 | 
|---|
| 34 | CCENV   = VAC36
 | 
|---|
| 35 | MKFILE  = $(CCENV)
 | 
|---|
| 36 | DIREXT  = .vac36
 | 
|---|
| 37 | VAC36   = 1
 | 
|---|
| 38 | !       else
 | 
|---|
| 39 | !           if "$(CCENV)" == "EMX"
 | 
|---|
| 40 | CCENV   = EMX
 | 
|---|
| 41 | MKFILE  = $(CCENV)
 | 
|---|
| 42 | DIREXT  = .emx
 | 
|---|
| 43 | EMXENV  = 1             # Can't use EMX. (SET EMX will show you why)
 | 
|---|
| 44 | !           else
 | 
|---|
| 45 | !               if "$(CCENV)" == "WAT"
 | 
|---|
| 46 | # (nmake and Watcom)
 | 
|---|
| 47 | CCENV   = WAT
 | 
|---|
| 48 | MKFILE  = WATN
 | 
|---|
| 49 | DIREXT  = .wat
 | 
|---|
| 50 | WAT     = 1
 | 
|---|
| 51 | !               else
 | 
|---|
| 52 | # default compiler
 | 
|---|
| 53 | CCENV   = VAC3
 | 
|---|
| 54 | MKFILE  = $(CCENV)
 | 
|---|
| 55 | DIREXT  =
 | 
|---|
| 56 | VAC3    = 1
 | 
|---|
| 57 | !               endif
 | 
|---|
| 58 | !           endif
 | 
|---|
| 59 | !       endif
 | 
|---|
| 60 | !   endif
 | 
|---|
| 61 | !else
 | 
|---|
| 62 | # (wmake and Watcom)
 | 
|---|
| 63 | WMAKE   = 1
 | 
|---|
| 64 | CCENV   = WAT
 | 
|---|
| 65 | MKFILE  = $(CCENV)
 | 
|---|
| 66 | DIREXT  = .wat
 | 
|---|
| 67 | WAT     = 1
 | 
|---|
| 68 | !   if "$(%DEBUG)" != ""
 | 
|---|
| 69 | DEBUG   = 1
 | 
|---|
| 70 | !   endif
 | 
|---|
| 71 | !endif
 | 
|---|
| 72 | 
 | 
|---|
| 73 | 
 | 
|---|
| 74 | #
 | 
|---|
| 75 | # Target directories.
 | 
|---|
| 76 | # Both bin and lib directories are compiler dependent.
 | 
|---|
| 77 | #
 | 
|---|
| 78 | !ifndef ODIN32_BIN
 | 
|---|
| 79 | !   ifdef DEBUG
 | 
|---|
| 80 | !       ifndef PROFILE
 | 
|---|
| 81 | ODIN32_BIN  = $(ODIN32_BIN_)\Debug$(DIREXT)
 | 
|---|
| 82 | ODIN32_BIN__= $(ODIN32_BIN_)\Debug$(DIREXT)
 | 
|---|
| 83 | !       else
 | 
|---|
| 84 | ODIN32_BIN  = $(ODIN32_BIN_)\Profile$(DIREXT)
 | 
|---|
| 85 | ODIN32_BIN__= $(ODIN32_BIN_)\Profile$(DIREXT)
 | 
|---|
| 86 | !       endif
 | 
|---|
| 87 | !   else
 | 
|---|
| 88 | !       ifdef PROFILE
 | 
|---|
| 89 | ODIN32_BIN  = $(ODIN32_BIN_)\Profile$(DIREXT)
 | 
|---|
| 90 | ODIN32_BIN__= $(ODIN32_BIN_)\Profile$(DIREXT)
 | 
|---|
| 91 | !       else
 | 
|---|
| 92 | ODIN32_BIN  = $(ODIN32_BIN_)\Release$(DIREXT)
 | 
|---|
| 93 | ODIN32_BIN__= $(ODIN32_BIN_)\Release$(DIREXT)
 | 
|---|
| 94 | !       endif
 | 
|---|
| 95 | !   endif
 | 
|---|
| 96 | !endif
 | 
|---|
| 97 | 
 | 
|---|
| 98 | !ifndef ODIN32_LIB
 | 
|---|
| 99 | !   ifdef DEBUG
 | 
|---|
| 100 | !       ifndef PROFILE
 | 
|---|
| 101 | ODIN32_LIB  = $(ODIN32_LIB_)\Debug$(DIREXT)
 | 
|---|
| 102 | ODIN32_LIB__= $(ODIN32_LIB_)\Debug$(DIREXT)
 | 
|---|
| 103 | !       else
 | 
|---|
| 104 | ODIN32_LIB  = $(ODIN32_LIB_)\Profile$(DIREXT)
 | 
|---|
| 105 | ODIN32_LIB__= $(ODIN32_LIB_)\Profile$(DIREXT)
 | 
|---|
| 106 | !       endif
 | 
|---|
| 107 | !   else
 | 
|---|
| 108 | !       ifdef PROFILE
 | 
|---|
| 109 | ODIN32_LIB  = $(ODIN32_LIB_)\Profile$(DIREXT)
 | 
|---|
| 110 | ODIN32_LIB__= $(ODIN32_LIB_)\Profile$(DIREXT)
 | 
|---|
| 111 | !       else
 | 
|---|
| 112 | ODIN32_LIB  = $(ODIN32_LIB_)\Release$(DIREXT)
 | 
|---|
| 113 | ODIN32_LIB__= $(ODIN32_LIB_)\Release$(DIREXT)
 | 
|---|
| 114 | !       endif
 | 
|---|
| 115 | !   endif
 | 
|---|
| 116 | !endif
 | 
|---|
| 117 | 
 | 
|---|
| 118 | !ifndef OBJDIR
 | 
|---|
| 119 | !   ifdef DEBUG
 | 
|---|
| 120 | !       ifndef PROFILE
 | 
|---|
| 121 | OBJDIR   = .\bin\Debug$(DIREXT)
 | 
|---|
| 122 | !       else
 | 
|---|
| 123 | OBJDIR   = .\bin\Profile$(DIREXT)
 | 
|---|
| 124 | !       endif
 | 
|---|
| 125 | !   else
 | 
|---|
| 126 | !       ifdef PROFILE
 | 
|---|
| 127 | OBJDIR   = .\bin\Profile$(DIREXT)
 | 
|---|
| 128 | !       else
 | 
|---|
| 129 | OBJDIR   = .\bin\Release$(DIREXT)
 | 
|---|
| 130 | !       endif
 | 
|---|
| 131 | !   endif
 | 
|---|
| 132 | !endif
 | 
|---|
| 133 | 
 | 
|---|
| 134 | 
 | 
|---|
| 135 | #
 | 
|---|
| 136 | # Post include macro.
 | 
|---|
| 137 | #
 | 
|---|
| 138 | ODIN32_POST_INC = $(ODIN32_INCLUDE)/odin32.post.mk
 | 
|---|
| 139 | 
 | 
|---|
| 140 | 
 | 
|---|
| 141 | #
 | 
|---|
| 142 | # Common rules macro. (All makefiles should have these!)
 | 
|---|
| 143 | # (Please don't change order of these rules!)
 | 
|---|
| 144 | #
 | 
|---|
| 145 | COMMONRULES = clean dep lib all nothing
 | 
|---|
| 146 | 
 | 
|---|
| 147 | 
 | 
|---|
| 148 | #
 | 
|---|
| 149 | # Altern configuration if we're making the custom build object library.
 | 
|---|
| 150 | #
 | 
|---|
| 151 | CUST =
 | 
|---|
| 152 | !if "$(CUSTOMBUILD)" == "1"
 | 
|---|
| 153 | !   ifndef LIBTARGET
 | 
|---|
| 154 | !       ifndef PUBLICLIB
 | 
|---|
| 155 | CUST        = o
 | 
|---|
| 156 | LIBTARGET   = 1
 | 
|---|
| 157 | PUBLICLIB   = 1
 | 
|---|
| 158 | WRC_PREFIX_RESOURCE=1
 | 
|---|
| 159 | !       else
 | 
|---|
| 160 | CUSTOMBUILD = 0
 | 
|---|
| 161 | !       endif
 | 
|---|
| 162 | !   else
 | 
|---|
| 163 | CUSTOMBUILD = 0
 | 
|---|
| 164 | !   endif
 | 
|---|
| 165 | !endif
 | 
|---|
| 166 | 
 | 
|---|
| 167 | 
 | 
|---|
| 168 | #
 | 
|---|
| 169 | # Include compiler environment.
 | 
|---|
| 170 | #
 | 
|---|
| 171 | !ifndef ONLY_TOOLS
 | 
|---|
| 172 | !ifdef DEBUG
 | 
|---|
| 173 | !   ifndef PROFILE
 | 
|---|
| 174 | !       include $(ODIN32_INCLUDE)/odin32.dbg.$(MKFILE).mk
 | 
|---|
| 175 | !   else
 | 
|---|
| 176 | !       include $(ODIN32_INCLUDE)/odin32.profile.$(MKFILE).mk
 | 
|---|
| 177 | !   endif
 | 
|---|
| 178 | !else
 | 
|---|
| 179 | !   ifdef PROFILE
 | 
|---|
| 180 | !       include $(ODIN32_INCLUDE)/odin32.profile.$(MKFILE).mk
 | 
|---|
| 181 | !   else
 | 
|---|
| 182 | !       include $(ODIN32_INCLUDE)/odin32.rel.$(MKFILE).mk
 | 
|---|
| 183 | !   endif
 | 
|---|
| 184 | !endif
 | 
|---|
| 185 | !endif
 | 
|---|
| 186 | 
 | 
|---|
| 187 | 
 | 
|---|
| 188 | #
 | 
|---|
| 189 | # Compiler environment modifications for custombuild.
 | 
|---|
| 190 | #
 | 
|---|
| 191 | !if "$(CUSTOMBUILD)" == "1"
 | 
|---|
| 192 | DLLENTRY =
 | 
|---|
| 193 | !endif
 | 
|---|
| 194 | 
 | 
|---|
| 195 | 
 | 
|---|
| 196 | #
 | 
|---|
| 197 | # Include system tools
 | 
|---|
| 198 | #
 | 
|---|
| 199 | !include $(ODIN32_INCLUDE)/odin32.tools.mk
 | 
|---|
| 200 | 
 | 
|---|