# # $Id$ # # Defines specific to a particular version of the compiler # # Inputs: # ~~~~~~~ # STATIC - if defined means creating a static library or executable # DEBUG - if defined means building with debug information # UNICODE - if defined means building unicode # CBX - if defined means building with the new CBuilderX preview compiler # # Outputs: # ~~~~~~~~ # CC - name of compiler # LD - name of linker # AR - name of librarian # RC - name of resource compiler # COMMON_CFLAGS - compiler flags for all targets # COMMON_LFLAGS - linker flags for all targets # COMMON_LIBS - linker library files for all targets # DLL_CFLAGS - compiler flags specific to DLL targets # DLL_LFLAGS - linker flags specific to DLL targets # DLL_STARTUP_OBJ - start-up object files for DLL targets # EXE_CFLAGS - compiler flags specific to EXE targets # EXE_LFLAGS - linker flags specific to EXE targets # EXE_STARTUP_OBJ - start-up object files for EXE targets # LIB_CFLAGS - compiler flags specific to static lib targets # LIB_LFLAGS - flags specific to static lib targets (passed to # librarian) # OBJ_EXT - the extension to be used for object files # LIB_EXT - the extension to be used for libs # # Get the BCBVER and VCLVER, if it is not set, we default to BCB6. !if $(BCBVER) == 8 VCLVER = !else !if $(BCBVER) == 6 VCLVER = !else !if $(BCBVER) == 5 VCLVER = 50 !else !if $(BCBVER) == 4 VCLVER = 40 !else !error BCBVER must be explicitly set as environment variable or is set to a not supported value. !endif !endif !endif !endif !ifdef CBX OBJ_EXT = o LIB_EXT = a !else OBJ_EXT = obj LIB_EXT = lib !endif # # Build tools # !ifdef CBX CC = bccx LD = ilink AR = ar RC = brcc32 !else CC = bcc32 LD = ilink32 AR = tlib RC = brcc32 !endif # # Common flags # !ifdef DEBUG !ifdef CBX DEBUG_CFLAGS = -v -y -Od -vi- -k -D_DEBUG -DACE_NO_INLINE=1 DEBUG_LFLAGS = -v !else DEBUG_CFLAGS = -v -y -Od -r- -vi- -k -D_DEBUG -DACE_NO_INLINE=1 DEBUG_LFLAGS = -v !endif !else !if $(BCBVER) == 6 || $(BCBVER) == 5 DEBUG_CFLAGS = -OS -Ov -Og -DNDEBUG !else DEBUG_CFLAGS = -O2 -DNDEBUG !endif DEBUG_LFLAGS = !endif !ifdef STATIC STATIC_CFLAGS = STATIC_LFLAGS = !else STATIC_CFLAGS = -tWR STATIC_LFLAGS = !endif !ifdef CODEGUARD CODEGUARD_CFLAGS = -vG !endif !ifdef UNICODE UNICODE_CFLAGS = -DACE_USES_WCHAR -WU !endif !ifdef PCH_HEADER PCH_CFLAGS = -H=$(OBJDIR)\$(NAME).csm -Hh=$(PCH_HEADER) !endif THREAD_CFLAGS = -tWM WARNINGS_CFLAGS = -w-rvl -w-rch -w-ccc -w-obs -w-aus -w-pia -w-inl !ifdef CBX DEFINES_CFLAGS = QUIET_CFLAGS = MISC_CFLAGS = !else DEFINES_CFLAGS = -DWIN32;_NO_VCL QUIET_CFLAGS = -q MISC_CFLAGS = !endif DECORATOR_CFLAGS = -DACE_LD_DECORATOR_STR=ACE_LIB_TEXT(\"$(LIB_DECORATOR)\") COMMON_CFLAGS = $(QUIET_CFLAGS) $(DEBUG_CFLAGS) $(THREAD_CFLAGS) \ $(STATIC_CFLAGS) $(WARNINGS_CFLAGS) $(DEFINES_CFLAGS) \ $(MISC_CFLAGS) $(CODEGUARD_CFLAGS) $(UNICODE_CFLAGS) \ $(DECORATOR_CFLAGS) $(PCH_CFLAGS) COMMON_LFLAGS = $(DEBUG_LFLAGS) $(STATIC_LFLAGS) -x -w-dup -Gn # # DLL specific flags # DLL_CFLAGS = -tWD DLL_LFLAGS = -Tpd -Gi !ifdef UNICODE DLL_STARTUP_OBJ = c0d32w.$(OBJ_EXT) !else DLL_STARTUP_OBJ = c0d32.$(OBJ_EXT) !endif # # EXE specific flags # EXE_CFLAGS = EXE_LFLAGS = -Tpe !ifdef UNICODE EXE_STARTUP_OBJ = c0x32w.$(OBJ_EXT) !else EXE_STARTUP_OBJ = c0x32.$(OBJ_EXT) !endif # # Static lib specific flags # LIB_CFLAGS = !ifdef CBX LIB_LFLAGS = cfrv !else !ifdef DEBUG LIB_LFLAGS = /C /P4096 !else LIB_LFLAGS = /C /P512 !endif !endif # # Libraries to be linked # !ifdef CODEGUARD CODEGUARD_LIB = cg32.lib !endif !ifdef STATIC COMMON_LIBS = $(CODEGUARD_LIB) import32.$(LIB_EXT) cw32mt.lib ws2_32.lib !else COMMON_LIBS = $(CODEGUARD_LIB) import32.$(LIB_EXT) cw32mti.lib ws2_32.lib !endif