forked from velexi-research/LSMLIB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
145 lines (120 loc) · 5.34 KB
/
Makefile.in
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
##
## File: Makefile.in
## Copyrights: (c) 2005 The Trustees of Princeton University and Board of
## Regents of the University of Texas. All rights reserved.
## (c) 2009 Kevin T. Chu. All rights reserved.
## Revision: $Revision$
## Modified: $Date$
## Description: top-level makefile for level set method library
## (builds archive files)
##
SRC_DIR = @top_srcdir@
VPATH = @top_srcdir@
BUILD_DIR = @builddir@
include $(BUILD_DIR)/config/Makefile.config
# Set MAKE
@SET_MAKE@
all: library
directories:
if [ ! -d "include" ]; then @MKDIR@ include; fi
if [ ! -d "lib" ]; then @MKDIR@ lib; fi
includes: directories
@CP@ config/LSMLIB_config.h include
cd src; @MAKE@ $@ || exit 1
library: directories includes
cd src; @MAKE@ $@ || exit 1
@MAKE@ lsm_toolbox || exit 1
@MAKE@ lsm_serial || exit 1
if [ ! -z "@LSMLIB_PARALLEL@" ]; then \
@MAKE@ lsm_parallel || exit 1; \
fi
if [ ! -z "@matlab_dir@" ]; then \
@MAKE@ matlab || exit 1; \
fi
lsm_toolbox:
@FIND@ src/toolbox -name "*.o" > objs_file.tmp
# remove test code
@SED@ -e '/test/d' objs_file.tmp > objs_file_no_test.tmp
@MV@ -f objs_file_no_test.tmp objs_file.tmp
cat objs_file.tmp | @XARGS@ @AR@ -ru $(BUILD_DIR)/lib/liblsm_toolbox.a
@RANLIB@ lib/liblsm_toolbox.a
@RM@ objs_file.tmp
lsm_serial:
@FIND@ src/serial -name "*.o" > objs_file.tmp
# remove test code
@SED@ -e '/test/d' objs_file.tmp > objs_file_no_test.tmp
@MV@ -f objs_file_no_test.tmp objs_file.tmp
cat objs_file.tmp | @XARGS@ @AR@ -ru $(BUILD_DIR)/lib/liblsm_serial.a
@RANLIB@ lib/liblsm_serial.a
@RM@ objs_file.tmp
lsm_parallel:
@FIND@ src/parallel -name "*.o" > objs_file.tmp
# remove test code
@SED@ -e '/test/d' objs_file.tmp > objs_file_no_test.tmp
@MV@ -f objs_file_no_test.tmp objs_file.tmp
cat objs_file.tmp | @XARGS@ @AR@ -ru $(BUILD_DIR)/lib/liblsm_parallel.a
@RANLIB@ lib/liblsm_parallel.a
@RM@ objs_file.tmp
INSTALL_DIR = @prefix@
install:
@INSTALL@ -d -m 755 $(INSTALL_DIR)/lib
@INSTALL@ -d -m 755 $(INSTALL_DIR)/include
@INSTALL@ -d -m 755 $(INSTALL_DIR)/share/LSMLIB
@INSTALL@ -c -m 644 $(SRC_DIR)/LICENSE $(INSTALL_DIR)/share/LSMLIB
@INSTALL@ -d -m 755 $(INSTALL_DIR)/share/LSMLIB/config
@INSTALL@ -c -m 644 config.status $(INSTALL_DIR)/share/LSMLIB/config
@INSTALL@ -c -m 644 config/Makefile.config $(INSTALL_DIR)/share/LSMLIB/config
@SED@ 's/BUILD_DIR/LSMLIB_DIR/' $(INSTALL_DIR)/share/LSMLIB/config/Makefile.config > Makefile.config.install; \
@MV@ Makefile.config.install $(INSTALL_DIR)/share/LSMLIB/config/Makefile.config; \
for i in include/*; do \
@INSTALL@ -c -m 644 $$i $(INSTALL_DIR)/include; \
done
if test -f lib/liblsm_toolbox.a; then \
for i in lib/*.a; do \
@INSTALL@ -c -m 644 $$i $(INSTALL_DIR)/lib; \
@RANLIB@ $(INSTALL_DIR)/$$i; \
done \
fi
if test -f lib/liblsm_toolbox.so; then \
for i in lib/*.so; do \
@INSTALL@ -c -m 644 $$i $(INSTALL_DIR)/lib; \
@RANLIB@ $(INSTALL_DIR)/$$i; \
done \
fi
if test -d $(SRC_DIR)/doc/lsmlib-dox; then \
@CP@ -r $(SRC_DIR)/doc/lsmlib-dox $(INSTALL_DIR)/share/LSMLIB/doc; \
fi
@CP@ -r $(BUILD_DIR)/examples $(INSTALL_DIR)/share/LSMLIB/
@FIND@ $(INSTALL_DIR) -name Makefile > examples_makefiles.tmp
for i in `cat examples_makefiles.tmp`; do \
@AWK@ '$$1=="BUILD_DIR" && $$2=="=" {$$3 = "$(INSTALL_DIR)"} {print}' $$i > $$i.install; \
@MV@ $$i.install $$i; \
@AWK@ '$$1=="include" && $$2=="$$(BUILD_DIR)/config/Makefile.config" {$$2 = "$(INSTALL_DIR)/share/LSMLIB/config/Makefile.config"} {print}' $$i > $$i.install; \
@MV@ $$i.install $$i; \
@SED@ 's/BUILD_DIR/LSMLIB_DIR/' $$i > $$i.install; \
@MV@ $$i.install $$i; \
done
@RM@ examples_makefiles.tmp
dox:
cd $(SRC_DIR)/doc/doxygen; doxygen Doxyfile
cleandox:
if [ -d "doc/lsmlib-dox" ]; then @RM@ -r doc/lsmlib-dox; fi
mex: matlab
matlab:
if [ ! -z "@matlab_dir@" ]; then \
cd src/matlab; @MAKE@ library || exit 1; \
else \
echo ""; \
echo "LSMLIB configured without MATLAB...unable to generate"; \
echo "MEX files"; \
echo ""; \
fi
clean:
cd src; @MAKE@ $@ || exit 1
@RM@ *.o
@RM@ *.tmp
spotless: clean cleandox
cd src; @MAKE@ $@ || exit 1
cd examples; @MAKE@ $@ || exit 1
if [ -d "include" ]; then @RM@ -rf include/*; rmdir include; fi
if [ -d "lib" ]; then @RM@ -rf lib/*; rmdir lib; fi