how compile with turbo c (Developers)
Hi!
> i've a program ... in turbo c for dos.
> I see many .c .prj and .hex ... nothing like .configure or other
> files to be launch for start compilation.
>
> 2) how i can compile ?
There is no configure, but there is make.
So you can do:
make clobber
make all
make clean
This will first remove all leftovers from previous compiles, then compile everything, then remove all object files, leaving only the final exe.
You must have turboc.cfg in your current directory.
Your actual makefile might look similar to this, taken from FORMAT:
CC=tcc
CFLAGS=-M -N -ln -w -a- -f- -f87- -DDEBUG -ms -r-
# smaller: -M -O -N -Z -w -a- -f- -ms
# minimalistic: -ms
# -M linkmap -O jump optimize -N stack check -Z register optimize
# -w warnall -a- no word align -f- no fpu emulator -f87- no fpu code
# -ms small memory model -ln no default libs linked ...
# -r register variables -k standard stack frame ...
LDFLAGS=
LDLIBS=
RM=command /c del
OBJS1=createfs.obj floppy.obj hdisk.obj main.obj savefs.obj bcread.obj prf.obj
OBJS2=userint.obj driveio.obj getopt.obj init.obj recordbc.obj uformat.obj
# build targets:
all: format.exe
format.exe: $(OBJS1) $(OBJS2)
$(CC) $(CFLAGS) $(LDFLAGS) -eformat *.obj $(LDLIBS)
# compile targets:
# very convenient but not available in Turbo C 2.01 - generic C/OBJ rule:
# .c.obj:
# $(CC) $(CFLAGS) -c $*.c
createfs.obj:
$(CC) $(CFLAGS) -c createfs.c
floppy.obj:
$(CC) $(CFLAGS) -c floppy.c
...
# clean up:
clean:
$(RM) *.obj
clobber:
$(RM) *.bak
$(RM) *.dsk
$(RM) *.exe
$(RM) *.obj
$(RM) *.swp
Unfortunately, Turbo C make seems to want one rule for each obj file you compile, no wildcard rule support. Also, you have to use tabs, not spaces, for the indented lines.
---
FreeDOS / DOSEMU2 / ...
Complete thread:
- how compile with turbo c - iw2evk, 16.12.2025, 13:06 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- how compile with turbo c - bencollver, 16.12.2025, 15:51
- how compile with turbo c - rr, 16.12.2025, 18:24
- how compile with turbo c - bocke, 17.12.2025, 08:57
- how compile with turbo c - bocke, 17.12.2025, 09:01
- how compile with turbo c - rr, 17.12.2025, 17:43
- how compile with turbo c - bocke, 17.12.2025, 08:57
- how compile with turbo c - rr, 16.12.2025, 18:24
- how compile with turbo c - mceric, 16.12.2025, 21:37
- how compile with turbo c - Rugxulo, 17.12.2025, 03:43
- how compile with turbo c - kerravon, 18.12.2025, 19:58
- how compile with turbo c - kerravon, 18.12.2025, 20:01
- how compile with turbo c - kerravon, 19.12.2025, 04:47
- how compile with turbo c - kerravon, 19.12.2025, 09:02
- how compile with turbo c - kerravon, 18.12.2025, 19:58
- how compile with turbo c - Rugxulo, 17.12.2025, 03:43
- how compile with turbo c - Rugxulo, 17.12.2025, 03:47
- how compile with turbo c - rr, 17.12.2025, 17:46
- how compile with turbo c - Rugxulo, 17.12.2025, 21:18
- how compile with turbo c - kerravon, 18.12.2025, 15:16
- how compile with turbo c - rr, 18.12.2025, 20:57
- how compile with turbo c - Oso2k, 19.12.2025, 06:11
- how compile with turbo c - RayeR, 19.12.2025, 03:08
- how compile with turbo c - bocke, 20.12.2025, 15:18
- how compile with turbo c - Rugxulo, 17.12.2025, 21:18
- how compile with turbo c - rr, 17.12.2025, 17:46
- how compile with turbo c - bencollver, 16.12.2025, 15:51
Mix view