Skip to content
Snippets Groups Projects
Makefile 8.79 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
# $Id: Makefile,v 1.273 2003-03-07 23:35:01 geuzaine Exp $
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
include variables
Christophe Geuzaine's avatar
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
GMSH_MAJOR_VERSION = 1
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
GMSH_MINOR_VERSION = 41
Christophe Geuzaine's avatar
Christophe Geuzaine committed
GMSH_PATCH_VERSION = 1
Christophe Geuzaine's avatar
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
GMSH_RELEASE = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}
GMSH_ARCHIVE = archives/gmsh-`date "+%Y.%m.%d"`
GMSH_SOURCES = `find . \( ! -name "*.tar*" -a ! -name "*.tgz" \
                       -a ! -name "*.o"    -a ! -name "lib*.a"   \
                       -a ! -name "*.msh"  -a ! -name "*.bak" \
                       -a ! -name "gmsh"   -a ! -name "gmsh-*"\
                       -a ! -type d \)`
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
all: variables initialtag compile link

compile: variables initialtag
	@for i in ${GMSH_DIRS}; do (cd $$i && ${MAKE}); done

link: variables
	${LINKER} -o bin/gmsh ${GMSH_LIBS}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

install: variables
	-mkdir -p ${bindir}
	-cp bin/gmsh${EXEEXT} ${bindir}
	-chmod 755 ${bindir}/gmsh${EXEEXT}
	-mkdir -p ${mandir}/man1
	-cp doc/gmsh.1 ${mandir}/man1
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
variables: configure
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	@echo "********************************************************************"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	@echo "Please configure Gmsh by running ./configure"
	@echo "For help, type ./configure --help"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	@echo "********************************************************************"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	@exit 1
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
source-common:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	rm -rf gmsh-${GMSH_RELEASE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	tar zcvf gmsh.tgz `ls TODO README* */README* configure *.in Makefile */Makefile\
                           */*.[chylr] */*.[ch]pp */*.rc */*.res */*.ico */*.icns\
                           */*.p[lm] */*.sh */*.opt */*.spec`\
Christophe Geuzaine's avatar
Christophe Geuzaine committed
                           doc demos tutorial
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	mkdir gmsh-${GMSH_RELEASE}
	cd gmsh-${GMSH_RELEASE} && tar zxvf ../gmsh.tgz
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

source: source-common
	cd gmsh-${GMSH_RELEASE} && rm -rf CVS */CVS */*/CVS */.globalrc ${GMSH_VERSION_FILE}\
           NR Triangle/triangle.*
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	tar zcvf gmsh-${GMSH_RELEASE}-source.tgz gmsh-${GMSH_RELEASE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
source-nonfree: source-common
	cd gmsh-${GMSH_RELEASE} && rm -rf CVS */CVS */*/CVS */.globalrc ${GMSH_VERSION_FILE}
	tar zcvf gmsh-${GMSH_RELEASE}-source-nonfree.tgz gmsh-${GMSH_RELEASE}

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	cd Parser && ${MAKE} parser
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	cd utils && ${MAKE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for i in . lib archives demos tutorial doc ${GMSH_DIRS}; \
        do (cd $$i && rm -f *~ *~~ .gmsh-tmp .gmsh-errors gmon.out); \
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for i in doc lib ${GMSH_DIRS}; do (cd $$i && ${MAKE} clean); done
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	rm -f ${GMSH_VERSION_FILE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for i in ${GMSH_DIRS}; do (cd $$i && ${MAKE} depend "FLAGS=-DHAVE_GSL"); done
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for i in ${GMSH_DIRS} ; do \
          (cd $$i && (sed '/^# DO NOT DELETE THIS LINE/q' Makefile) > Makefile.new \
          && cp Makefile Makefile.bak \
          && cp Makefile.new Makefile \
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
          && rm -f Makefile.new); \
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	rm -f ${GMSH_VERSION_FILE}
	echo "#define GMSH_MAJOR_VERSION ${GMSH_MAJOR_VERSION}" >  ${GMSH_VERSION_FILE}
	echo "#define GMSH_MINOR_VERSION ${GMSH_MINOR_VERSION}" >> ${GMSH_VERSION_FILE}
	echo "#define GMSH_PATCH_VERSION ${GMSH_PATCH_VERSION}" >> ${GMSH_VERSION_FILE}
	echo "#define GMSH_VERSION  ((double}GMSH_MAJOR_VERSION + \\" >> ${GMSH_VERSION_FILE}
	echo "                0.01 * (double}GMSH_MINOR_VERSION + \\" >> ${GMSH_VERSION_FILE}
	echo "              0.0001 * (double}GMSH_PATCH_VERSION}"     >> ${GMSH_VERSION_FILE}
	echo "#define GMSH_DATE     \"`date`\""      >> ${GMSH_VERSION_FILE}
	echo "#define GMSH_HOST     \"`hostname`\""  >> ${GMSH_VERSION_FILE}
	echo "#define GMSH_PACKAGER \"`whoami`\""    >> ${GMSH_VERSION_FILE}
	echo "#define GMSH_OS       \"`uname -sr`\"" >> ${GMSH_VERSION_FILE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	@if [ ! -r ${GMSH_VERSION_FILE} ]; then ${MAKE} tag ; fi
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if (test -f ${GMSH_ARCHIVE}.tar.gz); then \
	  mv -f ${GMSH_ARCHIVE}.tar.gz ${GMSH_ARCHIVE}.tar.gz~; \
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	tar cvf ${GMSH_ARCHIVE}.tar ${GMSH_SOURCES}
	gzip ${GMSH_ARCHIVE}.tar
	chmod 640 ${GMSH_ARCHIVE}.tar.gz
	tar jcvf gmsh-`date "+%Y.%m.%d"`.tar.bz2 \
        `ls Makefile */Makefile */*.[chyl] */*.[ch]pp */*.rc */*.res */*.ico`
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
distrib-msg:
	@echo "********************************************************************"
	@echo "Remember to change -ljpeg, etc. to /usr/lib/libjpeg.a, etc. in"
	@echo "./variables and relink if the list below contains non-standard"
	@echo "dynamic libs and you want to distribute a portable binary:"
	@echo "********************************************************************"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
distrib-unix: clean all package-unix distrib-msg
	ldd bin/gmsh
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
distrib-windows: clean all package-windows distrib-msg
	objdump -p bin/gmsh.exe | grep DLL

distrib-mac: clean all package-mac distrib-msg
	otool -L bin/gmsh
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

package-unix:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	rm -rf gmsh-${GMSH_RELEASE}
	mkdir gmsh-${GMSH_RELEASE}
	strip bin/gmsh
	cp bin/gmsh gmsh-${GMSH_RELEASE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	cp doc/COPYING doc/gmsh.1 doc/FORMATS doc/VERSIONS doc/FAQ\
           doc/CONTRIBUTORS gmsh-${GMSH_RELEASE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	cp -R tutorial gmsh-${GMSH_RELEASE}
	cp -R demos gmsh-${GMSH_RELEASE}
	rm -rf gmsh-${GMSH_RELEASE}/*/CVS
	rm -f gmsh-${GMSH_RELEASE}/*/*.msh
	rm -f gmsh-${GMSH_RELEASE}/*/*~
	tar cvf gmsh-${GMSH_RELEASE}-${UNAME}.tar gmsh-${GMSH_RELEASE}
	gzip gmsh-${GMSH_RELEASE}-${UNAME}.tar
	mv gmsh-${GMSH_RELEASE}-${UNAME}.tar.gz gmsh-${GMSH_RELEASE}-${UNAME}.tgz

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
package-windows:
	rm -rf gmsh-${GMSH_RELEASE}
	mkdir gmsh-${GMSH_RELEASE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	strip bin/gmsh.exe
	cp /usr/bin/cygwin1.dll gmsh-${GMSH_RELEASE}
	cp bin/gmsh.exe gmsh-${GMSH_RELEASE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	cp doc/README.win32 gmsh-${GMSH_RELEASE}/README.txt
	cp doc/FORMATS gmsh-${GMSH_RELEASE}/FORMATS.txt
	cp doc/VERSIONS gmsh-${GMSH_RELEASE}/VERSIONS.txt
	cp doc/FAQ gmsh-${GMSH_RELEASE}/FAQ.txt
	cp doc/CONTRIBUTORS gmsh-${GMSH_RELEASE}/CONTRIBUTORS.txt
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	cp doc/COPYING gmsh-${GMSH_RELEASE}/COPYING.txt
	cd utils && unix2dos ../gmsh-${GMSH_RELEASE}/*.txt
	cp -R tutorial gmsh-${GMSH_RELEASE}
	cp -R demos gmsh-${GMSH_RELEASE}
	rm -rf gmsh-${GMSH_RELEASE}/*/CVS
	rm -f gmsh-${GMSH_RELEASE}/*/*.msh
	rm -f gmsh-${GMSH_RELEASE}/*/*~
	cd utils && unix2dos ../gmsh-${GMSH_RELEASE}/tutorial/* ../gmsh-${GMSH_RELEASE}/demos/*
	cd gmsh-${GMSH_RELEASE} && zip -r gmsh-${GMSH_RELEASE}-Windows.zip *
	mv gmsh-${GMSH_RELEASE}/gmsh-${GMSH_RELEASE}-Windows.zip .
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
package-mac:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	rm -rf gmsh-${GMSH_RELEASE}
	mkdir gmsh-${GMSH_RELEASE}
	mkdir gmsh-${GMSH_RELEASE}/Gmsh.app
	mkdir gmsh-${GMSH_RELEASE}/Gmsh.app/Contents
	mkdir gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/Resources
	mkdir gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/MacOS
	echo "APPLGMSH" > gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/PkgInfo 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"\
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\""\
                              " \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"\
        "<plist version=\"1.0\">\n"\
        "  <dict>\n"\
        "    <key>CFBundleName</key><string>Gmsh</string>\n"\
        "    <key>CFBundleExecutable</key><string>Gmsh</string>\n"\
        "    <key>CFBundlePackageType</key><string>APPL</string>\n"\
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        "    <key>CFBundleVersion</key><string>${GMSH_RELEASE}</string>\n"\
        "    <key>CFBundleShortVersionString</key><string>${GMSH_RELEASE}</string>\n"\
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        "    <key>CFBundleIconFile</key><string>gmsh.icns</string>\n"\
        "    <key>CFBundleSignature</key><string>GMSH</string>\n"\
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        "    <key>CFBundleGetInfoString</key><string>Gmsh ${GMSH_RELEASE},"\
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
              "(c) C. Geuzaine and J.-F. Remacle, 1997-2003</string>\n"\
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        "    <key>CFBundleIdentifier</key><string>org.geuz.Gmsh</string>\n"\
        "    <key>NSHelpFile</key><string>tutorial.html</string>\n"\
        "  </dict>\n"\
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        "</plist>" > gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/Info.plist
	strip bin/gmsh
	cp bin/gmsh gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/MacOS/Gmsh
	cp Fltk/MacIcons.icns gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/Resources/gmsh.icns
	cp tutorial/tutorial.html gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/Resources
	cp -R doc/gmsh.1 tutorial demos gmsh-${GMSH_RELEASE}
	cp doc/FORMATS gmsh-${GMSH_RELEASE}/FORMATS.txt
	cp doc/VERSIONS gmsh-${GMSH_RELEASE}/VERSIONS.txt
	cp doc/FAQ gmsh-${GMSH_RELEASE}/FAQ.txt
	cp doc/CONTRIBUTORS gmsh-${GMSH_RELEASE}/CONTRIBUTORS.txt
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	cp doc/COPYING gmsh-${GMSH_RELEASE}/COPYING.txt
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	rm -rf gmsh-${GMSH_RELEASE}/*/CVS\
               gmsh-${GMSH_RELEASE}/*/*~\
               gmsh-${GMSH_RELEASE}/*/*.msh
	tar zcvf gmsh-${GMSH_RELEASE}-MacOSX.tgz gmsh-${GMSH_RELEASE}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
rpmold:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	tar zcvf gmsh-${GMSH_RELEASE}.tar.gz ${GMSH_SOURCES}
	mv gmsh-${GMSH_RELEASE}.tar.gz /usr/src/redhat/SOURCES
	rpm -bb --define 'gmshversion ${GMSH_RELEASE}' utils/gmsh.spec
	cp /usr/src/redhat/RPMS/i386/gmsh-${GMSH_RELEASE}-?.i386.rpm .
	cp /usr/src/redhat/BUILD/gmsh-${GMSH_RELEASE}/gmsh-${GMSH_RELEASE}-${UNAME}.tgz .
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
rpm:
	tar zcvf gmsh-${GMSH_RELEASE}.tar.gz ${GMSH_SOURCES}
	mv gmsh-${GMSH_RELEASE}.tar.gz /usr/src/redhat/SOURCES
	rpmbuild -bb --define 'gmshversion ${GMSH_RELEASE}' utils/gmsh.spec
	cp /usr/src/redhat/RPMS/i386/gmsh-${GMSH_RELEASE}-?.i386.rpm .
	cp /usr/src/redhat/BUILD/gmsh-${GMSH_RELEASE}/gmsh-${GMSH_RELEASE}-${UNAME}.tgz .