Commit | Line | Data |
---|---|---|
e67d6049 MM |
1 | # |
2 | # Matt McCutchen's Big Integer Library | |
b3fe29df | 3 | # http://mysite.verizon.net/mccutchen/bigint/ |
e67d6049 | 4 | # |
e67d6049 | 5 | |
05780f4b MM |
6 | # The implicit rules we need |
7 | %.tag : % | |
8 | touch $@ | |
9 | %.o : %.cc | |
10 | g++ -c -O -Wall -Wextra -pedantic $< | |
e67d6049 | 11 | |
05780f4b MM |
12 | # Default target |
13 | library : NumberlikeArray.hh.tag BigUnsigned.o BigInteger.o BigUnsignedInABase.o BigIntegerUtils.o | |
e67d6049 | 14 | |
05780f4b MM |
15 | # Extra `include' dependencies |
16 | BigUnsigned.hh.tag : NumberlikeArray.hh.tag | |
17 | BigUnsigned.o : BigUnsigned.hh.tag | |
18 | BigInteger.hh.tag : BigUnsigned.hh.tag | |
19 | BigInteger.o : BigInteger.hh.tag | |
20 | BigUnsignedInABase.hh.tag : BigUnsigned.hh.tag | |
21 | BigUnsignedInABase.o : BigUnsignedInABase.hh.tag | |
22 | BigIntegerUtils.hh.tag : BigInteger.hh.tag | |
23 | BigIntegerUtils.o : BigIntegerUtils.hh.tag | |
e67d6049 | 24 | |
05780f4b MM |
25 | # sample program |
26 | sample : library sample.cc | |
27 | g++ -osample *.o sample.cc | |
e67d6049 | 28 | |
05780f4b MM |
29 | clean : |
30 | rm -f *.tag *.o sample | |
e67d6049 | 31 | |
05780f4b MM |
32 | # The ``.tag'' mechanism allows for proper recompilation when a header file |
33 | # changes, considering that some header files may include others. | |
34 | # | |
35 | # If a header file X includes other header | |
36 | # files Y and Z, we create a file X.tag that depends | |
37 | # on X, Y.tag, and Z.tag. Other headers that include X should | |
38 | # depend on X.tag. | |
39 | # | |
40 | # Suppose Y is subsequently changed. X doesn't get ``recompiled'', | |
41 | # but anything that includes X should be recompiled. Well, Y.tag becomes | |
42 | # out-of-date, so X.tag becomes out-of-date, so anything depending on X.tag | |
43 | # (that is, anything including X) becomes out-of-date. Magic! | |
44 | # | |
45 | # In this system, the tag files are empty files used only for their | |
46 | # timestamps. If one wished to use precompiled headers, one could use | |
47 | # ``.gch'' files exactly how ``.tag'' files are used now, except that | |
48 | # their contents would be meaningful. | |
49 | # | |
50 | # However, the same sort of ``deadly diamond'' problem that surfaces with | |
51 | # multiple inheritance also applies to precompiled headers. The ``#ifndef'' | |
52 | # mechanism that prevents multiple inclusion doesn't work when headers are | |
53 | # compiled independently in a hierarchical structure, since the second | |
54 | # inclusion of a file won't even know there was a first inclusion. For | |
55 | # this reason, I just use ``.tag''s. |