home *** CD-ROM | disk | FTP | other *** search
- #
- # Sample makefile for building the embedded system demonstration
- # using the Turbo C++ 1.0 floating point emulator or in-line 80x87
- # instructions.
- #
- # Some of the macros used in this makefile are
- #
- # MODEL Selected memory model
- # HUGE True if huge memory model
- # DEBUG True if debug information is enabled
- # TDREM True if output to be debugged with the Turbo Debugger
- # FLOAT Floating point library selection
- # CFG Paradigm LOCATE configuration file extension (see below)
- # OUT Output file extension
- # STACK Set application stack size
- #
- # Paradigm LOCATE configuration file naming conventions are
- #
- # RM ROM small, medium, compact and large memory models
- # TD Turbo Debugger small, medium, compact and large memory models
- #
-
- MKF = makefile # Build everything if the makefile is changed
- CC = tcc # Turbo C++ command line compiler
- ASM = tasm # Assembler to use (TASM/MASM/OPTASM)
- LINK = tlink # Linker to use
- LOCATE = locate # Paradigm LOCATE
- ROMLIBS = c:\tc\lib # ROM libraries path (change to yours)
- TCPPLIBS = c:\tc\lib # Turbo C++ libraries (for floating point)
-
- MODEL = c # s, m, c, l, h
- HUGE = 0 # 1 if huge memory model, 0 otherwise
-
- DEBUG = 1 # 0 - no debug info, 1 - debug info
- FLOAT = 2 # 0 - none, 1 - not used, 2 - emulator, 3 - 80x87
- TDREM = 0 # 0 - ROM build, 1 - TDREM build
- STACK = 2048 # Application stack size (in bytes)
-
- AINCLUDE = .
- AFLAGS = /mx /D__$(MODEL)__ /i$(AINCLUDE) /DSTKSIZE=$(STACK)
- CFLAGS = -c -m$(MODEL)
- TFLAGS = /c /v
- LIBS = $(ROMLIBS)\c$(MODEL)
-
- # Check if including debug info
- !if $(DEBUG) == 0
- CFLAGS = $(CFLAGS) -v-
- !else
- CFLAGS = $(CFLAGS) -v
- !endif
-
- # Process the selected floating point option
- !if $(FLOAT) == 0
- CFLAGS = $(CFLAGS) -f-
- !elif $(FLOAT) == 2
- CFLAGS = $(CFLAGS) -f
- AFLAGS = $(AFLAGS) /DFLOAT=$(FLOAT)
- LIBS = $(TCPPLIBS)\emu $(ROMLIBS)\math$(MODEL) $(LIBS)
- !elif $(FLOAT) == 3
- CFLAGS = $(CFLAGS) -f87
- AFLAGS = $(AFLAGS) /DFLOAT=$(FLOAT)
- LIBS = $(TCPPLIBS)\fp87 $(ROMLIBS)\math$(MODEL) $(LIBS)
- !else
- !error Invalid floating point option selected
- !endif
-
- # Process the selected TDREM option
- !if $(TDREM) == 0
- LOCFLGS = -b -h
- OUT = hex
- CFG = rm
- !undef TDREM
- !elif $(TDREM) == 1
- LOCFLGS = -t
- OUT = exe
- CFG = td
- AFLAGS = $(AFLAGS) /DTDREM
- CFLAGS = $(CFLAGS) -DTDREM
- !else
- !error Invalid TDREM option selected
- !endif
-
- # Add the huge model compiler segment changes
- !if $(HUGE) == 1
- CFLAGS = $(CFLAGS) -zBHUGEBSS -zD$*_BSS
- !endif
-
- .c.obj:
- $(CC) $(CFLAGS) {$*.c }
-
- .asm.obj:
- $(ASM) $(AFLAGS) $* ;
-
-
- #
- # The remainder of the make file is the targets and dependancies
- #
-
- OBJS = tcpp10.obj fpdemo.obj dosemu.obj conio.obj \
- fperr.obj matherr.obj tcpprtl.obj xfloat.obj
-
-
- fpdemo.$(OUT): fpdemo.rom tcpp10.$(CFG)
- $(LOCATE) -ctcpp10.$(CFG) $(LOCFLGS) $*
-
- fpdemo.rom: $(OBJS)
- $(LINK) $(TFLAGS) @&&!
- $(OBJS)
- $*.rom
- $*.map
- $(LIBS)
- !
-
- fpdemo.obj: fpdemo.c $(MKF)
-
- matherr.obj: matherr.c $(MKF)
-
- fperr.obj: fperr.c $(MKF)
-
- dosemu.obj: dosemu.c typedefs.h dosemu.h $(MKF)
-
- conio.obj: conio.c typedefs.h dosemu.h $(MKF)
-
- tcpprtl.obj: tcpprtl.asm tcpp10.inc startup.inc $(MKF)
-
- xfloat.obj: xfloat.asm tcpp10.inc startup.inc $(MKF)
-
- tcpp10.obj: tcpp10.asm tcpp10.inc startup.inc $(MKF)