File: GNUmakefile

package info (click to toggle)
suitesparse 1%3A4.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 54,408 kB
  • ctags: 8,790
  • sloc: ansic: 115,048; cpp: 13,222; makefile: 5,720; fortran: 1,927; java: 1,846; csh: 742; ruby: 725; asm: 512; perl: 243; sed: 164; awk: 27; sh: 8
file content (96 lines) | stat: -rw-r--r-- 3,217 bytes parent folder | download
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
91
92
93
94
95
96
#-------------------------------------------------------------------------------
# AMD Makefile for compiling on Unix systems (for GNU make only)
#-------------------------------------------------------------------------------

SOVERSION = $(shell perl ../../debian/library-soname.pl AMD | sed 's/libamd//')

default: libamd.a libamd.so.$(SOVERSION)

include ../../SuiteSparse_config/SuiteSparse_config.mk

C = $(CC) $(CF) -I../Include -I../../SuiteSparse_config

#-------------------------------------------------------------------------------
# source files
#-------------------------------------------------------------------------------

AMD = amd_aat amd_1 amd_2 amd_dump amd_postorder amd_post_tree amd_defaults \
	amd_order amd_control amd_info amd_valid amd_preprocess

CONFIG = ../../SuiteSparse_config/SuiteSparse_config.h

INC = ../Include/amd.h ../Include/amd_internal.h $(CONFIG)

#-------------------------------------------------------------------------------
# object files for each version
#-------------------------------------------------------------------------------

AMDI = $(addsuffix .o, $(subst amd_,amd_i_,$(AMD)))
AMDL = $(addsuffix .o, $(subst amd_,amd_l_,$(AMD)))

AMDI_SL = $(addsuffix .oo, $(subst amd_,amd_i_,$(AMD)))
AMDL_SL = $(addsuffix .oo, $(subst amd_,amd_l_,$(AMD)))

#-------------------------------------------------------------------------------
# compile each int and long routine (with no real/complex version)
#-------------------------------------------------------------------------------

amd_global.o: ../Source/amd_global.c $(INC)
	$(C) -c $< -o $@
amd_global.oo: ../Source/amd_global.c $(INC)
	$(C) -fPIC -c $< -o $@

amd_i_%.o: ../Source/amd_%.c $(INC)
	$(C) -DDINT -c $< -o $@
amd_i_%.oo: ../Source/amd_%.c $(INC)
	$(C) -fPIC -DDINT -c $< -o $@

amd_l_%.o: ../Source/amd_%.c $(INC)
	$(C) -DDLONG -c $< -o $@
amd_l_%.oo: ../Source/amd_%.c $(INC)
	$(C) -fPIC -DDLONG -c $< -o $@

#-------------------------------------------------------------------------------
# Create the libamd.a library (C versions only)
#-------------------------------------------------------------------------------

libamd.a: amd_global.o $(AMDI) $(AMDL)
	$(ARCHIVE) libamd.a $^
	- $(RANLIB) libamd.a

libamd.so.$(SOVERSION): amd_global.oo $(AMDI_SL) $(AMDL_SL)
	$(CC) $(LDFLAGS) -shared $^ -lm -Wl,-soname -Wl,$@ -o $@
	ln -s $@ libamd.so

#-------------------------------------------------------------------------------
# compile the Fortran versions and the libamdf77.a library
#-------------------------------------------------------------------------------

fortran: libamdf77.a

AMDF77 = amd.o amdbar.o

amd.o: ../Source/amd.f
	$(F77) $(F77FLAGS) -c ../Source/amd.f -o amd.o

amdbar.o: ../Source/amdbar.f
	$(F77) $(F77FLAGS) -c ../Source/amdbar.f -o amdbar.o

libamdf77.a: $(AMDF77)
	$(ARCHIVE) libamdf77.a $^
	- $(RANLIB) libamdf77.a

#-------------------------------------------------------------------------------
# Remove all but the files in the original distribution
#-------------------------------------------------------------------------------

clean:
	- $(RM) $(CLEAN)
	-$(RM) *.oo
	-$(RM) *.a
	-$(RM) *.so*

purge: distclean

distclean: clean
	- $(RM) libamd.a libamdf77.a