Page MenuHomec4science

Makefile_serial
No OneTemporary

File Metadata

Created
Tue, Jan 14, 19:10

Makefile_serial

#
# @file Makefile
#
# @brief Makefile for futils library examples
#
# @copyright
# Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
# SPC (Swiss Plasma Center)
#
# futils is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# futils is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# @authors
# (in alphabetical order)
# @author Emmanuel Lanti <emmanuel.lanti@epfl.ch>
# @author Trach-Minh Tran <trach-minh.tran@epfl.ch>
#
FC = ifort
ifeq ($(FC), ifort)
FFLAGS = -g -check bounds -traceback
else ifeq ($(FC), gfortran)
FFLAGS = -g -fcheck=bounds -fbacktrace
endif
HDF5_serial = $(HDF5_ROOT)
F90 = $(FC)
F90FLAGS = $(FFLAGS) -I../src/ -I${HDF5_serial}/include
CC = cc
CFLAGS = -O2 -I../src/mpiuni
LDFLAGS = -L. -L${HDF5_serial}/lib
LIBS = -lfutils -lhdf5_fortran -lhdf5 -lz -L../src -lmpiuni
SERIAL = ex1 ex2 ex3 ex4 ex7 ex8 ex9 ex11 ex12 ex13 ex14
.SUFFIXES:
.SUFFIXES: .o .c .f90
.f90.o:
$(F90) $(F90FLAGS) -c $<
all: $(SERIAL) ex5 ex6
lib:
make -C ../src -f Makefile_serial
touch lib
ex1: ex1.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex2: ex2.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex3: ex3.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex4: ex4.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex5: ex5.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex6: ex6.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex7: ex7.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex8: ex8.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex9: ex9.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex10: ex10.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex11: ex11.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex12: ex12.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex13: ex13.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex14: ex14.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
testmem: testmem.o cutils.o
$(F90) $(LDFLAGS) -o $@ $< cutils.o
test_s: $(SERIAL) ex5
@for x in $(SERIAL); do \
echo === Running $$x ===;\
./$$x ;\
echo ;\
done
@echo === Running ex5 ===;\
./ex5 < ex5.in ;\
echo ;\
ex1.o: lib
ex2.o: lib
ex3.o: lib
ex4.o: lib
ex5.o: lib
ex6.o: lib
ex7.o: lib
ex8.o: lib
ex9.o: lib
ex10.o: lib
ex11.o: lib
ex12.o: lib
ex13.o: lib
ex14.o: lib
clean:
make -C ../src -f Makefile_serial clean
rm -f *.o *~ a.out *.h5*
distclean: clean
make -C ../src -f Makefile_serial distclean
rm -f lib
rm -f $(SERIAL) ex5 ex6 *.mod TAGS

Event Timeline