make (actually gmake) utility, and to
give you some more practice writing C++ programs.
We are providing the following auxiliary document which you should read before doing the corresponding part of the lab:
gmake.
mc38 directory, create a new subdirectory
called graphics-fun, and then copy the following file
into the graphics-fun directory:
cp ~mc38/labs/graphics-fun/triangle.cc graphics-fun
The program triangle.cc is the shell of the program you
are going to expand into a solution to exercise P3.2. We are providing
it since it includes the correct files and provides a starting point
for you to write the Makefile you need in order to use
gmake.
Now go to the graphics-fun directory and open up
triangle.cc in emacs.
triangle.cc from emacs
using the following command, which I will have explained in class:
g++ -I/usr/local/lib/cccfiles -L/usr/X11R6/lib -g -Wall -o triangle triangle.cc -lX11
Makefile that will
cause the exact same compilation to occur when you execute the
following command:
make -k
Note that this is the default command when you do M-x
compile in emacs. This implies that you will no longer have to
remember what compile/link command to issue from one emacs session to
the next; the Makefile remembers it for you.
In order to correctly write Makefile, you will need to
read the online notes on Using gmake, at least
through (and including) the section Basic Operation and Syntax.
triangle.cc so that
it solves programming exercise P3.2.
Makefile
and demonstrate that it causes the correct compilation to occur.
Makefile so that it will
simultaneously maintain both this program and the one you just wrote.
clock.cc in
the same directory as triangle.cc and
Makefile. Note that you will have to include
ccc_time.cpp in addition to ccc_win.cpp.
You also need to link in the math library by tacking -lm
onto the end of your compile/link command.
Makefile so that it simultaneously
maintains the two programs. You should refer again to Using gmake; the easiest way
you do this is to create a new dependency called, for example
all the that refers to the two executables you are
maintaining. Then make sure that you have separate dependencies for
each of them.
clock.cc so that
it solves programming exercise P3.16. Be sure that you don't use
magic numbers in your code; use constants instead.
Makefile
and demonstrate that it causes the correct compilations to occur.
Makefile so that it will
simultaneously maintain both this program and the one you just wrote.
better-clock.cc
the add twelve ``tick-marks'' around the clock you drew in the
previous part corresponding to the twelve hours. Be sure to update
Makefile so that it maintains all three programs.
Makefile.
Makefile
and demonstrate that it causes the correct compilations to occur.
Makefile (1 point) Makefile so that it defines and uses the following
variables. (These variables names, though seemingly obscure, are
standard.)
CXX
CXXLIBS
LDFLAGS
CXXFLAGS
Makefile and
demonstrate that it causes the correct compilations to occur.