Mail Archives: djgpp/2003/05/11/13:39:37
> From: Bill Hart <willymo AT hotmail DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Sun, 11 May 2003 15:27:55 GMT
>
> Original Mix Turbo C makefile
>
> OBJ= isaminit.obj isamexit.obj copydb.obj newindex.obj destrydb.obj \
> renamedb.obj dbhandle.obj findrec.obj findtail.obj getfldct.obj \
> getidxnm.obj isammsg.obj prterr.obj matchkey.obj modrec.obj \
> rmindex.obj delrec.obj holes.obj showkey.obj addrec.obj \
> createdb.obj findkey.obj findprev.obj mkindex.obj namelist.obj \
> progress.obj ihandle.obj showdb.obj findmark.obj findnext.obj \
> findhead.obj getrec.obj getrlen.obj markrec.obj matpre.obj \
> showdesc.obj getdesc.obj showfld.obj getfldnm.obj showidx.obj \
> showrec.obj upindex.obj mkkey.obj opendb.obj closedb.obj path.obj \
> filename.obj chgextnt.obj flushdb.obj
Change every .obj to .o in this list.
> HEADER= isam.i ..\cbtree.h isamerr.h isam.h ..\cbt\member.h isam.cfg (1)
>
> CFLAGS= -mm -c -I.. -I..\cbt (2)
Change all backslashes to forward slashes: GNU Make doesn't cope well
with backslashes, since they serve for quoting special characters
such as $ and *.
> isam.lib: $(OBJ) (3)
> del isam.lib
> tlib isam.lib @isam.rsp
>
> $(OBJ): $(HEADER)
> tcc $(CFLAGS) $*.c (4)
>
> (1) I can move the .h files around so the compiler can find them.
> (2) I remove the memory model switch & fix the include dir
> (3) Don't have a clue what to use for "tlib"
`tlib' is an object library manager; the DJGPP equivalent is `ar'.
See section 8.22 of the DJGPP FAQ list for more about this.
> (4) Change to gcc, and "$*.c" doesn't work.
You don't need the "tcc $(CFLAGS) $*.c" rule at all, with GNU Make:
it already knows how to produce an object file from a .c file. Just
leave the dependency:
$(OBJ): $(HEADER)
and remove the rule that it runs, and things should work.
> I change the $*.c to *.c and all my source files compile without error
> over and over.
That's what you ask for when you say *.c.
- Raw text -