AMD_Demo_Makefile
2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#-----------------------------------------------------------------------------
# compile the AMD demo (for both GNU make or original make)
#-----------------------------------------------------------------------------
default: amd_simple amd_demo amd_demo2 amd_l_demo
include ../../UFconfig/UFconfig.mk
C = $(CC) $(CFLAGS) -I../Include -I../../UFconfig
INC = ../Include/amd.h ../../UFconfig/UFconfig.h
library:
( cd ../Source ; $(MAKE) )
f77lib:
( cd ../Lib ; $(MAKE) fortran )
#------------------------------------------------------------------------------
# Create the demo program, run it, and compare the output
#------------------------------------------------------------------------------
dist:
amd_demo: amd_demo.c library $(INC)
$(C) -o amd_demo amd_demo.c ../Lib/libamd.a $(LIB)
./amd_demo > my_amd_demo.out
- diff amd_demo.out my_amd_demo.out
amd_l_demo: amd_l_demo.c library $(INC)
$(C) -o amd_l_demo amd_l_demo.c ../Lib/libamd.a $(LIB)
./amd_l_demo > my_amd_l_demo.out
- diff amd_l_demo.out my_amd_l_demo.out
amd_demo2: amd_demo2.c library $(INC)
$(C) -o amd_demo2 amd_demo2.c ../Lib/libamd.a $(LIB)
./amd_demo2 > my_amd_demo2.out
- diff amd_demo2.out my_amd_demo2.out
amd_simple: amd_simple.c library $(INC)
$(C) -o amd_simple amd_simple.c ../Lib/libamd.a $(LIB)
./amd_simple > my_amd_simple.out
- diff amd_simple.out my_amd_simple.out
#------------------------------------------------------------------------------
# compile the Fortran demo
#------------------------------------------------------------------------------
fortran: amd_f77demo amd_f77simple
cross: amd_f77cross
amd_f77demo: amd_f77demo.f f77lib
$(F77) $(F77FLAGS) -o amd_f77demo amd_f77demo.f ../Lib/libamdf77.a \
$(F77LIB)
./amd_f77demo > my_amd_f77demo.out
- diff amd_f77demo.out my_amd_f77demo.out
amd_f77simple: amd_f77simple.f f77lib
$(F77) $(F77FLAGS) -o amd_f77simple amd_f77simple.f \
../Lib/libamdf77.a $(F77LIB)
./amd_f77simple > my_amd_f77simple.out
- diff amd_f77simple.out my_amd_f77simple.out
amd_f77wrapper.o: amd_f77wrapper.c
$(C) -DDINT -c amd_f77wrapper.c
amd_f77cross: amd_f77cross.f amd_f77wrapper.o ../Lib/libamd.a
$(F77) $(F77FLAGS) -o amd_f77cross amd_f77cross.f amd_f77wrapper.o \
../Lib/libamd.a $(F77LIB)
./amd_f77cross > my_amd_f77cross.out
- diff amd_f77cross.out my_amd_f77cross.out
#------------------------------------------------------------------------------
# Remove all but the files in the original distribution
#------------------------------------------------------------------------------
clean:
- $(RM) $(CLEAN)
purge: distclean
distclean: clean
- $(RM) amd_demo my_amd_demo.out
- $(RM) amd_l_demo my_amd_l_demo.out
- $(RM) amd_demo2 my_amd_demo2.out
- $(RM) amd_simple my_amd_simple.out
- $(RM) amd_f77demo my_amd_f77demo.out
- $(RM) amd_f77simple my_amd_f77simple.out
- $(RM) amd_f77cross my_amd_f77cross.out