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