Make file help needed
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Make file help needed




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Make file help needed  
Chandramouli Ramakrishnan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

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.

Thanks in advance
chan





[ Post a follow-up to this message ]



    Re: Make file help needed  
Mark A. Odell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:22 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register