Annotation of sbbs/src/build/common.bmake, revision 1.1.1.2

1.1       root        1: # build/Common.bmake
                      2: #
                      3: # Global build system setup file for Borland Make/BCC
                      4: #
1.1.1.2 ! root        5: # $Id: Common.bmake,v 1.52 2011/07/14 17:19:00 rswindell Exp $
1.1       root        6: #
                      7: #############################################################################
                      8: #                                                                                                                                                      #
                      9: # Common macro setup for Borland make                                                                          #
                     10: #                                                                                                                                                      #
                     11: # Common Build Macros REQUIRED:                                                                                                #
                     12: #  SRC_ROOT                    - *MUST* be set to the src dir                                                  #
                     13: #                                                                                                                                                      #
                     14: # Common Build Macros Used:                                                                                                    #
                     15: #  DEBUG                       - Create a debug build                                                                  #
                     16: #  RELEASE                     - Create a release build                                                                #
                     17: #                                        (Mutually exclusive, if both are set, RELEASE                 #
                     18: #                                              is cleared)                                                                                     #
                     19: #  DONT_CLOBBER_CC     - Do not change the default setting of CC                               #
                     20: #  OBJPATH_SUFFIX      - Suffix appended to OBJPATH usefull for compiling              #
                     21: #                                        different options of the same source file                             #
                     22: #                                                                                                                                                      #
                     23: # Common Build Macros Defined:                                                                                         #
                     24: #  DELETE                      - Delete files (Preferrably verbose)                                    #
                     25: #  OBJODIR                     - Object output dir                                                                             #
                     26: #  LIBODIR                     - Library output dir                                                                    #
                     27: #  EXEODIR                     - Executable output dir                                                                 #
                     28: #  DEBUG                       - Set for debug builds                                                                  #
                     29: #  RELEASE                     - Set for release builds                                                                #
                     30: #                                        One of DEBUG or RELEASE is always set!                                #
                     31: #  QUIET                       - Target command prefix to show/not show commands               #
                     32: #                                        (Toggled off by setting VERBOSE)                                              #
                     33: #  CFLAGS                      - Common C and C++ compiler flags                                               #
                     34: #  CCFLAGS                     - C specific compiler flags                                                             #
                     35: #  CXXFLAGS                    - C++ specific compiler flags                                                   #
                     36: #  LDFLAGS                     - Linker flags                                                                                  #
                     37: #  CC                          - C compiler                                                                                    #
                     38: #  CXX                         - C++ compiler                                                                                  #
                     39: #  EXEFILE                     - Executable file extension (Includes .)                                #
                     40: #  OFILE                       - Object file extension (Includes .)                                    #
                     41: #  SOFILE                      - Shared object (DLL) file extension (Includes .)               #
                     42: #  LIBFILE                     - Static library file extension (Include .)                             #
                     43: #  LIBPREFIX           - Prefix to library filename                                                    #
                     44: #  LIBS                                - Library names (Appropriate for dependencies)                  #
                     45: #  LIB_LDFLAGS         - Libraries appropriate for link command-line usage             #
                     46: #  COMPILE_MSG         - Message saying a target is being compiled                             #
                     47: #  DIRSEP                      - The directory seperator this system likes most                #
                     48: #  VERSION                     - Synchronet version number in MAJOR.MINOR format               #
                     49: #                                        (Numeric ONLY)                                                                                #
                     50: #  OUTPUT                      - Compiler flag specifying output filename                              #
                     51: #  LOUTPUT                     - Linker flag specifying output filename                                #
                     52: #  XPDEV_SRC           - Path to xpdev                                                                                 #
                     53: #  UIFC_SRC                    - Path to uifc                                                                                  #
                     54: #  CIOLIB_SRC          - Path to ciolib                                                                                #
                     55: #  SMBLIB_SRC          - Path to smblib                                                                                #
                     56: #  MT_CFLAGS           - CFLAGS for building MT objects                                                #
                     57: #  MT_LDFLAGS          - LDFLAGS for linking MT targets                                                #
                     58: #  UL_PRE           - Use Library prefix (*nix is -l)                       #
                     59: #  UL_SUF           - Use Library siffix (bcc is .lib)                      #
                     60: #                                                                                                                                                      #
                     61: # Common Targets Defined:                                                                                                      #
                     62: #  Implicit C and C++ targets                                                                                          #
                     63: #  "clean" target                                                                                                                      # 
                     64: #  Output directory targets                                                                                                    #
                     65: #                                                                                                                                                      #
                     66: #############################################################################
                     67: 
                     68: .autodepend
                     69: .cacheautodepend
                     70: 
                     71: # Macros
                     72: # Set VERSION
                     73: !ifndef VERSION
                     74:  VERSION       =       3.14
                     75: !endif
                     76: 
                     77: # Set DEBUG
                     78: !ifdef DEBUG
                     79: ! ifdef RELEASE
                     80: !  undef RELEASE
                     81: ! endif
                     82: !endif
                     83: 
                     84: !ifndef DEBUG
                     85: ! ifndef RELEASE
                     86:   DEBUG        =       1
                     87: ! endif
                     88: !endif
                     89: 
                     90: # VERBOSE/QUIET
                     91: !ifndef VERBOSE
                     92:  QUIET =       @
                     93: !endif
                     94: 
                     95: # OS-specific
                     96: DIRSEP =       \       # This comment is necessary
                     97: EXEFILE        =       .exe
                     98: OFILE  =       .obj
                     99: SOFILE =       .dll
                    100: LIBFILE        =       .lib
                    101: DELETE =       echo y | del 
                    102: IFNOTEXIST = if not exist $@
                    103: UL_PRE =       
                    104: UL_SUF =       $(LIBFILE)
                    105: 
                    106: # Compiler-specific
                    107: !ifdef msc     # Microsoft Visual C++
                    108: CC             =       cl
                    109: LD             =       link
