home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c100 / 3.ddi / STARTUP.ZIP / EXAMPLES / FPMATH / MAKEFILE < prev    next >
Encoding:
Text File  |  1990-09-01  |  3.3 KB  |  129 lines

  1. #
  2. #    Sample makefile for building the embedded system demonstration 
  3. #    using the Turbo C++ 1.0 floating point emulator or in-line 80x87
  4. #    instructions.
  5. #
  6. #    Some of the macros used in this makefile are
  7. #
  8. #        MODEL        Selected memory model
  9. #        HUGE        True if huge memory model
  10. #        DEBUG        True if debug information is enabled
  11. #        TDREM        True if output to be debugged with the Turbo Debugger
  12. #        FLOAT        Floating point library selection
  13. #        CFG        Paradigm LOCATE configuration file extension (see below)
  14. #        OUT        Output file extension
  15. #        STACK        Set application stack size
  16. #
  17. #    Paradigm LOCATE configuration file naming conventions are
  18. #
  19. #        RM            ROM small, medium, compact and large memory models
  20. #        TD            Turbo Debugger small, medium, compact and large memory models
  21. #
  22.  
  23. MKF        =    makefile                # Build everything if the makefile is changed
  24. CC            =    tcc                    # Turbo C++ command line compiler
  25. ASM        =    tasm                    # Assembler to use (TASM/MASM/OPTASM)
  26. LINK        =    tlink                    # Linker to use
  27. LOCATE    =    locate                # Paradigm LOCATE
  28. ROMLIBS    =    c:\tc\lib            # ROM libraries path (change to yours)
  29. TCPPLIBS    =    c:\tc\lib            # Turbo C++ libraries (for floating point)
  30.  
  31. MODEL        =    c                # s, m, c, l, h
  32. HUGE        =    0                # 1 if huge memory model, 0 otherwise
  33.  
  34. DEBUG        =    1                # 0 - no debug info, 1 - debug info
  35. FLOAT        =    2                # 0 - none, 1 - not used, 2 - emulator, 3 - 80x87
  36. TDREM        =    0                # 0 - ROM build, 1 - TDREM build
  37. STACK        =    2048            # Application stack size (in bytes)
  38.  
  39. AINCLUDE    =    .
  40. AFLAGS    =    /mx /D__$(MODEL)__ /i$(AINCLUDE) /DSTKSIZE=$(STACK)
  41. CFLAGS    =    -c -m$(MODEL)
  42. TFLAGS    =    /c /v
  43. LIBS        =    $(ROMLIBS)\c$(MODEL)
  44.  
  45. #    Check if including debug info
  46. !if    $(DEBUG) == 0
  47. CFLAGS    =    $(CFLAGS) -v-
  48. !else
  49. CFLAGS    =    $(CFLAGS) -v
  50. !endif
  51.  
  52. #    Process the selected floating point option
  53. !if    $(FLOAT) == 0
  54. CFLAGS    =    $(CFLAGS) -f-
  55. !elif    $(FLOAT) == 2
  56. CFLAGS    =    $(CFLAGS) -f
  57. AFLAGS    =    $(AFLAGS) /DFLOAT=$(FLOAT)
  58. LIBS        =    $(TCPPLIBS)\emu $(ROMLIBS)\math$(MODEL) $(LIBS)
  59. !elif    $(FLOAT) == 3
  60. CFLAGS    =    $(CFLAGS) -f87
  61. AFLAGS    =    $(AFLAGS) /DFLOAT=$(FLOAT)
  62. LIBS        =    $(TCPPLIBS)\fp87 $(ROMLIBS)\math$(MODEL) $(LIBS)
  63. !else
  64. !error    Invalid floating point option selected
  65. !endif
  66.  
  67. #    Process the selected TDREM option
  68. !if    $(TDREM) == 0
  69. LOCFLGS    =    -b -h
  70. OUT        =    hex
  71. CFG        =    rm
  72. !undef    TDREM
  73. !elif    $(TDREM) == 1
  74. LOCFLGS    =    -t
  75. OUT        =    exe
  76. CFG        =    td
  77. AFLAGS    =    $(AFLAGS) /DTDREM
  78. CFLAGS    =    $(CFLAGS) -DTDREM
  79. !else
  80. !error    Invalid TDREM option selected
  81. !endif
  82.  
  83. #    Add the huge model compiler segment changes
  84. !if    $(HUGE) == 1
  85. CFLAGS    =    $(CFLAGS) -zBHUGEBSS -zD$*_BSS
  86. !endif
  87.  
  88. .c.obj:
  89.     $(CC) $(CFLAGS) {$*.c }
  90.  
  91. .asm.obj:
  92.     $(ASM) $(AFLAGS) $* ;
  93.  
  94.  
  95. #
  96. #    The remainder of the make file is the targets and dependancies
  97. #
  98.  
  99. OBJS        =    tcpp10.obj fpdemo.obj dosemu.obj conio.obj \
  100.                 fperr.obj matherr.obj tcpprtl.obj xfloat.obj
  101.  
  102.  
  103. fpdemo.$(OUT):    fpdemo.rom tcpp10.$(CFG)
  104.     $(LOCATE) -ctcpp10.$(CFG) $(LOCFLGS) $*
  105.  
  106. fpdemo.rom:        $(OBJS)
  107.     $(LINK) $(TFLAGS) @&&!
  108. $(OBJS)
  109. $*.rom
  110. $*.map
  111. $(LIBS)
  112. !
  113.  
  114. fpdemo.obj:            fpdemo.c $(MKF)
  115.  
  116. matherr.obj:        matherr.c $(MKF)
  117.  
  118. fperr.obj:            fperr.c $(MKF)
  119.  
  120. dosemu.obj:            dosemu.c typedefs.h dosemu.h $(MKF)
  121.                     
  122. conio.obj:            conio.c typedefs.h dosemu.h $(MKF)
  123.  
  124. tcpprtl.obj:        tcpprtl.asm tcpp10.inc startup.inc $(MKF)
  125.  
  126. xfloat.obj:            xfloat.asm tcpp10.inc startup.inc $(MKF)
  127.  
  128. tcpp10.obj:            tcpp10.asm tcpp10.inc startup.inc $(MKF)
  129.