Mail Archives: djgpp/1997/06/05/16:29:13
On Wed, 4 Jun 1997, SteelGolem wrote:
> I can't understand how to make one (1) exe file out of many (multiple) c
> or cc files.. why does it have to be so complicated?? if ya can't show
> me that, at least show me how to make a library file (___.a),
> PLEASE!!?!?! (although both would be nice.. =P)
> thanks for ANY help!!! --email please!
>
I assume from your Subject that you need a makefile for an app and a lib.
Here is a simple one:
Myapp.exe: mymodule1.o mymodule2.o mymodule3.o libmylib.a
gcc -o Myapp.exe mymodule1.o mymodule2.o mymodule3.o -lmylib
libmylib.a: myutil1.o myutil2.o myutil3.o
ar -rs libmylib.a $*
^^^^^^^^Make sure that each target command begins with a tab not spaces!
Art S. Kagel, kagel AT bloomberg DOT com
- Raw text -