- Add Makefile.in for building rsync with mgear. Yay!
[mgear/mgear.git] / experiments / bigint-mage-Makefile
CommitLineData
b811570b
MM
1# This is out of date.
2
00804b7c
MM
3#
4# Matt McCutchen's Big Integer Library
5#
6
099638eb 7include mgear.mk
00804b7c
MM
8
9# Mention default target.
10all :
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.
16library-objects = BigUnsigned.o BigInteger.o BigUnsignedInABase.o BigIntegerUtils.o
17library-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.
20library : $(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.
34program = sample
35program-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.
45clean :
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.
54all : library $(program)