View Full Version: really basic questions

C++ Learning Community > C++ Help > really basic questions


Title: really basic questions


wanderinglazyeye - January 23, 2007 04:11 PM (GMT)
Hi folks, my question is so basic that there is no accompanying code, yet. I want to know what is the functional relationship of a makefile to a minimal file. Also is there a reason why its called a "minimal" file? I am learning C++ and am overwhelmed not with the code so much so far but with the structural relationships between these multiplicities of file types and how they relate to one another.

Thanks for anyones patience in this question.

C-Man - January 23, 2007 05:33 PM (GMT)
well a C/C++ program goes throo 4 basic stages
which are
Preprocessor->Compiler->Assembler->Linker

Preprocessor processes all macros by text manipulation (sutch as replacing #include directives with contents of the header files for example .h)
Then the compiler processes the intermediate C/C++ code and comes out with assembly code (for example .s)
The Assembly code is assembled into object files (for example .o)
Then the linker finishes up by linking all the object files and libraries (for example .a)
and we get the finished executable (for example .exe


so it goes like this
CODE

   .h/.hpp
|
.c/.cpp -> intermediate -> .s -> .o -> +
|                                      |
.c/.cpp -> intermediate -> .s -> .o -> +-> .exe
|                                      |
.c/.cpp -> intermediate -> .s -> .o -> +


A makefile defines a set of rules how each file or file set is transformed into another
file like .c .h to .o and .o to .exe

it's mostly useful when you work with large project and can't afford to rebuild the entire project and only some of the files need to be rebuilt (and relinked) since it knows which files depend on which it know exactlky what files to rebuild



wanderinglazyeye - January 23, 2007 06:03 PM (GMT)
Thanks very much. Now for a more specific question. I am trying to "install" a downloaded library named Mimas. The install instructions give the appearance of a command line compiler. So far I have been using an IDE. What tools can I use to install this library? DevC++ and other IGEs don't seem to have a command line option. Is there a way around this?

Here is the install text:

BUILD USING AUTOCONF
====================
The automake/autoconf-build will only build the library, the documen-
tation and the examples.

To compile mimas do the following steps:

1. If you have the `configure'-script, `cd' to the mimas-directory and
type `./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
If you don't have a `configure'-script, execute first
`make -f Makefile.dist'. If you have got a CVS distribution, you'll
need to do this, because it doesn't come with a configure-script.

2. Type `make' to compile the package.

3. Type `make install' to install the programs and any data files and
documentation.

4. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.




Hosted for free by InvisionFree