-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (43 loc) · 2.05 KB
/
Makefile
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
FORTCOMP=gfortran
ifeq ("$HOSTNAME", "darter"*)
FORTCOMP=ftn
endif
CC=gcc
CXX=g++
# Fortran 90 compilation. This will vary depending on compiler.
# The -J Src option puts the mod files in the Src directory
Src/%.o: SrcCpp/%.c; $(CC) -ISrcCpp -DUSE_HDF -c -g -Wall -fPIC $< -o $@
Src/%.o: SrcCpp/%.cpp; $(CXX) -ISrcCpp -DUSE_HDF -c -g -Wall -fPIC $< -o $@
Src/%.o: Src/%.f90; $(FORTCOMP) -DUSE_HDF -c -g -Wall -fPIC -ffree-line-length-0 $< -o $@ -J Src
# Note: ignroed for now; instead don't load the ILL nexus files need to modify Src/CFML_ILL_Data_Nexus.f90
# Copyied from SrcCpp/CMakeLists.txt
CDEPS=Src/NexusToCFML.o Src/DataNexusLib.o Src/blosc_filter.o Src/HeaderBloc.o Src/IntegerBloc.o Src/FloatBloc.o Src/DataBloc.o Src/ArgumentHandler.o
# Editting is currently happening on a different machine from compiling and running,
# hence the "copy" target
all: libcrysfml.so
# Dependencies are generated by ./f90_deps.py with the make deps target below
-include Makefile.deps
# Sources are listed in the Makefile.deps file
OBJECTS=$(SOURCES:.f90=.o)
# Override certain modules which are different on different architectures with the
# architecture specific version. The last file on the ./f90_deps.py command line
# will be the one included in Sources. The alternative would be to list all the
# files that are included (tedious) or excluded (better), but the technique below
# is simpler to specify and implement.
OVERRIDE=Src/CFML_ILL_Instrm_Data.f90 Src/CFML_GlobalDeps_Linux.f90 Src/CFML_IO_Mess.f90
# Copy program over from sparkle
copy:
# The -p option should preserve the timestamp
scp -pq sparkle:~/Pycrysfml/*.py .
scp -pq sparkle:~/crysfml/Src/*.f90 Src
# Build the shared object file from the list of objects
libcrysfml.so: $(OBJECTS) Makefile
$(FORTCOMP) -o libcrysfml.so -g -shared $(OBJECTS) #-lNeXusCPP
# Generate dependencies. This needs to be rerun whenever a new module is added
# or a Use statement is updated.
deps:
./build_tools/f90_deps.py Src/*.f90 $(OVERRIDE) > Makefile.deps
clean:
rm libcrysfml.so Src/*.o
install:
cp libcrysfml.so ./Src/crysfml.so