1 | # build the compiled fortran codes needed by GSAS-II |
---|
2 | |
---|
3 | BIN = bin |
---|
4 | LIBS = $(BIN)/pack_f.$(SUFFIX) $(BIN)/pyspg.$(SUFFIX) |
---|
5 | LIBSwGSAS = $(BIN)/pypowder.$(SUFFIX) |
---|
6 | SYMLIB := $(wildcard spsubs/*.for) |
---|
7 | #---------------------------------------------------------------------- |
---|
8 | # linux (gfortran) |
---|
9 | #COMPILER=--fcompiler=gnu95 |
---|
10 | #PACKCOPTS=--f77flags="-fno-range-check" |
---|
11 | #SUFFIX=so |
---|
12 | #F2PY=f2py |
---|
13 | #MOVE=mv |
---|
14 | #DEL=echo |
---|
15 | #---------------------------------------------------------------------- |
---|
16 | # mac (gfortran) |
---|
17 | GSASlib = /Users/toby/software/work/gsas/2009Aug31/libgsas.a |
---|
18 | COMPILER=--fcompiler=gnu95 --f90exec=/usr/local/bin/gfortran |
---|
19 | #PACKCOPTS=--f77flags="-fno-range-check -static-libgcc" |
---|
20 | SUFFIX=so |
---|
21 | F2PY=f2py |
---|
22 | MOVE=mv |
---|
23 | DEL=echo |
---|
24 | #---------------------------------------------------------------------- |
---|
25 | # windows g77 |
---|
26 | #COMPILER=--fcompiler=gnu |
---|
27 | #PACKCOPTS=--f77flags="-fno-range-check" |
---|
28 | #SUFFIX=pyd |
---|
29 | #F2PY=f2py.py |
---|
30 | #MOVE=copy |
---|
31 | #DEL=del |
---|
32 | #---------------------------------------------------------------------- |
---|
33 | |
---|
34 | ask: |
---|
35 | @echo "" |
---|
36 | @echo "Use make all or choose a target: " |
---|
37 | @echo " $(LIBS) $(LIBSwGSAS)" |
---|
38 | @echo " Note: target $(LIBSwGSAS) requires the GSAS object library." |
---|
39 | @echo " This is not built with make all. You will need to edit the" |
---|
40 | @echo " Makefile to set GSASlib to point to the correct location." |
---|
41 | |
---|
42 | all:: $(BIN) $(LIBS) |
---|
43 | |
---|
44 | # OSX: note that this is building .so's that require libgfortran and |
---|
45 | # libgcc_s.1 at runtime. The former can be removed by renaming the accessed |
---|
46 | # libgfortran.3.dynlib. Not sure how to avoid libgcc_s.1 |
---|
47 | # Use otool -L <file.so> to see what is required |
---|
48 | # |
---|
49 | .PHONY: $(BIN) |
---|
50 | mkdir $(BIN) |
---|
51 | |
---|
52 | $(BIN)/pack_f.$(SUFFIX): pack_f.for |
---|
53 | $(F2PY) -c pack_f.for -m pack_f $(COMPILER) $(PACKCOPTS) |
---|
54 | $(MOVE) pack_f.$(SUFFIX) $(BIN) |
---|
55 | $(DEL) pack_f.$(SUFFIX) |
---|
56 | |
---|
57 | $(BIN)/pypowder.$(SUFFIX): pypowder.for $(GSASlib) |
---|
58 | $(F2PY) -c pypowder.for -m pypowder $(COMPILER) $(GSASlib) |
---|
59 | $(MOVE) pypowder.$(SUFFIX) $(BIN) |
---|
60 | $(DEL) pypowder.$(SUFFIX) |
---|
61 | |
---|
62 | $(BIN)/pyspg.$(SUFFIX): pyspg.for $(SYMLIB) |
---|
63 | $(F2PY) -c pyspg.for $(SYMLIB) -m pyspg $(COMPILER) |
---|
64 | $(MOVE) pyspg.$(SUFFIX) $(BIN) |
---|
65 | $(DEL) pyspg.$(SUFFIX) |
---|
66 | |
---|
67 | # no longer in use |
---|
68 | #$(BIN)/fitellipse.$(SUFFIX): fitellipse.for |
---|
69 | # cd $(BIN); $(F2PY) -c ../fitellipse.for -m fitellipse --fcompiler=gfortran --f90exec=/usr/local/bin/gfortran --f77flags="-fno-range-check" |
---|
70 | |
---|
71 | |
---|