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