Commit | Line | Data |
---|---|---|
e67d6049 MM |
1 | # |
2 | # Matt McCutchen's Big Integer Library | |
b1f5f69e | 3 | # http://hashproduct.metaesthetics.net/bigint/ |
e67d6049 | 4 | # |
e67d6049 | 5 | |
918d66f2 MM |
6 | # Mention default target. |
7 | all : | |
8 | ||
9 | # Implicit rule to compile C++ files. Modify to your taste. | |
05780f4b MM |
10 | %.o : %.cc |
11 | g++ -c -O -Wall -Wextra -pedantic $< | |
e67d6049 | 12 | |
918d66f2 MM |
13 | # Components of the library. |
14 | library-objects = BigUnsigned.o BigInteger.o BigUnsignedInABase.o BigIntegerUtils.o | |
15 | library-headers = NumberlikeArray.hh BigUnsigned.hh BigUnsignedInABase.hh BigInteger.hh BigIntegerLibrary.hh | |
16 | ||
17 | # To ``make the library'', make all its objects using the implicit rule. | |
18 | library : $(library-objects) | |
19 | ||
20 | # Extra dependencies from `#include'. | |
21 | BigUnsigned.o : NumberlikeArray.hh BigUnsigned.hh | |
22 | BigInteger.o : NumberlikeArray.hh BigUnsigned.hh BigInteger.hh | |
23 | BigUnsignedInABase.o : NumberlikeArray.hh BigUnsigned.hh BigUnsignedInABase.hh | |
24 | BigIntegerUtils.o : NumberlikeArray.hh BigUnsigned.hh BigUnsignedInABase.hh BigInteger.hh | |
e67d6049 | 25 | |
918d66f2 MM |
26 | # The rules below build a program that uses the library. They are preset to |
27 | # build ``sample'' from ``sample.cc''. You can change the name(s) of the | |
28 | # source file(s) and program file to build your own program, or you can write | |
29 | # your own Makefile. | |
a8b42b68 | 30 | |
918d66f2 MM |
31 | # Components of the program. |
32 | program = sample | |
33 | program-objects = sample.o | |
e67d6049 | 34 | |
918d66f2 MM |
35 | # Conservatively assume all the program source files depend on all the library |
36 | # headers. You can change this if it is not the case. | |
37 | $(program-objects) : $(library-headers) | |
e67d6049 | 38 | |
918d66f2 MM |
39 | # How to link the program. The implicit rule covers individual objects. |
40 | $(program) : $(program-objects) $(library-objects) | |
41 | g++ $(program-objects) $(library-objects) -o $(program) | |
42 | ||
43 | # Delete all generated files we know about. | |
05780f4b | 44 | clean : |
918d66f2 | 45 | rm -f $(library-objects) $(program-objects) $(program) |
e67d6049 | 46 | |
918d66f2 MM |
47 | # I removed the *.tag dependency tracking system because it had few advantages |
48 | # over manually entering all the dependencies. If there were a portable, | |
49 | # reliable dependency tracking system, I'd use it, but I know of no such; | |
50 | # cons and depcomp are almost good enough. | |
51 | ||
52 | # Come back and define default target. | |
53 | all : library $(program) |