source: trunk/Makefile @ 93

Last change on this file since 93 was 93, checked in by toby, 12 years ago

G2lattice: add GetBraviasNum? to interface GenHBravais to G2spc.SpcGroup? output

load test data only when needed

Makefile (etc): reorganize Makefile so that make all build targets where all sources

where all sources are provided

G2path: define a platform-specific path and prepend the bin directory if it exists; bin

is assumed to be locally built, which takes precedence over distributed files

File size: 2.2 KB
Line 
1# build the compiled fortran codes needed by GSAS-II
2
3BIN = bin
4LIBS = $(BIN)/pack_f.$(SUFFIX) $(BIN)/pyspg.$(SUFFIX) 
5LIBSwGSAS = $(BIN)/pypowder.$(SUFFIX)
6SYMLIB := $(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)
17GSASlib = /Users/toby/software/work/gsas/2009Aug31/libgsas.a
18COMPILER=--fcompiler=gnu95 --f90exec=/usr/local/bin/gfortran
19#PACKCOPTS=--f77flags="-fno-range-check -static-libgcc"
20SUFFIX=so
21F2PY=f2py
22MOVE=mv
23DEL=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
34ask: 
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
42all:: $(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
Note: See TracBrowser for help on using the repository browser.