1.1.1.2 ! root      110: CCPRE  =       msvc
1.1       root      111: OUTPUT =       -Fo
                    112: LOUTPUT        =       -Fe
                    113: CFLAGS  =      -nologo -MTd
                    114: LDFLAGS        =       $(CFLAGS)
                    115: !ifdef DEBUG
                    116:  CFLAGS        =       $(CFLAGS) -Yd
                    117: !endif
                    118: 
                    119: !else          # Borland C++
                    120: 
                    121: CC             =       bcc32
                    122: CCPRE  =       bcc
                    123: LD             =       ilink32
                    124: OUTPUT =       -o
                    125: LOUTPUT        =       $(OUTPUT)
                    126: CFLAGS =       -q 
                    127: LDFLAGS        =       $(CFLAGS)
                    128: CFLAGS  =      $(CFLAGS) -M -X-
                    129: MT_CFLAGS = -WM 
                    130: MT_LDFLAGS = -WM 
                    131: !ifdef DEBUG
                    132:  CFLAGS        =       $(CFLAGS) -v
                    133: !endif
                    134: !endif
                    135: MKSHLIB =       $(CC) -WD
                    136: 
                    137: # Common compiler flags
                    138: !ifdef DEBUG
                    139: CFLAGS =       $(CFLAGS) -Od -D_DEBUG 
                    140: !endif
                    141: 
1.1.1.2 ! root      142: # Required for Embarcadero C++Builder 2010
        !           143: !if $(__MAKE__) >= 0x0540
        !           144:        CCPRE   =       ecc6
        !           145:        CFLAGS  =       $(CFLAGS) -DHAS_STDINT_H -D_WIN32_WINNT=0x502
        !           146: !endif
        !           147: 
