Changeset 6421 for trunk/include
- Timestamp:
- Jul 31, 2001, 12:52:08 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/odin32.post.emx.mk
r6407 r6421 1 # $Id: odin32.post.emx.mk,v 1.1 2 2001-07-30 08:18:01 sandervlExp $1 # $Id: odin32.post.emx.mk,v 1.13 2001-07-30 22:52:08 bird Exp $ 2 2 3 3 # … … 6 6 # Common dll makefile rules (must be included at the last line of the makefile) 7 7 # 8 # ---------------------------------------------------------------------------------9 # NOTE: this configuration is not supported neither working, it's experimental only.10 # ---------------------------------------------------------------------------------11 #12 #13 # If ORGTARGET is defined it is used to generate the importlibrary.14 #15 # Define NOTEXPDEF to remove the $(TARGET).lib and $(TARGET)exp.def rules.16 # Define EXETARGET to make an executable. (This also applies to pdwin32.mk.)17 # Define LIBTARGET to make an internal library.18 # Define LOCALCLEAN if only the local directory is to be clean.19 # Define CLEAN2 to invoke a second clean rule named 'clean2'.20 # Define NOCLEAN to exclude the clean rule. (Remember to make your own!)21 #22 # New style: (!defined OLD_STYLE)23 # Define NO_ALL_RULE to not make default all rule.24 # Define NO_LIB_RULE to not make default lib rule.25 # Define NO_MAIN_RULE to not make default main target rule.26 # Define NO_LNKFILE_RULE to not make default link-file rule.27 # Define NO_DEP_RULE to not make dependencies rule.28 # Define NO_CLEAN_RULE to not make clean rule (same as NOCLEAN - use this!).29 # Define NO_INTERNAL_LIBS to not include libs rule for subdirectories.30 # Define NO_MAIN_BIN_COPY to not copy the target and sym file to the main31 # binary directory. It is only copied to the compiler specific directory.32 # Main bin is /bin. Compiler specific bin is /bin/debug, /bin/debug.vac36, etc.33 # Define ADDITIONAL_DEP to add dependencies rules.34 # Define ADDITIONAL_ALL to add targets all should depend on.35 #36 # Define MAKEFILE if the name of the makefile isn't "makefile".37 # Define DEFFILE to specify another file than $(TARGET).def or $(ORGTARGET).def.38 # Define this if your .exe file have a .def file.39 # Define OS2RES as the names of the OS/2 .res file to create and link40 # with the target .dll or .exe.41 # Define LIBS as a list of all the libraries to link42 # with the target .dll or .exe.43 # Define SUBDIRS when you have subdirectories which should be made.44 # dep and lib supports this fully. The rule libs are added, since we assume you45 # makes internal libraries in the subdirectories. The libs rule is one of the46 # dependencies of the main target.47 #48 49 # Sanity check50 !ifndef ODIN32_LIB51 ! error "ODIN32_LIB is not defined"52 !endif ODIN32_LIB53 !ifndef ODIN32_TOOLS54 ! error "ODIN32_TOOLS is not defined"55 !endif ODIN32_TOOLS56 57 58 !ifndef TARGET_EXTENSION59 ! ifdef LIBTARGET60 TARGET_EXTENSION=lib61 ! else62 ! ifdef EXETARGET63 TARGET_EXTENSION=exe64 ! else65 TARGET_EXTENSION=dll66 ! endif67 ! endif68 !endif69 70 71 !ifndef OLD_STYLE72 73 # Set default MAKEFILE if needed74 !ifndef MAKEFILE75 MAKEFILE = makefile76 !endif77 78 # Set default ORGTARGET if needed.79 !ifndef ORGTARGET80 ORGTARGET=$(TARGET)81 !endif82 83 # Set default DEFFILE if needed. (Required for both DLLs and EXEs!)84 !ifndef DEFFILE85 DEFFILE = $(ORGTARGET).def86 !endif87 88 # Set INTLIBS (interal) if SUBDIRS is defined and NO_INTERNAL_LIBS is undefined.89 !ifdef SUBDIRS90 ! ifndef NO_INTERNAL_LIBS91 ! ifndef LIBTARGET92 INTLIBS = libs93 ! else94 INTLIBS = libs_sub95 ! endif96 ! endif97 !endif98 99 100 !ifndef LIBTARGET101 !ifndef EXETARGET102 ###############################################################################103 # DLL Target104 ###############################################################################105 8 106 9 # 107 # Dll: All rule - build objs, target dll, copies target to bin and makes libs.10 # This is shared with VAC3 cause there is only tree minor differences. 108 11 # 109 !ifndef NO_ALL_RULE 110 all: $(OBJDIR) \ 111 $(INTLIBS) \ 112 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION) \ 113 $(OBJDIR)\$(TARGET).sym \ 114 $(ODIN32_BIN)\$(TARGET).$(TARGET_EXTENSION) \ 115 $(ODIN32_BIN)\$(TARGET).sym \ 116 lib \ 117 $(ADDITIONAL_ALL) 118 !endif 119 120 121 # 122 # Dll: Lib rule - build importlibrary (and evt. other libs) 123 # 124 !ifndef NO_LIB_RULE 125 lib: $(OBJDIR) \ 126 $(OBJDIR)\$(ORGTARGET).lib \ 127 $(ODIN32_LIB)\$(ORGTARGET).lib 128 !endif 129 130 131 # 132 # Dll: Main target rule - builds the target dll. 133 # 134 !ifndef NO_MAIN_RULE 135 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION): $(OBJS) $(OS2RES) $(DEFFILE) $(OBJDIR)\bldlevel.$(DEFFILE) $(OBJDIR)\$(TARGET).lrf 136 -4 $(LD2) $(LD2FLAGS) @$(OBJDIR)\$(TARGET).lrf 137 !ifdef OS2RES 138 $(OS2RC) $(OS2RCLFLAGS) $(OS2RES) $@ 139 !endif 140 !ifndef DEBUG 141 $(LXLITE) $@ 142 !endif 143 !endif 144 145 146 # 147 # Dll: Linker file - creates the parameter file passed on to the linker. 148 # 149 !ifndef NO_LNKFILE_RULE 150 $(OBJDIR)\$(TARGET).lrf: $(MAKEFILE) $(ODIN32_INCLUDE)\odin32.post.vac3.mk 151 @echo Creating file <<$@ 152 $(OBJS: =+^ 153 )+$(EMX)\lib\dll0.obj, 154 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION), 155 $(OBJDIR)\$(TARGET).map, 156 $(LIBS: =+^ 157 ), 158 $(OBJDIR)\bldlevel.$(DEFFILE); 159 <<keep 160 !endif 161 162 163 !else # !ifndef EXETARGET 164 ############################################################################### 165 # EXE Target 166 ############################################################################### 167 168 # 169 # Exe: All rule - build objs, target exe, copies target to bin. 170 # 171 !ifndef NO_ALL_RULE 172 all: $(OBJDIR) \ 173 $(INTLIBS) \ 174 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION) \ 175 $(OBJDIR)\$(TARGET).sym \ 176 $(ODIN32_BIN)\$(TARGET).$(TARGET_EXTENSION) \ 177 $(ODIN32_BIN)\$(TARGET).sym \ 178 $(ADDITIONAL_ALL) 179 !endif 180 181 182 # 183 # Exe: Lib rule - dummy rule 184 # 185 !ifndef NO_LIB_RULE 186 lib: 187 !endif 188 189 190 # 191 # Exe: Main target rule - builds the target exe. 192 # 193 !ifndef NO_MAIN_RULE 194 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION): $(OBJS) $(OS2RES) $(DEFFILE) $(OBJDIR)\bldlevel.$(DEFFILE) $(OBJDIR)\$(TARGET).lrf 195 -4 $(LD2) $(LD2FLAGS) @$(OBJDIR)\$(TARGET).lrf 196 !ifdef OS2RES 197 $(OS2RC) $(OS2RCLFLAGS) $(OS2RES) $@ 198 !endif 199 !ifndef DEBUG 200 $(LXLITE) $@ 201 !endif 202 !endif 203 204 205 # 206 # Exe: Linker file - creates the parameter file passed on to the linker. 207 # 208 !ifndef NO_LNKFILE_RULE 209 $(OBJDIR)\$(TARGET).lrf: $(MAKEFILE) $(ODIN32_INCLUDE)\odin32.post.vac3.mk 210 @echo Creating file <<$@ 211 $(OBJS: =+^ 212 )+$(EMX)\lib\crt0.obj, 213 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION), 214 $(OBJDIR)\$(TARGET).map, 215 $(LIBS: =+^ 216 ), 217 $(OBJDIR)\bldlevel.$(DEFFILE); 218 <<keep 219 !endif 220 221 222 !endif # !ifndef EXETARGET !else 223 !else # !ifndef LIBTARGET 224 ############################################################################### 225 # LIB target (internal or public object library) 226 ############################################################################### 227 228 # 229 # Localcleanup is default for internal object libraries. 230 # 231 !ifndef PUBLICLIB 232 LOCALCLEAN = 1 233 !endif 234 235 236 # 237 # Lib: All rule - build objs and target library. 238 # 239 !ifndef NO_ALL_RULE 240 all: $(OBJDIR) \ 241 $(INTLIBS) \ 242 !ifndef PUBLICLIB 243 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION) \ 244 $(ADDITIONAL_ALL) 245 !else 246 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION) \ 247 $(ODIN32_LIB)\$(TARGET).$(TARGET_EXTENSION) \ 248 $(ADDITIONAL_ALL) 249 !endif 250 !endif 251 252 253 # 254 # Lib: Lib rule - dummy rule 255 # 256 !ifndef NO_LIB_RULE 257 !ifndef PUBLICLIB 258 lib: 259 !else 260 lib: all 261 !endif 262 !endif 263 264 265 # 266 # Lib: Internal library rule. Same as the all rule. 267 # 268 !ifndef NO_INTERNAL_LIBS 269 libs: all 270 !endif 271 272 273 # 274 # Lib: Main target rule - builds the target internal library. 275 # 276 !ifndef NO_MAIN_RULE 277 $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION): $(OBJS) 278 $(RM) $@ 279 $(ILIB) $(ILIBFLAGS) $@ @<<$@.parm 280 $(OBJS: =^ 281 ) 282 <<keep 283 !endif 284 285 286 !endif # !ifndef LIBTARGET 287 288 289 ############################################################################### 290 # Common rules for both exe and dll, new style 291 ############################################################################### 292 293 # 294 # Common (new): Dep rule - makes depenencies for C, C++ and Asm files. 295 # 296 !ifndef NO_DEP_RULE 297 dep: dep_internal $(ADDITIONAL_DEP) 298 dep_internal: 299 $(DEPEND) $(CINCLUDES) *.c *.cpp *.h *.asm *.inc \ 300 *.rc *.dlg $(ODIN32_INCLUDE)\*.h -robj *.orc 301 !ifdef SUBDIRS 302 $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD) dep 303 !endif 304 !endif 305 306 307 # 308 # Common: Internal library rule. Make libraries in subdirectories. 309 # For makefiles with subdirectories is common to have make libraries in subdirectories. 310 # 311 !ifndef NO_INTERNAL_LIBS 312 !ifdef INTLIBS 313 $(INTLIBS): 314 $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD) libs 315 !endif 316 !endif 317 318 !endif # OLD_STYLE 319 320 ############################################################################### 321 # Common rules for both exe and dll, old and new style. 322 ############################################################################### 323 324 # 325 # Common: Copy library rule. 326 # 327 !ifndef PUBLICLIB 328 $(ODIN32_LIB)\$(ORGTARGET).lib: $(OBJDIR)\$(ORGTARGET).lib 329 !else 330 $(ODIN32_LIB)\$(TARGET).$(TARGET_EXTENSION): $(OBJDIR)\$(ORGTARGET).$(TARGET_EXTENSION) 331 !endif 332 @if not exist $(@D) $(CREATEPATH) $(@D) 333 $(CP) $** $@ 334 335 336 # 337 # Common: Copy dll/exe rule. 338 # 339 $(ODIN32_BIN)\$(TARGET).$(TARGET_EXTENSION): $(OBJDIR)\$(TARGET).$(TARGET_EXTENSION) 340 @if not exist $(@D) $(CREATEPATH) $(@D) 341 $(CP) $** $@ 342 !ifndef NO_MAIN_BIN_COPY 343 -$(CP) $** $(@D)..\..\$(@F) 344 !endif 345 346 347 # 348 # Common: Copy sym rule. 349 # 350 $(ODIN32_BIN)\$(TARGET).sym: $(OBJDIR)\$(TARGET).sym 351 @if not exist $(@D) $(CREATEPATH) $(@D) 352 $(CP) $** $@ 353 !ifndef NO_MAIN_BIN_COPY 354 -$(CP) $** $(@D)..\..\$(@F) 355 !endif 356 357 358 # 359 # Common: Make sym file rule. 360 # 361 $(OBJDIR)\$(TARGET).sym: $(OBJDIR)\$(TARGET).map 362 cd $(OBJDIR) 363 $(MAPSYM) $(TARGET).map 364 cd ..\.. 365 366 367 # 368 # Common: Make library from the <>exp.def or the <>.def file. 369 # 370 !ifndef LIBTARGET 371 !ifndef NOTEXPDEF 372 $(OBJDIR)\$(ORGTARGET).lib: $(OBJDIR)\$(ORGTARGET)exp.def 373 $(IMPLIB) $(IMPLIBFLAGS) $@ $** 374 !else 375 $(OBJDIR)\$(TARGET).lib: $(DEFFILE) 376 $(IMPLIB) $(IMPLIBFLAGS) $@ $** 377 !endif 378 !endif 379 380 381 # 382 # Common: Make the <>exp.def file. 383 # 384 !ifndef LIBTARGET 385 !ifndef NOTEXPDEF 386 !ifdef NOINTERNALFUNCTIONS 387 $(OBJDIR)\$(ORGTARGET)exp.def: $(DEFFILE) 388 $(IMPDEF) -I:20000 $** $@ 389 !else 390 $(OBJDIR)\$(ORGTARGET)exp.def: $(DEFFILE) 391 $(IMPDEF) $** $@ 392 !endif 393 !endif 394 !endif 395 396 397 # 398 # Common: Make .def-file with buildlevel info. 399 # 400 $(OBJDIR)\bldlevel.$(DEFFILE): $(DEFFILE) 401 $(BLDLEVELINF) $(DEFFILE) $@ -R"$(DEFFILE)" \ 402 -V"#define=ODIN32_VERSION,$(ODIN32_INCLUDE)\odinbuild.h" \ 403 -M"#define=ODIN32_BUILD_NR,$(ODIN32_INCLUDE)\odinbuild.h" 404 405 406 # 407 # Common: Create the object directory. 408 # 409 $(OBJDIR): 410 @if not exist $(OBJDIR) $(CREATEPATH) $(OBJDIR) 411 412 413 # 414 # Common: Generate Visual SlickEdit project. 415 # 416 !ifndef NO_VSLICKRULES 417 !ifdef ORGTARGET 418 vslick $(ORGTARGET).vpj: 419 $(RM) $(ORGTARGET).vtg 420 $(ODIN32_BASE)\tools\vslick\genproject.cmd $(CINCLUDES) $(ORGTARGET).vpj 421 !endif 422 !endif 423 424 425 # 426 # Common: General clean rule. To clean more add it to CLEANEXTRAS! 427 # 428 !ifndef NOCLEAN 429 !ifndef CLEAN2 430 clean: 431 !else 432 clean: clean2 433 !endif 434 $(RM) *.lib *.res *.map *.pch \ 435 !if "$(OBJDIR)" != "" 436 $(OBJDIR)\* \ 437 !endif 438 !ifndef LOCALCLEAN 439 $(ODIN32_LIB)\$(ORGTARGET).lib \ 440 $(ORGTARGET)exp.def \ 441 !ifndef PUBLICLIB 442 $(ODIN32_BIN)\$(TARGET).$(TARGET_EXTENSION) *.$(TARGET_EXTENSION) \ 443 $(ODIN32_BIN)\$(TARGET).sym *.sym \ 444 !endif 445 $(CLEANEXTRAS) 446 !else 447 $(CLEANEXTRAS) 448 !endif 449 !endif 450 !ifdef SUBDIRS 451 $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD) clean 452 !endif 453 454 455 # 456 # Common: Include the .depend file. 457 # If the depend file don't exists we'll complain about it. 458 # 459 !ifndef NODEP 460 ! if [$(EXISTS) .depend] == 0 461 ! include .depend 462 ! else 463 ! if [$(ECHO) .depend doesn't exist] 464 ! endif 465 ! endif 466 !endif 467 12 !include $(ODIN32_INCLUDE)/odin32.post.vac3.mk
Note:
See TracChangeset
for help on using the changeset viewer.