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
|
###########################################################################
#
# MAKEFILE Distributing the C++ port of NEC
#
# Author: Tim Molteno.
#
#
#
# Copyright (C) 2004-2005 Timothy C.A. Molteno
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
all: dist
###########################################################################################################
#
# This builds a source code distribution (and a Windows executable) and packages it into
# an archive. Also uploads it to the server
#
BUILD_DATE=$(shell date +%Y-%m-%d)
BUILDDIR=necpp_$(shell date +%Y%m%d)
DEST=elec@www.physics.otago.ac.nz:electronics/nec
ARCHIVE=${BUILDDIR}
VERSION=$(shell fgrep AM_INIT_AUTOMAKE configure.in | sed -r -e "s/([^0-9]+)([0-9\.]+).+/\2/g")
NEC_VERSION=${VERSION} "[${BUILD_DATE}]"
test:
echo ${NEC_VERSION}
.PHONY : win32
win32:
#
# Make a zipped source distribution for Windows
rm -rf ${BUILDDIR}
mkdir -p ${BUILDDIR}/src
cp src/*.cpp ${BUILDDIR}/src
cp src/*.h ${BUILDDIR}/src
cp README ${BUILDDIR}
mkdir -p ${BUILDDIR}/test_data
cp test_data/*.nec ${BUILDDIR}/test_data
cp -a win32/ ${BUILDDIR}
cd ${BUILDDIR}; rm -rf `find . -name CVS`
rm -f ${ARCHIVE}.zip
zip -vr ${ARCHIVE}.zip ${BUILDDIR}
#
# Make the Windows executable (nec2++.exe) with MinGW
#
# To install mingw on debian simply issue the command:
#
# aptitude install mingw32
#nec_version
win32_exe:
make distclean
./configure --host=i586-mingw32msvc --build=i386-linux CXXFLAGS="-O3 -mtune=athlon-xp -march=pentium -Dnec_build_date='\"${BUILD_DATE}\"' -Dbuild_version='\"${VERSION}\"' " --prefix=/tmp/necpp_w32
make
make install-strip
mv /tmp/necpp_w32/bin/nec2++.exe .
zip nec2++.zip nec2++.exe
#
# If we're using Visual Studio we just copy the executable over
# scp electron:nec2++.exe .
dist:
rm -rf ${BUILDDIR}
mkdir -p ${BUILDDIR}/src
cp src/*.cpp ${BUILDDIR}/src
cp src/*.h ${BUILDDIR}/src
cp makefile.dist ${BUILDDIR}
cp README ${BUILDDIR}
mkdir -p ${BUILDDIR}/test_data
cp test_data/*.nec ${BUILDDIR}/test_data
tar -cf ${ARCHIVE}.tar ${BUILDDIR}
rm -f ${ARCHIVE}.tar.bz2
bzip2 -9 ${ARCHIVE}.tar
#
# Make a .tar.bz2 source distribution for Linux
rm -rf www
mkdir -p www
cp ${ARCHIVE}.tar.bz2 www/necpp_latest.tar.bz2
mv ${ARCHIVE}.tar.bz2 www
#
# Make a zipped source distribution for Windows
#
cp -a win32/ ${BUILDDIR}
cd ${BUILDDIR}; rm -rf `find . -name CVS`
rm -f ${ARCHIVE}.zip
zip -vr ${ARCHIVE}.zip ${BUILDDIR}
mv ${ARCHIVE}.zip www
#
- make distclean
make -f Makefile.cvs
./configure CXXFLAGS="-O3 -mtune=athlon-xp -march=pentium -Dnec_build_date='\"${BUILD_DATE}\"' -Dbuild_version='\"${VERSION}\"'"
make -f Makefile dist
mv necpp-${VERSION}.tar.gz www
#
# Make a linux executable
#
make -f Makefile
mv src/nec2++ www
strip --strip-all www/nec2++
cd www; tar -cf nec2++.tar nec2++; gzip -9 nec2++.tar
#
# The following used to make the Windows executable
#
make -f makefile.dist win32_exe
mv nec2++.zip www
cp docs/*.html www
# cp docs/users_guide.pdf www
rsync --verbose --rsh=ssh --cvs-exclude --recursive www/* ${DEST}
nec2c_src:
rm -rf nec2c_src
mkdir -p nec2c_src
cp c_src/*.* nec2c_src
cp c_src/Makefile nec2c_src
cp c_src/README nec2c_src
cd nec2c_src; rm -rf `find . -name CVS`
rm -f nec2c_src.tar.gz
tar -cf nec2c_src.tar nec2c_src
gzip -9 nec2c_src.tar
scp nec2c_src.tar.gz ${DEST}
|