01-23-04 10:21 PM
channumouli@yahoo.com (Chandramouli Ramakrishnan) wrote in
news:662f18aa.0401012218.177d7c12@posting.google.com:
quote:
> Hai,
>
> I would like to create a make file.
> the .cpp reside at ~/bank/cpp/
> and .h reside at ~/bank/h/
>
> Make file "mymakefile" looks like this
> ****************************************
*******
> objects = start.o access.o business.o database.o
> myheadpath = ~/bank/h/
>
> bank : $(objects)
> --------g++ -o bank $(objects)
>
> start.o : $(myheadpath)business.h
>
> access.o : $(myheadpath)access.h $(myheadpath)data.h
>
> business.o : $(myheadpath)business.h $(myheadpath)exception.h /
> $(myheadpath)access.h $(myheadpath)database.h
>
> database.o : $(myheadpath)database.h $(myheadpath)exception.h /
> $(myheadpath)access.h
>
> clean :
> --------rm $(objects) bank
> ****************************************
************
> Can any one of try to remove the $(myheadpath) in all of my
> prerequistes by giving me a short cut method.
Read up on VPATH and vpath in the Gnu docs for make. It should help. Also,
remember to tell gcc where your include files live with -I flags when
compiling each file.
--
- Mark ->
--
[ Post a follow-up to this message ]
|