1.1       root      148: # Debug or release build?
                    149: !ifdef DEBUG
                    150: BUILD  =       debug
                    151: !else
                    152: BUILD  =       release
                    153: !endif
                    154: !ifndef BUILDPATH
                    155: BUILDPATH      =       $(BUILD)
                    156: !endif
                    157: 
                    158: OBJODIR =      $(CCPRE).win32.obj.$(BUILDPATH)
                    159: MTOBJODIR =    $(CCPRE).win32.obj.$(BUILDPATH)_mt
                    160: LIBODIR =      $(CCPRE).win32.lib.$(BUILDPATH)
                    161: EXEODIR =      $(CCPRE).win32.exe.$(BUILDPATH)
                    162: 
                    163: # Paths
                    164: XPDEV_SRC      =       $(SRC_ROOT)$(DIRSEP)xpdev
                    165: CIOLIB_SRC     =       $(SRC_ROOT)$(DIRSEP)conio
                    166: SMBLIB_SRC     =       $(SRC_ROOT)$(DIRSEP)smblib
                    167: UIFC_SRC       =       $(SRC_ROOT)$(DIRSEP)uifc
                    168: 
1.1.1.2 ! root      169: # SDL ciolib enabled by default for the moment.
        !           170: !ifndef WITHOUT_SDL
        !           171: !ifndef USE_SDL_AUDIO
        !           172: USE_SDL        =       1
        !           173: !endif
        !           174: !endif
        !           175: 
1.1       root      176: # Pull in lib-specific flags
                    177: !include     $(XPDEV_SRC)$(DIRSEP)Common.make
                    178: !include     $(XPDEV_SRC)$(DIRSEP)Common.bmake
                    179: !include     $(SMBLIB_SRC)$(DIRSEP)Common.make
                    180: !include     $(CIOLIB_SRC)$(DIRSEP)Common.make
1.1.1.2 ! root      181: !include     $(CIOLIB_SRC)$(DIRSEP)Common.bmake
1.1       root      182: !include     $(UIFC_SRC)$(DIRSEP)Common.make
                    183: 
                    184: .path.c                =       .
                    185: .path.cpp      =       .
                    186: 
                    187: !include targets.mk
                    188: !include $(SRC_ROOT)/build/rules.mk
                    189: !include objects.mk            # defines $(OBJS)
                    190: 
                    191: .SUFFIXES
                    192: .SUFFIXES .cpp .c
                    193: # Implicit C Compile Rule
                    194: .c{$(OBJODIR)}$(OFILE):
                    195:        $(QUIET)$(CC) $(CFLAGS) $(CCFLAGS) -n$(OBJODIR) -c $< $(OUTPUT)$@
                    196: 
                    197: # Implicit C++ Compile Rule
                    198: .cpp{$(OBJODIR)}$(OFILE):
                    199:        $(QUIET)$(CC) $(CFLAGS) $(CXXFLAGS) -n$(OBJODIR) -c $< $(OUTPUT)$@
                    200: 
                    201: # Implicit MT C Compile Rule
                    202: .c{$(MTOBJODIR)}$(OFILE):
                    203:        $(QUIET)$(CC) $(CFLAGS) $(CCFLAGS) -n$(MTOBJODIR) $(MT_CFLAGS) -c $< $(OUTPUT)$@
                    204: 
                    205: # Implicit MT C++ Compile Rule
                    206: .cpp{$(MTOBJODIR)}$(OFILE):
                    207:        $(QUIET)$(CC) $(CFLAGS) $(CXXFLAGS) -n$(MTOBJODIR) $(MT_CFLAGS) -c $< $(OUTPUT)$@
                    208: 
                    209: $(XPDEV_LIB): xpdev
                    210: xpdev:
                    211:        $(COMSPEC) <<|
                    212:        set VERSION=$(VERSION)
                    213:        set DEBUG=$(DEBUG)
                    214:        set RELEASE=$(RELEASE)
                    215:        set VERBOSE=$(VERBOSE)
                    216:        set BUILDPATH=$(BUILDPATH)
                    217:        set USE_SDL=$(USE_SDL)
