home *** CD-ROM | disk | FTP | other *** search
- Path: hades.dcs.napier.ac.uk!styx!oose5009
- From: Alexander Higginson <oose5009@styx>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Help on Constructing Makefile in GNU/C++
- Date: Mon, 4 Mar 1996 12:47:24 +0000
- Organization: Computer Studies, Napier University, Edinburgh
- Message-ID: <Pine.SOL.3.91.960304123307.1931A-100000@styx>
- NNTP-Posting-Host: styx.dcs.napier.ac.uk
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
-
- Hi,
- I am unclear on how to contruct a makefile within the GNU C++ compiler,
- which has more than one source file communicating with each other via a
- header file. For example, I have written a header file called PERSON.H
- which contains a class Person and various operations and properties within
- it. I have also two .cc files called PERSON.CC and PERSON-IO.CC. The
- PERSON.CC contains the main() function which accesses the data members of
- the class Person, which are in PERSON-IO.CC. The PERSON-IO.CC contains the
- details of adding a person's name, age, display, etc.
-
- I can compile the files by typing: g++ person.cc person-io.cc -o person.
- This will compile and link the files together and produce an executable
- called person.
-
- However, it is not practicle to do this if you have over a dozen source
- files to compile and link. So it makes sense to construct a Makefile.
-
- So how could this be done using a makefile? I am unclear about the
- various functions used within the Makefile and I would be grateful of a
- sample Makefile that would cover the about problem.
-
- Thanks,
-
- Alexander Higginson.
- a.higginson@dcs.napier.ac.uk or oose5009@dcs.napier.ac.uk
-