1############################################################################
2# This file is part of FreeFEM.                                            #
3#                                                                          #
4# FreeFEM is free software: you can redistribute it and/or modify          #
5# it under the terms of the GNU Lesser General Public License as           #
6# published by the Free Software Foundation, either version 3 of           #
7# the License, or (at your option) any later version.                      #
8#                                                                          #
9# FreeFEM is distributed in the hope that it will be useful,               #
10# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
12# GNU Lesser General Public License for more details.                      #
13#                                                                          #
14# You should have received a copy of the GNU Lesser General Public License #
15# along with FreeFEM. If not, see <http://www.gnu.org/licenses/>.          #
16############################################################################
17# SUMMARY : Makefile for FreeFem++, adapted to Automake
18# LICENSE : LGPLv3
19# ORG     : LJLL Universite Pierre et Marie Curie, Paris, FRANCE
20# AUTHORS : Antoine Le Hyaric, Simon Garnotel
21# E-MAIL  :
22
23SUBDIRS=3rdparty src \
24	plugin  \
25	examples
26
27EXTRA_DIST=README.md CHANGELOG.md AUTHORS\
28bin/keys.awk \
29bin/mpic++.in \
30bin/Install-MacOS.command \
31bin/FreeFem++-CoCoa.in \
32bin/save-in-files \
33bin/cleanregen.sh \
34bin/copysharedlibs.sh \
35bin/script/clean_all_installed_ffpp.sh \
36bin/script/PostInstall.m4 \
37bin/regtests.sh \
38bin/uninstall-ff++ \
39bin/build/cleancrlf \
40bin/build/orgindex \
41bin/build/download \
42bin/build/ff-md5 \
43bin/build/links2files \
44bin/modpath.iss \
45bin/Install-MacOS.command.in \
46bin/Searchdylib \
47bin/test-driver-ff \
48etc/tools/srcHeader.txt \
49etc/tools/.uncrustify \
50etc/debian/freefem++-doc.doc-base \
51etc/debian/freefem++.manpages \
52etc/debian/apt-ftparchive.conf \
53etc/debian/freefem++.docs \
54etc/debian/compat \
55etc/debian/freefem++.examples \
56etc/debian/changelog \
57etc/debian/freefem++-nw.install \
58etc/debian/freefem++-nw.prerm \
59etc/debian/freefem++-mpich.links \
60etc/debian/freefem++-doc.docs \
61etc/debian/freefem++-mpich.dirs \
62etc/debian/FreeFem++.1 \
63etc/debian/freefem++-mpich.install \
64etc/debian/freefem++-mpich.postinst \
65etc/debian/freefem++-nw.postinst \
66etc/debian/shlibs.local \
67etc/debian/rules \
68etc/debian/freefem++-mpich.prerm \
69etc/debian/copyright \
70etc/debian/freefem++-nw.dirs \
71etc/debian/CopyToServer.sh \
72etc/debian/control \
73etc/debian/freefem++-nw.links \
74etc/config/FreeFem++.scrpt-txt.in \
75etc/config/FreeFem++.app.in.tgz \
76etc/config/m4/acoptim.m4 \
77etc/config/m4/acmpi.m4 \
78etc/config/m4/ax_lib_hdf5.m4 \
79etc/config/m4/ax_lib_gsl.m4 \
80etc/config/m4/regtests.m4 \
81etc/config/m4/acmacros.m4 \
82etc/config/m4/ax_openmp.m4 \
83etc/config/m4/tags.rOZFHw \
84etc/config/m4/WindowsPackage.m4 \
85etc/FreeFem++.app/Contents \
86etc/FreeFem++.app/Contents/Resources \
87etc/FreeFem++.app/Contents/Resources/English.lproj \
88etc/FreeFem++.app/Contents/Resources/English.lproj/MainMenu.nib \
89etc/FreeFem++.app/Contents/Resources/English.lproj/MainMenu.nib/classes.nib \
90etc/FreeFem++.app/Contents/Resources/English.lproj/MainMenu.nib/NSAppleMenuImage.tiff \
91etc/FreeFem++.app/Contents/Resources/English.lproj/MainMenu.nib/info.nib \
92etc/FreeFem++.app/Contents/Resources/English.lproj/MainMenu.nib/objects.nib \
93etc/FreeFem++.app/Contents/Resources/FreeFem++.icns \
94etc/FreeFem++.app/Contents/Resources/script \
95etc/FreeFem++.app/Contents/Resources/Credits.rtf \
96etc/FreeFem++.app/Contents/Info.plist \
97etc/FreeFem++.app/Contents/PkgInfo \
98etc/logo/logo.ico \
99etc/logo/logo.bmp \
100etc/doxygen/mainpage.dox \
101etc/doxygen/Doxyfile \
102etc/jenkins \
103etc/jenkins/install.sh \
104etc/jenkins/deployDEB.sh \
105etc/jenkins/build.sh \
106etc/jenkins/check.sh \
107etc/jenkins/configure.sh \
108etc/jenkins/clean.sh \
109etc/jenkins/build_PETSc.sh \
110etc/ff/ff.xcodeproj \
111etc/ff/ff.xcodeproj/project.pbxproj  \
112readme/BUGS			readme/HISTORY_BEFORE_2005	readme/README_MAC.md		readme/TODO \
113readme/COPYRIGHT		readme/INNOVATION		readme/README_COMPILATION.md	readme/README_WINDOWS.md \
114readme/HISTORY			readme/README			readme/README_GIT.md		readme/README_XCODE.md \
115idp/ffddm_geneoCS.idp \
116idp/func-max.idp \
117idp/DDM-Schwarz-macro.idp \
118idp/ExtractDofsonBorder.idp \
119idp/Heat3d.idp \
120idp/MPIGMRESmacro.idp \
121idp/gsl.idp \
122idp/ffddm_partitioning.idp \
123idp/cube.idp \
124idp/mortar-msh.idp \
125idp/Makefile.am \
126idp/movemeshsmooth.idp \
127idp/DDM-funcs-v2.idp \
128idp/cobrameshcavity.idp \
129idp/MPIplot.idp \
130idp/MeshSurface.idp \
131idp/ffddm.idp \
132idp/ffddm_coarsemeshCS.idp \
133idp/ffddm_geneoCS_3rdlvl.idp \
134idp/getARGV.idp \
135idp/ffddm_functions.idp \
136idp/macro_ddm_substructuring.idp \
137idp/ffddm_parameters.idp \
138idp/macro_ddm.idp \
139idp/CC.idp
140
141
142
143FF_MAC_PREFIX=FreeFem++v$(VERSION)$(ADD_PACKAGE_NAME)
144
145FF_EXAMPLES_FILES=tutorial/aile.msh \
146	tutorial/xyf \
147	3d/dodecaedre01.mesh \
148	3d/lac-leman-v4.msh \
149	plugin/lg.pgm \
150	mpi/regtests.sh \
151	misc/speedtest.sh \
152	*/*.edp \
153	CheckAllEdp \
154	plugin/ch.pts \
155	plugin/g.gmesh
156
157clean-local::
158	-find . \( -name '*~' -or  -name ListOfUnAllocPtr.bin \) | xargs rm
159	-rm examples/*/*.eps
160
161# "dist" targets
162clean-local::
163	-rm freefem++-*.tar.gz freefem++-*.zip
164	-rm Output/FreeFem++-*.exe
165
166# Reduced compilation
167# -------------------
168
169unittests::
170	-cd unit && make
171
172quick:
173	cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS)
174	cd src/lglib && $(MAKE) $(AM_MAKEFLAGS)
175	cd src/fflib && $(MAKE) $(AM_MAKEFLAGS)
176	cd src/std && $(MAKE) $(AM_MAKEFLAGS)
177
178nw:
179	cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS)
180	cd src/lglib && $(MAKE) $(AM_MAKEFLAGS)
181	cd src/fflib && $(MAKE) $(AM_MAKEFLAGS)
182	cd src/nw && $(MAKE) $(AM_MAKEFLAGS)
183
184bamg:
185	cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS)
186	cd src/lglib && $(MAKE) $(AM_MAKEFLAGS)
187	cd src/fflib && $(MAKE) $(AM_MAKEFLAGS)
188	cd src/bamg && $(MAKE) $(AM_MAKEFLAGS)
189
190ide:
191	cd src/libMesh && $(MAKE) $(AM_MAKEFLAGS)
192	cd 3rdparty && $(MAKE) $(AM_MAKEFLAGS)
193	cd src/lglib && $(MAKE) $(AM_MAKEFLAGS)
194	cd src/fflib && $(MAKE) $(AM_MAKEFLAGS)
195	cd src/ide && $(MAKE) $(AM_MAKEFLAGS) FreeFem++-cs$(EXEEXT)
196
197# Cleaning generated files which are stored in the CVS repository, to
198# avoid technical CVS conflicts.
199clean-gen:
200	./cleanregen.sh
201
202# Testing
203# -------
204
205# The standard automake goal "make check" is also valid. It just does
206# not run any test that could prevent the user from working on its
207# machine (because of unexpected windows opening right in the middle
208# of the workspace).
209
210visualcheck: all
211	$(MAKE) $(AM_MAKEFLAGS) check VISUALCHECK=yes
212
213# Windows package
214# ---------------
215
216# Windows package script (for Inno Setup). We extract version
217# information from the Debian Changelog to get the package release
218# number as well.
219win32:WindowsPackage.iss FreeFEM-documentation.pdf
220	test ! -d plugin/include-tmp  || rm -r plugin/include-tmp
221	cd plugin;mkdir include-tmp;cp -Lr seq/include/*  */*.h  include-tmp
222	cp -r 3rdparty/include/. plugin/include-tmp/.
223	/c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/ISCC.exe  "`cygpath.exe WindowsPackage.iss`"
224WindowsPackage.iss: etc/config/m4/WindowsPackage.m4 configure.ac Makefile.am
225	m4 -DVERSION='$(VERSION)$(ADD_PACKAGE_NAME)' \
226	-DMPIPROG='$(MPIPROG)' -DSIZEOFPTR='$(SIZEOF_PTRINBIT)' \
227	-DHOSTOS='$(host_os)'  etc/config/m4/WindowsPackage.m4  > WindowsPackage.iss
228	echo loadpath += '"!\."'  >freefem++.pref
229	echo includepath += '"!\idp"'  >>freefem++.pref
230
231# Debian package
232# --------------
233
234deb:
235	dpkg-buildpackage -rfakeroot
236	@echo Now run CopyToServer.sh in debian subdirectory
237
238# Build all versions
239# ------------------
240
241
242nativeX: $(FF_MAC_PREFIX)_MacOsX.tgz
243	echo "done"
244MacOsX: FreeFem++.app.tgz
245	-rm -rf  OsXxx
246	mkdir -p  OsXxx/Applications/
247	make install DESTDIR="`pwd`/OsXxx"
248	tar zxvf FreeFem++.app.tgz -C OsXxx/Applications/
249	cd OsXxx;tar cvfz  ../$(FF_MAC_PREFIX)_MacOsX.tgz .
250	rm -rf OsXxx
251clean-local::
252	-rm freefem++-$(VERSION).tar.gz
253	-rm -rf FreeFem++v*_MacOS
254
255# Native MacOS packaging
256# ----------------------
257install-exec-local:: bin/script/PostInstall.sh FreeFEM-documentation.pdf
258	test `uname` != Darwin || $(MAKE) FreeFem++-CoCoa  bin/script/PostInstall.sh
259	$(mkinstalldirs) -m 755 $(DESTDIR)$(pkgdatadir)	\
260		$(DESTDIR)$(PREFIX)/share/examples/freefem++
261	test `uname` != Darwin || $(mkinstalldirs) -m 755 $(DESTDIR)/etc/paths.d/
262	test `uname` != Darwin || $(mkinstalldirs) -m 755 $(DESTDIR)/usr/local/bin
263	cd examples ; tar cvf - $(FF_EXAMPLES_FILES) | (cd $(DESTDIR)$(PREFIX)/share/examples/freefem++; tar xvf -)
264	$(INSTALL_SCRIPT) examples/CheckAll examples/CheckAllEdp $(DESTDIR)$(PREFIX)/share/examples/freefem++
265	$(mkinstalldirs) -m 755 $(DESTDIR)${bindir}
266	test ! -s FreeFEM-documentation.pdf || $(INSTALL_DATA) FreeFEM-documentation.pdf  "$(DESTDIR)$(PREFIX)/share/doc/freefem++"
267	test `uname` != Darwin || $(INSTALL_SCRIPT) FreeFem++-CoCoa  $(DESTDIR)${bindir}
268	test `uname` != Darwin || echo $(bindir) >$(DESTDIR)/etc/paths.d/FreeFem++
269	test `uname` != Darwin || ( rm $(DESTDIR)/usr/local/bin/FreeFem++-CoCoa ; $(INSTALL_SCRIPT) FreeFem++-CoCoa  $(DESTDIR)/usr/local/bin )
270	test `uname` != Darwin || ( $(MAKE) FreeFem++.app.tgz  ; test -d $(DESTDIR)/Applications ||  mkdir $(DESTDIR)/Applications ; tar zxf FreeFem++.app.tgz  -C $(DESTDIR)/Applications )
271	$(mkinstalldirs) -m 755 $(DESTDIR)$(ff_prefix_dir)/idp
272	cd idp; for i in *.idp; do \
273	 if [ -f $$i ] ; then 	$(INSTALL)  -m 555 $$i $(DESTDIR)$(ff_prefix_dir)/idp; fi; done
274
275bin/script/PostInstall.sh:./Makefile bin/script/PostInstall.m4
276	m4 "-DFF__FVER=$(PACKAGE_VERSION)" "-DFF_BINDIR=$(bindir)" "-DFF__DATADIR=$(pkgdatadir)" bin/script/PostInstall.m4 > bin/script/PostInstall.sh
277	chmod a+x bin/script/PostInstall.sh
278
279FreeFEM-documentation.pdf:Makefile
280if DOWNLOAD
281	-rm FreeFEM-documentation.pdf.md5
282	-$(WGET) https://doc.freefem.org/pdf/FreeFEM-documentation.pdf.md5
283	-md5sum -c FreeFEM-documentation.pdf.md5 || (rm FreeFEM-documentation.pdf ; $(WGET) https://doc.freefem.org/pdf/FreeFEM-documentation.pdf)
284else
285	touch FreeFEM-documentation.pdf
286	echo "no downloaded documentation"
287endif
288
289ListFiles-natives: .FORCE
290	test `uname` != Darwin || $(MAKE)  FreeFem++-CoCoa
291	echo $(FF_EXAMPLES_FILES) >$@
292	echo ./3rdparty/fftw/Makefile ./3rdparty/fftw/Makefile.am  >>$@
293	find .  -name '*.[ei]dp' -o -name '*.h*' -o -name '*.cpp' -o -name '*.pgm'  |egrep  '[.]/examples/examples' >>$@
294	find .   -name '*.h*' -o -name '*.cpp'  |egrep  '[.]/examples/examples' >>$@
295List-agl-dylib: src/nw/FreeFem++
296	otool -L src/nw/FreeFem++|egrep -v '/System/Library/|/usr/lib/'|awk '/.dylib/ {print $$1}' >$@
297CheckMacLib.sh: src/nw/FreeFem++
298	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"  >$@
299	chmod a+x $@
300CheckMPIMacLib.sh: src/mpi/FreeFem++-mpi
301	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"  >$@
302	chmod a+x $@
303
304$(FF_MAC_PREFIX)_Macos:documentation ListFiles-natives
305	-mkdir $@
306	cat ListFiles-natives|xargs tar chf - | (cd $@ ; tar xf - )
307	/Developer/Tools/CpMac "FreeFem++(Carbon)" $@/FreeFem++
308if DOWNLOAD
309	cp   FreeFEM-documentation.pdf $@
310endif
311
312$(FF_MAC_PREFIX)_MacOsX: all documentation  ListFiles-natives List-agl-dylib
313	-mkdir $@
314if DOWNLOAD
315	cp   FreeFEM-documentation.pdf $@
316endif
317	cat ListFiles-natives|xargs tar chf - | (cd $@ ; tar xf - )
318	cd  $@ ; tar zxf ../src/agl/FreeFem++.app.tgz
319	sed <src/agl/Info-plist.am >$@/FreeFem++.app/Contents/Info.plist \
320           -e "s/@VVERSION@/$(VERSION)$(ADD_PACKAGE_NAME)/g" \
321           -e "s/@DATE@/`date`/g"
322	cp src/nw/FreeFem++ $@/FreeFem++.app/Contents/bin
323	cp src/nw/ffglut $@/FreeFem++.app/Contents/bin
324	cp src/medit/ffmedit $@/FreeFem++.app/Contents/bin
325	cp examples/plugin/ff-get-dep  $@/FreeFem++.app/Contents/bin
326	cp examples/plugin/ff-pkg-download  $@/FreeFem++.app/Contents/bin
327	sed <examples/plugin/ff-c++ > $@/FreeFem++.app/Contents/bin/ff-c++ 	-e 's;FFAPPLI_INC;$@/FreeFem++.app/Contents/include;'
328	chmod a+x $@/FreeFem++.app/Contents/bin/ff-c++
329	-mkdir $@/FreeFem++.app/Contents/include
330	-mkdir $@/FreeFem++.app/Contents/idp
331	cp examples/plugin/include/* $@/FreeFem++.app/Contents/include
332	cp examples/plugin/*.dylib  $@/FreeFem++.app/Contents/lib
333	cp idp/*.idp  $@/FreeFem++.app/Contents/idp
334	-if [ -s List-agl-dylib ]; then tar zchvf $@/OtherMacOsLib.tgz `cat List-agl-dylib`; fi;
335	./config.status  --file=$@/Install-MacOS.command:Install-MacOS.command.in
336	chmod a+rx $@/Install-MacOS.command
337	-mkdir $@/FreeFem++.app/Contents/etc
338	echo loadpath += \"./\"  >$@/FreeFem++.app/Contents/etc/freefem++.pref
339	echo loadpath += \"$(ff_prefix_dir)/lib\"  >>$@/FreeFem++.app/Contents/etc/freefem++.pref
340	echo includepath += \"$(ff_prefix_dir)/edp\"  >>$@/FreeFem++.app/Contents/etc/freefem++.pref
341	echo includepath += \"$(ff_prefix_dir)/idp\"  >>$@/FreeFem++.app/Contents/etc/freefem++.pref
342
343
344$(FF_MAC_PREFIX)_MacOsX.tgz: $(FF_MAC_PREFIX)_MacOsX
345	tar zcvf $(FF_MAC_PREFIX)_MacOsX.tgz  $(FF_MAC_PREFIX)_MacOsX
346
347# Linux binary-only package
348# -------------------------
349
350# Include kernel and libc version in static package name
351PACKAGE_NAME=FreeFem++v$(VERSION)_linux-$(KERNEL_VERSION)_$(LIBC_VERSION)$(OPTIM_TYPE)
352
353linux-package: $(PACKAGE_NAME).tgz
354
355# No direct dependency to "all" to be able to debug the packaging
356# procedure on its own.
357
358$(PACKAGE_NAME):  ListFiles-natives
359	cat ListFiles-natives|xargs tar cfh - | (cd $@ ; tar xf - )
360	-mkdir $@
361	cp src/std/FreeFem++ $@
362	./copysharedlibs.sh src/std/FreeFem++ $@
363	cp src/nw/FreeFem++-nw $@
364	./copysharedlibs.sh src/nw/FreeFem++-nw $@
365	cp src/ide/FreeFem++-cs $@
366	./copysharedlibs.sh src/ide/FreeFem++-cs $@
367	cp src/ide/FreeFem++-server $@
368	./copysharedlibs.sh src/ide/FreeFem++-server $@
369	cp src/ide/FreeFem++-client $@
370	./copysharedlibs.sh src/ide/FreeFem++-client $@
371	-cp src/glx/FreeFem++-glx $@
372	-./copysharedlibs.sh src/glx/FreeFem++-glx $@
373	-cp src/mpi/FreeFem++-mpi $@
374	-./copysharedlibs.sh src/mpi/FreeFem++-mpi $@
375
376
377$(PACKAGE_NAME).tgz: $(PACKAGE_NAME)
378	tar cvzf $@ $<
379
380clean-local::
381	-rm -r $(PACKAGE_NAME) $(PACKAGE_NAME).tgz
382autofiles:AutoGeneratedFile.tar.gz
383LIST_REQUIRE_AM= compile config.guess config.sub depcomp install-sh  missing  test-driver
384LIST_AM_UNUSED=ar-lib  mdate-sh ylwrap py-compile texinfo.tex
385LIST_GENERATE_FILE= configure config.h.in \
386   Makefile.in \
387    3rdparty/Makefile.in \
388    3rdparty/blas/Makefile.in \
389    3rdparty/arpack/Makefile.in \
390    3rdparty/umfpack/Makefile.in \
391    3rdparty/fftw/Makefile.in \
392    src/Makefile.in \
393    src/bamglib/Makefile.in \
394    src/Graphics/Makefile.in \
395    src/ffgraphics/Makefile.in \
396    src/ffgraphics/client/Makefile.in \
397    src/ffgraphics/server/Makefile.in \
398    src/femlib/Makefile.in \
399    src/Algo/Makefile.in \
400    src/lglib/Makefile.in \
401    src/fflib/Makefile.in \
402    src/nw/Makefile.in \
403    src/mpi/Makefile.in \
404    src/bamg/Makefile.in \
405    src/libMesh/Makefile.in \
406    src/medit/Makefile.in \
407    src/bin-win32/Makefile.in \
408    plugin/Makefile.in \
409	plugin/seq/Makefile.in \
410	plugin/mpi/Makefile.in \
411	examples/Makefile.in \
412    examples/plugin/Makefile.in \
413    examples/tutorial/Makefile.in \
414    examples/misc/Makefile.in \
415    examples/mpi/Makefile.in \
416    examples/hpddm/Makefile.in \
417    examples/ffddm/Makefile.in \
418    examples/eigen/Makefile.in \
419    examples/examples/Makefile.in \
420    examples/bug/Makefile.in \
421    examples/3d/Makefile.in \
422    examples/3dSurf/Makefile.in \
423    examples/3dCurve/Makefile.in
424
425LIST_GENERATE_FILE_AM= \
426  Makefile.am \
427    3rdparty/Makefile.am \
428    3rdparty/blas/Makefile.am \
429    3rdparty/arpack/Makefile.am \
430    3rdparty/umfpack/Makefile.am \
431    3rdparty/fftw/Makefile.am \
432    src/Makefile.am \
433    src/bamglib/Makefile.am \
434    src/Graphics/Makefile.am \
435    src/ffgraphics/Makefile.am \
436    src/ffgraphics/client/Makefile.am \
437    src/ffgraphics/server/Makefile.am \
438    src/femlib/Makefile.am \
439    src/Algo/Makefile.am \
440    src/lglib/Makefile.am \
441    src/fflib/Makefile.am \
442    src/nw/Makefile.am \
443    src/mpi/Makefile.am \
444    src/bamg/Makefile.am \
445    src/libMesh/Makefile.am \
446    src/medit/Makefile.am \
447    src/bin-win32/Makefile.am \
448    plugin/Makefile.am \
449	plugin/seq/Makefile.am \
450	plugin/mpi/Makefile.am \
451	examples/Makefile.am \
452    examples/plugin/Makefile.am \
453    examples/tutorial/Makefile.am \
454    examples/misc/Makefile.am \
455    examples/mpi/Makefile.am \
456    examples/hpddm/Makefile.am \
457    examples/ffddm/Makefile.am \
458    examples/eigen/Makefile.am \
459    examples/examples/Makefile.am \
460    examples/bug/Makefile.am \
461    examples/3d/Makefile.am \
462    examples/3dSurf/Makefile.am \
463    examples/3dCurve/Makefile.am
464
465
466#$(LIST_GENERATE_FILE):$(LIST_GENERATE_FILE_AM)
467#	@echo "WARNING the configure file is older than  configure build flies"
468#	@echo "Rebuild configure: do one the three case"
469#	@echo " if you have autoconf    # make conf"
470#	@echo " or without              #  make conf-without-autoconf"
471#	@echo " or by pass this problem #  make conf-touch"
472conf:
473	autoreconf
474	./config.status --recheck
475conf-without-autoconf:
476	tar zxvf AutoGeneratedFile.tar.gz
477	./config.status --recheck
478conf-touch:
479	touch $(LIST_GENERATE_FILE)
480AutoGeneratedFile.tar.gz:$(LIST_GENERATE_FILE)  configure.ac $(LIST_REQUIRE_AM)
481	tar cvfz $@  $(LIST_GENERATE_FILE) $(LIST_REQUIRE_AM)
482
483FreeFem++-CoCoa:bin/FreeFem++-CoCoa.in ./config.status
484		./config.status  --file="FreeFem++-CoCoa:bin/FreeFem++-CoCoa.in"
485FreeFem++.app.tgz:./config.status etc/config/FreeFem++.app.in.tgz
486	tar zxf etc/config/FreeFem++.app.in.tgz
487	./config.status --file=FreeFem++.scrpt-txt:etc/config/FreeFem++.scrpt-txt.in
488	-rm FreeFem++.app/Contents/Resources/Scripts/main.scpt
489	 osacompile <FreeFem++.scrpt-txt -o FreeFem++.app/Contents/Resources/Scripts/main.scpt
490	tar zcf FreeFem++.app.tgz FreeFem++.app
491
492# ALH - build a robust TAGS file for a whole directory tree (more robust than the automake TAGS directive because of the
493# multiple source trees downloaded within FF)
494
495findtags:
496	find . -type f -name '*.?pp'|grep -v lg.tab|xargs etags
497clean-local::
498	-rm TAGS
499
500##  trick to check if the configure configure.ac Makefile.in .. are correct in time
501Makefile: @MAINTAINER_MODE_FALSE@ configure  $(LIST_GENERATE_FILE_AM)
502	echo "configure Makefile:$(LIST_GENERATE_FILE_AM)"  >Makefile-for-Checkam
503	echo '@false'| tr '@' '\t'  >> Makefile-for-Checkam
504	if $(MAKE) -f Makefile-for-Checkam 2>&1 >/dev/null ; \
505	 then ok=1 ; \
506	else \
507	$(MAKE) -f Makefile-for-Checkam ; \
508	echo "Need to rebuid configure and Makefile files " ;\
509	echo "Do autoreconf -i or tar zxvf tar zxvf AutoGeneratedFile.tar.gz" ;\
510	echo " and ./reconfigure" ;\
511	ok=0; \
512	fi ;  \
513	test $$ok -eq 1
514.FORCE:
515