1.1.1.2 ! root      218:        set USE_SDL_AUDIO=$(USE_SDL_AUDIO)
1.1       root      219:        cd $(XPDEV_SRC)
                    220:        $(MAKE) -$(MAKEFLAGS) lib
                    221:        exit
                    222: |
                    223: 
                    224: $(XPDEV-MT_LIB): xpdev-mt
                    225: xpdev-mt:
                    226:        $(COMSPEC) <<|
                    227:        set VERSION=$(VERSION)
                    228:        set DEBUG=$(DEBUG)
                    229:        set RELEASE=$(RELEASE)
                    230:        set VERBOSE=$(VERBOSE)
                    231:        set BUILDPATH=$(BUILDPATH)
                    232:        set USE_SDL=$(USE_SDL)
1.1.1.2 ! root      233:        set USE_SDL_AUDIO=$(USE_SDL_AUDIO)
1.1       root      234:        cd $(XPDEV_SRC)
                    235:        $(MAKE) -$(MAKEFLAGS) mtlib
                    236:        exit
                    237: |
                    238: 
                    239: $(SMBLIB): smblib
                    240: smblib:
                    241:        $(COMSPEC) <<|
                    242:        set VERSION=$(VERSION)
                    243:        set DEBUG=$(DEBUG)
                    244:        set RELEASE=$(RELEASE)
                    245:        set VERBOSE=$(VERBOSE)
                    246:        set BUILDPATH=$(BUILDPATH)
                    247:        cd $(SMBLIB_SRC)
                    248:        $(MAKE) -$(MAKEFLAGS) lib
                    249:        exit
                    250: |
                    251: 
                    252: $(CIOLIB-MT): ciolib-mt
                    253: ciolib-mt:
                    254:        $(COMSPEC) <<|
                    255:        set VERSION=$(VERSION)
                    256:        set DEBUG=$(DEBUG)
                    257:        set RELEASE=$(RELEASE)
                    258:        set VERBOSE=$(VERBOSE)
                    259:        set BUILDPATH=$(BUILDPATH)
                    260:        set USE_SDL=$(USE_SDL)
1.1.1.2 ! root      261:        set USE_SDL_AUDIO=$(USE_SDL_AUDIO)
1.1       root      262:        set STATIC_SDL=$(STATIC_SDL)
                    263:        cd $(CIOLIB_SRC)
                    264:        $(MAKE) -$(MAKEFLAGS) mtlib
                    265:        exit
                    266: |
                    267: 
                    268: $(UIFCLIB): uifc
                    269: uifc:
                    270:        $(COMSPEC) <<|
                    271:        set VERSION=$(VERSION)
                    272:        set DEBUG=$(DEBUG)
                    273:        set RELEASE=$(RELEASE)
                    274:        set VERBOSE=$(VERBOSE)
                    275:        set BUILDPATH=$(BUILDPATH)
                    276:        set USE_SDL=$(USE_SDL)
1.1.1.2 ! root      277:        set USE_SDL_AUDIO=$(USE_SDL_AUDIO)
1.1       root      278:        cd $(UIFC_SRC)
                    279:        $(MAKE) -$(MAKEFLAGS) lib
                    280:        exit
                    281: |
                    282: 
                    283: $(UIFCLIB-MT): uifc-mt
                    284: uifc-mt:
                    285:        $(COMSPEC) <<|
                    286:        set VERSION=$(VERSION)
                    287:        set DEBUG=$(DEBUG)
                    288:        set RELEASE=$(RELEASE)
                    289:        set VERBOSE=$(VERBOSE)
                    290:        set BUILDPATH=$(BUILDPATH)
                    291:        set USE_SDL=$(USE_SDL)
1.1.1.2 ! root      292:        set USE_SDL_AUDIO=$(USE_SDL_AUDIO)
1.1       root      293:        set STATIC_SDL=$(STATIC_SDL)
                    294:        cd $(UIFC_SRC)
                    295:        $(MAKE) -$(MAKEFLAGS) mtlib
                    296:        exit
                    297: |

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.