Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

how compile with turbo c (Developers)

posted by Rugxulo Homepage, Usono, 17.12.2025, 03:43

> 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.

./configure is GNU-style for a POSIX shell (e.g. bash). While DJGPP does have a port of Bash, I believe ./configure won't really work (much, if at all) except under old 32-bit Windows' NTVDM.

Actually, you may have some success under DOSEMU2.

> 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.

Overkill, a .BAT would work just as well in 90% of cases, honestly.

The only advantage to a makefile is to (allegedly) save compilation time (and effort, not recompiling without changes) or be portable (e.g. GNUmakefile).

> You must have turboc.cfg in your current directory.

Since DOS 3.0, it should work from the .EXE directory too.

BTW, I still see bad makefiles using TLINK directly (with absolute paths!) instead of TCC. That is never necessary.

> Your actual makefile might look similar to this, taken from FORMAT:
> ...
> # very convenient but not available in Turbo C 2.01 - generic C/OBJ rule:
> # .c.obj:
> # $(CC) $(CFLAGS) -c $*.c

Are you sure? I know TC 2.01 (and TP 5.5) have a much weaker MAKE, but it should work there too. But I honestly don't remember.

At worst, you can use a different make (e.g. Wmaker or Dmake). At least Dmake (and TC++ 1.01 Make) let you swap out to save memory.

> 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.

Are you sure? I know TC++ 1.01 Make allows that. Dmake is also quite friendly.

Check these old makefiles I made for NASM:

* http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/devel/asm/nasm/0.98.39/8086host/n16tcmak.zip

 

Complete thread:

Back to the forum
Board view  Mix view
23156 Postings in 2179 Threads, 404 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum