File: Makefile

package info (click to toggle)
ufsparse 1.2-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,536 kB
  • ctags: 5,848
  • sloc: ansic: 89,328; makefile: 4,721; fortran: 1,991; csh: 207; sed: 162; awk: 33; java: 30; sh: 8
file content (91 lines) | stat: -rw-r--r-- 2,990 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
#-------------------------------------------------------------------------------
# Makefile for the LDL mexFunction
#-------------------------------------------------------------------------------

default: all

include ../UFconfig/UFconfig.mk

C = $(CC) $(CFLAGS)

all: intro libldl.a ldlsimple ldlmain ldlamd

intro:
	@echo " "
	@echo "    Now compiling the LDL library (libldl.a), and three stand-"
	@echo "    alone C programs (ldlmain, ldlsimple, and ldlamd).  ldlamd"
	@echo "    is ldlmain compiled to use with AMD, which will be skipped"
	@echo "    if you do not have AMD installed in the ../AMD directory."
	@echo "    Will also compile the LDL mexFunction for use in MATLAB,"
	@echo "    and two MATLAB test programs, which will be skipped if you"
	@echo "    do not have MATLAB."
	@echo " "

#-------------------------------------------------------------------------------
# the ldl library:
#-------------------------------------------------------------------------------

libldl.a: ldl.c ldl.h
	$(C) -c -O ldl.c -o ldl.o
	$(AR) libldl.a ldl.o
	- $(RANLIB) libldl.a

#-------------------------------------------------------------------------------
# stand-alone C programs:
#-------------------------------------------------------------------------------

ldlmain:  ldlmain.c libldl.a
	$(C) -O ldlmain.c libldl.a -o ldlmain -lm
	- ./ldlmain > my_ldlmain.out
	- diff ldlmain.out my_ldlmain.out

ldlsimple:  ldlsimple.c libldl.a
	$(C) -O ldlsimple.c libldl.a -o ldlsimple -lm
	- ./ldlsimple > my_ldlsimple.out
	- diff ldlsimple.out my_ldlsimple.out

ldlamd:  ldlmain.c libldl.a
	- (cd ../AMD ; $(MAKE))
	- $(C) -O -I../AMD/Include -L../AMD/Lib -DUSE_AMD ldlmain.c -lamd libldl.a -o ldlamd -lm
	- ./ldlamd > my_ldlamd.out
	- diff ldlamd.out my_ldlamd.out

#-------------------------------------------------------------------------------
# LDL mexFunctions for use in MATLAB:
#-------------------------------------------------------------------------------

mex: ldl_mexfunction

ldl_mexfunction: ldlmex.c ldl.c ldl.h ldlsymbolmex.c
	- $(MEX) ldl.c ldlmex.c
	- $(MEX) -output ldlsymbol ldlsymbolmex.c ldl.c

#-------------------------------------------------------------------------------
# clean-up:
#-------------------------------------------------------------------------------

distclean: purge

purge: clean
	- $(RM) ldl.mex* ldl.dll libldl.a ldlmain ldlamd ldlsimple
	- $(RM) my_ldlmain.out my_ldlamd.out my_ldlsimple.out
	- $(RM) ldlmain.mex* ldlamd.mex* ldlmain.dll ldlamd.dll
	- $(RM) ldlsymbol.mex* ldlsymbol.dll
	- $(RM) *.dvi *.aux *.log *.bak *.bbl *.blg

clean:
	- $(RM) $(CLEAN)

#-------------------------------------------------------------------------------
# user guide:
#-------------------------------------------------------------------------------

doc: ldl_userguide.tex ldl.bib
	latex ldl_userguide
	- bibtex ldl_userguide
	latex ldl_userguide
	latex ldl_userguide
	dvips ldl_userguide -o ldl_userguide.ps
	pdflatex ldl_userguide
	pdflatex ldl_userguide