#
# A recent (mid-2008 or later) version of gfortran is required.
# I have had good results with the binaries from http://hpc.sourceforge.net/
# for various Mac OS X platforms:
# gcc-snwleo-intel-bin.tar.gz (Snow Leopard or 10.6),
# gcc-leopard-ppc-bin.tar.gz (PowerPC, 10.5)
# gcc-leopard-intel-bin.tar.gz (Intel Mac, 10.5 or earlier).
# Each requires the Developer (XCode) Optional Install to create the necessary libraries
 
# this may look odd but it should work, and
# ensures compatibility, as some gcc versions are older than the gfortran binaries
#
gfortran -c -O iswap4.c kzext2.c kzext2_bigendian.c unsigned.c
#
# kzext2 converts two-byte unsigned integer to integer
# kzext2_bigendian swaps bytes before doing so.
# if PowerPC, SPARC, PA-RISC (HP) or SGI, uncomment the next line
# /bin/mv kzext2_bigendian.o kzext2.o
#
gfortran -ffixed-line-length-none -O -o ../bin/rdr2xyz rdr2xyz.f unsigned.o iswap4.o kzext2.o -static-libgfortran
gfortran -ffixed-line-length-none -O -o ../bin/rdr2table rdr2table.f unsigned.o iswap4.o kzext2.o -static-libgfortran

# these require a link to the appropriate SPICE library file from http://naif.jpl.nasa.gov/naif/toolkit.html
gfortran -ffixed-line-length-none -O -o ../bin/rdr2csv rdr2csv.f unsigned.o iswap4.o kzext2.o spicelib.a -static-libgfortran
gfortran -ffixed-line-length-none -O -o ../bin/rdr2tab rdr2tab.f unsigned.o iswap4.o kzext2.o spicelib.a -static-libgfortran
#
# move the executables from ../bin to something in your path
