| 1 |
|
| 2 |
DIRPKG=../pkg |
| 3 |
LISTINST= ../bin/f2c ../bin/fort77 ../include/f2c.h ../lib/libf2c.a |
| 4 |
DIRINSTALL=/usr/local |
| 5 |
F2C_TAR=$(DIRPKG)/f2c.tar |
| 6 |
all:compile |
| 7 |
|
| 8 |
$(F2C_TAR): |
| 9 |
mkdir -p $(DIRPKG) |
| 10 |
$(WGET) # wget --passive-ftp ftp://netlib.bell-labs.com/netlib/f2c.tar |
| 11 |
curl http://netlib.sandia.gov/cgi-bin/netlib/netlibfiles.tar?filename=netlib/f2c -o "$(DIRPKG)/f2c.tar" |
| 12 |
f2c:$(F2C_TAR) f2c.h-int |
| 13 |
tar xvf $(F2C_TAR) |
| 14 |
gunzip -rf f2c/* |
| 15 |
gunzip -rf f2c/*/* |
| 16 |
cd f2c;unzip -d libf2c libf2c.zip |
| 17 |
for i in `find . -name f2c.h`; do cp f2c.h-int $$i; done |
| 18 |
|
| 19 |
f2c/libf2c/makefile: Makefile |
| 20 |
egrep -v 'ld -r|mv [$$]' <f2c/libf2c/makefile.u >f2c/libf2c/makefile |
| 21 |
|
| 22 |
compile:f2c f2c/libf2c/makefile |
| 23 |
cd f2c/src; make -f makefile.u f2c |
| 24 |
cd f2c/libf2c; make |
| 25 |
|
| 26 |
compile-10.4:f2c Makefile-MacOs |
| 27 |
cd f2c/src; make -f makefile.u f2c |
| 28 |
cd f2c/libf2c; make -f ../../Makefile-MacOs OS=10.4 |
| 29 |
compile-10.5:f2c Makefile-MacOs |
| 30 |
cd f2c/src; make -f makefile.u f2c |
| 31 |
cd f2c/libf2c; make -f ../../Makefile-MacOs OS=10.5 |
| 32 |
compile-10.6:f2c Makefile-MacOs |
| 33 |
cd f2c/src; make -f makefile.u f2c |
| 34 |
cd f2c/libf2c; make -f ../../Makefile-MacOs OS=10.6 |
| 35 |
|
| 36 |
|
| 37 |
install: ../lib ../include ../bin ../bin/fort77 ../bin/mpifort77 |
| 38 |
-mkdir ../bin |
| 39 |
cp f2c/src/f2c ../bin/. |
| 40 |
cp f2c/src/f2c.h ../include |
| 41 |
cp f2c/libf2c/libf2c.a ../lib |
| 42 |
../bin/fort77 tt.f |
| 43 |
rm a.out |
| 44 |
|
| 45 |
install-10.4: compile-10.4 |
| 46 |
sudo make install-sudo |
| 47 |
make install |
| 48 |
install-10.5: compile-10.5 |
| 49 |
sudo make install-sudo |
| 50 |
make install |
| 51 |
install-10.6: compile-10.6 |
| 52 |
sudo make install-sudo |
| 53 |
make install |
| 54 |
install-sudo: $(DIRINSTALL)/bin/fort77 $(DIRINSTALL)/bin/mpifort77 |
| 55 |
mkdir -p $(DIRINSTALL)/bin $(DIRINSTALL)/include $(DIRINSTALL)/lib |
| 56 |
cp f2c/src/f2c $(DIRINSTALL)/bin; |
| 57 |
cp f2c/src/f2c.h $(DIRINSTALL)/include; |
| 58 |
cp f2c/libf2c/libf2c.a $(DIRINSTALL)/lib |
| 59 |
$(DIRINSTALL)/bin/fort77 tt.f |
| 60 |
rm a.out |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
../bin/fort77: fort77.sed Makefile |
| 65 |
dd="`pwd`/.." ; \ |
| 66 |
sed -e "s;@CC@;$(CC);"g \ |
| 67 |
-e "s;@INC@;-I$$dd/include;g" \ |
| 68 |
-e "s;@LLIBDIR@;-L$$dd/lib;g" \ |
| 69 |
-e "s;@f2c@;$$dd/bin/f2c;g" < fort77.sed >../bin/fort77 |
| 70 |
chmod a+x ../bin/fort77 |
| 71 |
../bin/mpifort77: fort77.sed Makefile |
| 72 |
dd="`pwd`/.." ; \ |
| 73 |
sed -e "s;@CC@;mpicc;"g \ |
| 74 |
-e "s;@INC@;-I$$dd/include;g" \ |
| 75 |
-e "s;@LLIBDIR@;-L$$dd/lib;g" \ |
| 76 |
-e "s;@f2c@;$$dd/bin/f2c;g" < fort77.sed >../bin/fort77 |
| 77 |
chmod a+x ../bin/fort77 |
| 78 |
|
| 79 |
$(DIRINSTALL)/bin/fort77: fort77.sed Makefile |
| 80 |
dd="$(DIRINSTALL)/" ; \ |
| 81 |
sed -e "s;@CC@;$(CC);"g \ |
| 82 |
-e "s;@INC@;-I$$dd/include;g" \ |
| 83 |
-e "s;@LLIBDIR@;-L$$dd/lib;g" \ |
| 84 |
-e "s;@f2c@;$$dd/bin/f2c;g" < fort77.sed >$(DIRINSTALL)/bin/fort77 |
| 85 |
chmod a+x $(DIRINSTALL)/bin/fort77 |
| 86 |
$(DIRINSTALL)/bin/mpifort77: fort77.sed Makefile |
| 87 |
dd="$(DIRINSTALL)/" ; \ |
| 88 |
sed -e "s;@CC@;mpicc;"g \ |
| 89 |
-e "s;@INC@;-I$$dd/include;g" \ |
| 90 |
-e "s;@LLIBDIR@;-L$$dd/lib;g" \ |
| 91 |
-e "s;@f2c@;$$dd/bin/f2c;g" < fort77.sed >$(DIRINSTALL)/bin/fort77 |
| 92 |
chmod a+x $(DIRINSTALL)/bin/fort77 |
| 93 |
|
| 94 |
|
| 95 |
../bin: |
| 96 |
mkdir ../bin |
| 97 |
../lib: |
| 98 |
mkdir ../lib |
| 99 |
../include: |
| 100 |
mkdir ../include |
| 101 |
clean-local: |
| 102 |
-rm -rf f2c *~ a.out |
| 103 |
clean:clean-local |
| 104 |
|
| 105 |
veryclean: clean |
| 106 |
-rm $(LISTINST) $(F2C_TAR) |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|