forked from FreeFem/FreeFem-sources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
350 lines (293 loc) · 14 KB
/
Makefile.am
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# Makefile for FreeFem++, adapted to Automake
# -------------------------------------------
# Adaptation to Automake: Antoine Le Hyaric - LJLL Paris 6 -
# [email protected] - 13/5/04
SUBDIRS=download src examples++-load examples++-mpi \
examples++-tutorial examples++ \
examples++-eigen \
examples++-bug examples++-chapt3 examples++-other \
examples++-3d examples++-hpddm
EXTRA_DIST=test-driver-ff regtests.sh config-wrapper.h \
FreeFem++.mcp HISTORY HISTORY_BEFORE_2005 BUGS TODO regtests.m4 \
INSTALL INSTALL-MacOSX INNOVATION \
WindowsPackage.m4 README_COMPILATION.md README_ARPACK.md README_WINDOWS.md README_MAC.md \
logo.ico copysharedlibs.sh COPYRIGHT edp.nedit reconfigure \
mode-mi-edp.zip aclocal.m4 acmacros.m4 acoptim.m4 ax_lib_hdf5.m4 \
freefem++.spec \
Install-MacOS.command.in \
examples-bamg/NACA012/naca.awk examples-bamg/quadloop/dotest.pl \
examples-bamg/square/*_g.* examples-bamg/square/do* examples-bamg/NACA012/[adp]* \
examples-bamg/test/dotest*.pl 0ldUserReadMe.txt CheckAllEdp CheckAll \
WHERE_LIBRARY-mkl FreeFem++-CoCoa.in \
uninstall-ff++ \
./build/cleancrlf ./build/download ./build/links2files \
./build/orgindex ./build/ff-md5 script/PostInstall.m4 \
web/download.php web/index.php web/macosx.php web/menu.php web/phpfiles.php \
web/ffstyle.css web/linux.php web/main.php web/news.php web/windows.php \
FreeFem++.app.tgz
FF_MAC_PREFIX=FreeFem++v$(VERSION)$(ADD_PACKAGE_NAME)
FF_EXAMPLES_FILES = COPYRIGHT HISTORY HISTORY_BEFORE_2005 README_COMPILATION.md README_WINDOWS.md README_MAC.md BUGS TODO INSTALL INSTALL-MacOSX INNOVATION \
mode-mi-edp.zip \
examples++-tutorial/aile.msh examples++-tutorial/xyf \
examples++-3d/dodecaedre01.mesh \
examples++-3d/lac-leman-v4.msh \
examples++-load/load.link \
examples++-load/cube.msh \
examples++-load/fig.pgm examples++-load/lg.pgm \
./examples++-mpi/regtests.sh ./examples++-other/speedtest.sh \
./download/fftw/Makefile ./download/fftw/Makefile.am \
examples++*/*.[ie]dp CheckAllEdp \
examples++-load/ch.pts examples++-load/g.gmesh
# Creates a file named "ChangeLog" containing the chronology of all
# modifications to the source files. Needs "cvs2cl" to be installed.
changelog:
cvs2cl
# try and avoid running this under fakeroot (otherwise we may face
# problems trying to connect to CVS as pseudo-root). Debian packaging
# uses fakeroot.
history:
if test "$$FAKED_MODE" = ""; then\
hg log >HISTORY ;\
fi
documentation:
rm freefem++doc.pdf
$(WGET) https://github.com/FreeFem/FreeFem-doc-pdf/raw/master/freefem%2B%2Bdoc.pdf
# cd DOC && $(MAKE) $(AM_MAKEFLAGS) documentation
#DOC/freefem++doc.pdf:
# cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)
clean-local::
-find . \( -name '*~' -or -name ListOfUnAllocPtr.bin \) |xargs rm
-rm examples*/*.eps
# "dist" targets
clean-local::
-rm freefem++-*.tar.gz freefem++-*.zip
-rm Output/FreeFem++-*.exe
# Reduced compilation
# -------------------
quick:
cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS)
cd src/lglib && $(MAKE) $(AM_MAKEFLAGS)
cd src/fflib && $(MAKE) $(AM_MAKEFLAGS)
cd src/std && $(MAKE) $(AM_MAKEFLAGS)
nw:
cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS)
cd src/lglib && $(MAKE) $(AM_MAKEFLAGS)
cd src/fflib && $(MAKE) $(AM_MAKEFLAGS)
cd src/nw && $(MAKE) $(AM_MAKEFLAGS)
bamg:
cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS)
cd src/lglib && $(MAKE) $(AM_MAKEFLAGS)
cd src/fflib && $(MAKE) $(AM_MAKEFLAGS)
cd src/bamg && $(MAKE) $(AM_MAKEFLAGS)
ide:
cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS)
cd download && $(MAKE) $(AM_MAKEFLAGS)
cd src/lglib && $(MAKE) $(AM_MAKEFLAGS)
cd src/fflib && $(MAKE) $(AM_MAKEFLAGS)
cd src/ide && $(MAKE) $(AM_MAKEFLAGS) FreeFem++-cs$(EXEEXT)
# Cleaning generated files which are stored in the CVS repository, to
# avoid technical CVS conflicts.
clean-gen:
./cleanregen.sh
# Testing
# -------
# The standard automake goal "make check" is also valid. It just does
# not run any test that could prevent the user from working on its
# machine (because of unexpected windows opening right in the middle
# of the workspace).
visualcheck: all
$(MAKE) $(AM_MAKEFLAGS) check VISUALCHECK=yes
speedtest: all
cd examples++-other && $(MAKE) $(AM_MAKEFLAGS) check
# Windows package
# ---------------
# Windows package script (for Inno Setup). We extract version
# information from the Debian Changelog to get the package release
# number as well.
win32:WindowsPackage.iss
test ! -d examples++-load/include-tmp || rm -r examples++-load/include-tmp
cd examples++-load;tar zxvf include.tar.gz;mkdir include-tmp;cp -Lr *.h include/* include-tmp
/c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/ISCC.exe "`cygpath.exe WindowsPackage.iss`"
WindowsPackage.iss: WindowsPackage.m4 configure.ac Makefile.am
m4 -DVERSION='$(VERSION)$(ADD_PACKAGE_NAME)' \
-DMPIPROG='$(MPIPROG)' -DSIZEOFPTR='$(SIZEOF_PTRINBIT)' \
-DHOSTOS='$(host_os)' WindowsPackage.m4 > WindowsPackage.iss
echo loadpath += '"!\."' >freefem++.pref
echo includepath += '"!\idp"' >>freefem++.pref
# Debian package
# --------------
deb:
dpkg-buildpackage -rfakeroot
@echo Now run CopyToServer.sh in debian subdirectory
# Build all versions
# ------------------
nativeX: $(FF_MAC_PREFIX)_MacOsX.tgz
echo "done"
MacOsX: FreeFem++.app.tgz
-rm -rf OsXxx
mkdir -p OsXxx/Applications/
make install DESTDIR="`pwd`/OsXxx"
tar zxvf FreeFem++.app.tgz -C OsXxx/Applications/
cd OsXxx;tar cvfz ../$(FF_MAC_PREFIX)_MacOsX.tgz .
rm -rf OsXxx
clean-local::
-rm freefem++-$(VERSION).tar.gz
-rm -rf FreeFem++v*_MacOS
# Native MacOS packaging
# ----------------------
install-exec-local::
test `uname` != Darwin || $(MAKE) FreeFem++-CoCoa script/PostInstall.sh
$(mkinstalldirs) -m 755 $(DESTDIR)$(pkgdatadir)/$(VERSION)
test `uname` != Darwin || $(mkinstalldirs) -m 755 $(DESTDIR)/etc/paths.d/
test `uname` != Darwin || $(mkinstalldirs) -m 755 $(DESTDIR)/usr/local/bin
tar cvf - $(FF_EXAMPLES_FILES)| (cd $(DESTDIR)$(pkgdatadir)/$(VERSION); tar xvf -)
$(INSTALL_SCRIPT) CheckAll CheckAllEdp $(DESTDIR)$(pkgdatadir)/$(VERSION)
$(mkinstalldirs) -m 755 $(DESTDIR)${bindir}
test `uname` != Darwin || $(INSTALL_SCRIPT) FreeFem++-CoCoa $(DESTDIR)${bindir}
test `uname` != Darwin || echo $(bindir) >$(DESTDIR)/etc/paths.d/FreeFem++
test `uname` != Darwin || $(INSTALL_SCRIPT) FreeFem++-CoCoa $(DESTDIR)/usr/local/bin
test `uname` != Darwin || ( $(MAKE) FreeFem++.app.tgz ; test -d $(DESTDIR)/Applications || mkdir $(DESTDIR)/Applications ; tar zxf FreeFem++.app.tgz -C $(DESTDIR)/Applications )
script/PostInstall.sh:./Makefile script/PostInstall.m4
m4 script/PostInstall.m4 "-DFF__FVER=$(PACKAGE_VERSION)" "-DFF_BINDIR=$(bindir)" "-DFF__DATADIR=$(pkgdatadir)" >script/PostInstall.sh
chmod a+x script/PostInstall.sh
ListFiles-natives: .FORCE
test `uname` != Darwin || $(MAKE) FreeFem++-CoCoa
echo $(FF_EXAMPLES_FILES) >$@
echo ./download/fftw/Makefile ./download/fftw/Makefile.am >>$@
find . -name '*.[ei]dp' -o -name '*.h*' -o -name '*.cpp' -o -name '*.pgm' |egrep '[.]/examples++' >>$@
find . -name '*.h*' -o -name '*.cpp' |egrep '[.]/examples++' >>$@
List-agl-dylib: src/nw/FreeFem++
otool -L src/nw/FreeFem++|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {print $$1}' >$@
CheckMacLib.sh: src/nw/FreeFem++
echo "for i in `otool -L src/nw/FreeFem++|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {printf($$1.OFS) }'` ; do test ! -f $$i && exit 1; done; exit 0" >$@
chmod a+x $@
CheckMPIMacLib.sh: src/mpi/FreeFem++-mpi
echo "for i in `otool -L src/mpi/FreeFem++-mpi|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {printf($$1.OFS) }'` ; do test ! -f $$i && exit 1; done; exit 0" >$@
chmod a+x $@
.FORCE:
$(FF_MAC_PREFIX)_Macos:documentation ListFiles-natives
-mkdir $@
cat ListFiles-natives|xargs tar chf - | (cd $@ ; tar xf - )
/Developer/Tools/CpMac "FreeFem++(Carbon)" $@/FreeFem++
cp freefem++-doc.pdf $@
$(FF_MAC_PREFIX)_MacOsX: all documentation ListFiles-natives List-agl-dylib
-mkdir $@
cp freefem++doc.pdf $@
cat ListFiles-natives|xargs tar chf - | (cd $@ ; tar xf - )
cd $@ ; tar zxf ../src/agl/FreeFem++.app.tgz
sed <src/agl/Info-plist.am >$@/FreeFem++.app/Contents/Info.plist \
-e "s/@VVERSION@/$(VERSION)$(ADD_PACKAGE_NAME)/g" \
-e "s/@DATE@/`date`/g"
cp src/nw/FreeFem++ $@/FreeFem++.app/Contents/bin
cp src/nw/ffglut $@/FreeFem++.app/Contents/bin
cp src/medit/ffmedit $@/FreeFem++.app/Contents/bin
cp examples++-load/ff-get-dep $@/FreeFem++.app/Contents/bin
cp examples++-load/ff-pkg-download $@/FreeFem++.app/Contents/bin
sed <examples++-load/ff-c++ > $@/FreeFem++.app/Contents/bin/ff-c++ -e 's;FFAPPLI_INC;$@/FreeFem++.app/Contents/include;'
chmod a+x $@/FreeFem++.app/Contents/bin/ff-c++
-mkdir $@/FreeFem++.app/Contents/include
-mkdir $@/FreeFem++.app/Contents/idp
cp examples++-load/include/* $@/FreeFem++.app/Contents/include
cp examples++-load/*.dylib $@/FreeFem++.app/Contents/lib
cp examples++-*/*.idp $@/FreeFem++.app/Contents/idp
-if [ -s List-agl-dylib ]; then tar zchvf $@/OtherMacOsLib.tgz `cat List-agl-dylib`; fi;
./config.status --file=$@/Install-MacOS.command:Install-MacOS.command.in
chmod a+rx $@/Install-MacOS.command
-mkdir $@/FreeFem++.app/Contents/etc
echo loadpath += \"./\" >$@/FreeFem++.app/Contents/etc/freefem++.pref
echo loadpath += \"$(ff_prefix_dir)/lib\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref
echo includepath += \"$(ff_prefix_dir)/edp\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref
echo includepath += \"$(ff_prefix_dir)/idp\" >>$@/FreeFem++.app/Contents/etc/freefem++.pref
$(FF_MAC_PREFIX)_MacOsX.tgz: $(FF_MAC_PREFIX)_MacOsX
tar zcvf $(FF_MAC_PREFIX)_MacOsX.tgz $(FF_MAC_PREFIX)_MacOsX
# Linux binary-only package
# -------------------------
# Include kernel and libc version in static package name
PACKAGE_NAME=FreeFem++v$(VERSION)_linux-$(KERNEL_VERSION)_$(LIBC_VERSION)$(OPTIM_TYPE)
linux-package: $(PACKAGE_NAME).tgz
# No direct dependency to "all" to be able to debug the packaging
# procedure on its own.
$(PACKAGE_NAME): ListFiles-natives
cat ListFiles-natives|xargs tar cfh - | (cd $@ ; tar xf - )
-mkdir $@
cp src/std/FreeFem++ $@
./copysharedlibs.sh src/std/FreeFem++ $@
cp src/nw/FreeFem++-nw $@
./copysharedlibs.sh src/nw/FreeFem++-nw $@
cp src/ide/FreeFem++-cs $@
./copysharedlibs.sh src/ide/FreeFem++-cs $@
cp src/ide/FreeFem++-server $@
./copysharedlibs.sh src/ide/FreeFem++-server $@
cp src/ide/FreeFem++-client $@
./copysharedlibs.sh src/ide/FreeFem++-client $@
-cp src/glx/FreeFem++-glx $@
-./copysharedlibs.sh src/glx/FreeFem++-glx $@
-cp src/mpi/FreeFem++-mpi $@
-./copysharedlibs.sh src/mpi/FreeFem++-mpi $@
$(PACKAGE_NAME).tgz: $(PACKAGE_NAME)
tar cvzf $@ $<
clean-local::
-rm -r $(PACKAGE_NAME) $(PACKAGE_NAME).tgz
autofiles:AutoGeneratedFile.tar.gz
LIST_GENERATE_FILE= \
download/umfpack/Makefile.in examples++-tutorial/Makefile.in src/femlib/Makefile.in \
Makefile.in examples++-3d/Makefile.in examples++/Makefile.in src/fflib/Makefile.in \
config.h.in examples++-bug/Makefile.in src/Algo/Makefile.in src/lglib/Makefile.in \
configure examples++-chapt3/Makefile.in src/Graphics/Makefile.in src/libMesh/Makefile.in \
download/Makefile.in examples++-eigen/Makefile.in src/Makefile.in src/medit/Makefile.in \
download/arpack/Makefile.in examples++-load/Makefile.in src/bamg/Makefile.in src/mpi/Makefile.in \
download/blas/Makefile.in examples++-mpi/Makefile.in src/bamglib/Makefile.in src/nw/Makefile.in \
download/fftw/Makefile.in examples++-other/Makefile.in src/bin-win32/Makefile.in examples++-hpddm/Makefile.in
LIST_GENERATE_FILE_AM= \
download/umfpack/Makefile.am examples++-tutorial/Makefile.am src/femlib/Makefile.am \
Makefile.am examples++-3d/Makefile.am examples++/Makefile.am src/fflib/Makefile.am \
examples++-bug/Makefile.am src/Algo/Makefile.am src/lglib/Makefile.am \
configure.ac examples++-chapt3/Makefile.am src/Graphics/Makefile.am src/libMesh/Makefile.am \
download/Makefile.am examples++-eigen/Makefile.am src/Makefile.am src/medit/Makefile.am \
download/arpack/Makefile.am examples++-load/Makefile.am src/bamg/Makefile.am src/mpi/Makefile.am \
download/blas/Makefile.am examples++-mpi/Makefile.am src/bamglib/Makefile.am src/nw/Makefile.am \
download/fftw/Makefile.am examples++-other/Makefile.am src/bin-win32/Makefile.am examples++-hpddm/Makefile.am
#$(LIST_GENERATE_FILE):$(LIST_GENERATE_FILE_AM)
# @echo "WARNING the configure file is older than configure build flies"
# @echo "Rebuild configure: do one the three case"
# @echo " if you have autoconf # make conf"
# @echo " or without # make conf-without-autoconf"
# @echo " or by pass this problem # make conf-touch"
conf:
autoreconf
./config.status --recheck
conf-without-autoconf:
tar zxvf AutoGeneratedFile.tar.gz
./config.status --recheck
conf-touch:
touch $(LIST_GENERATE_FILE)
AutoGeneratedFile.tar.gz:$(LIST_GENERATE_FILE) configure.ac
tar cvfz $@ $(LIST_GENERATE_FILE)
FreeFem++-CoCoa:FreeFem++-CoCoa.in ./config.status
./config.status --file="FreeFem++-CoCoa:FreeFem++-CoCoa.in"
FreeFem++.app.tgz:./config.status
tar zxf FreeFem++.app.tgz
./config.status --file=FreeFem++.scrpt-txt:FreeFem++.scrpt-txt.in
-rm FreeFem++.app/Contents/Resources/Scripts/main.scpt
osacompile <FreeFem++.scrpt-txt -o FreeFem++.app/Contents/Resources/Scripts/main.scpt
tar zcf FreeFem++.app.tgz FreeFem++.app
# ALH - build a robust TAGS file for a whole directory tree (more robust than the automake TAGS directive because of the
# multiple source trees downloaded within FF)
findtags:
find . -type f -name '*.?pp'|grep -v lg.tab|xargs etags
clean-local::
-rm TAGS
## trick to check if the configure configure.ac Makefile.in .. are correct in time
Makefile: @MAINTAINER_MODE_FALSE@ configure $(LIST_GENERATE_FILE_AM)
echo "configure Makefile:$(LIST_GENERATE_FILE_AM)" >Makefile-for-Checkam
echo '@false'| tr '@' '\t' >> Makefile-for-Checkam
if $(MAKE) -f Makefile-for-Checkam 2>&1 >/dev/null ; \
then ok=1 ; \
else \
$(MAKE) -f Makefile-for-Checkam ; \
echo "Need to rebuid configure and Makefile files " ;\
echo "Do autoreconf -i or tar zxvf tar zxvf AutoGeneratedFile.tar.gz" ;\
echo " and ./reconfigure" ;\
ok=0; \
fi ; \
test $$ok -eq 1