Page MenuHomec4science

Makefile
No OneTemporary

File Metadata

Created
Thu, Nov 28, 23:12

Makefile

.DEFAULT_GOAL := all
ifeq ($(PLATFORM),)
$(error Please specify the env variable PLATFORM (mac, intel))
else
$(info *** Using $(PLATFORM).mk ***)
include $(PLATFORM).mk
endif
include .depend
PROG = espic2d
SRCS = main.f90 basic_mod.f90 newrun.f90 restart.f90 \
auxval.f90 inital.f90 resume.f90 start.f90 diagnose.f90 \
stepon.f90 tesend.f90 endrun.f90 chkrst.f90 mv2bk.f90 \
constants.f90 fields_mod.f90 beam_mod.f90 \
mpihelper_mod.f90 sort_mod.f90 distrib_mod.f90 \
maxwsrce_mod.f90 celldiag_mod.f90 geometry_mod.f90 \
random_mod.f90 neutcol_mod.f90 particletypes_mod.f90 \
splinebound_mod.f90 weighttypes_mod.f90
SRCS_C = extra.c
SRCS_F = random.f randother.f
MKDIR_P = mkdir -p
OUT_DIR = release
F90FLAGS += -I$(BSPLINES)/include -I$(FUTILS)/include \
-I$(MUMPS)/include -I../
CCFLAGS += -qopenmp -O3
LDFLAGS += -L$(BSPLINES)/lib -L$(FUTILS)/lib -L${HDF5}/lib -L${HDF5}/lib \
-L$(MUMPS)/lib -L$(PARMETIS)/lib
LIBS += -lbsplines -lpppack -lfutils -lhdf5_fortran -lhdf5 -lz $(MUMPSLIBS) -lpputils2
ifeq ($(USE_X),)
F90FLAGS+=-DUSE_X=0
else
$(info *** Using Xgrafix ***)
LIBS+=-lXGF -lXGC -lX11 -lSWIG
LDFLAGS+=-L/usr/local/xgrafix_1.2/src-double
F90FLAGS+=-DUSE_X=1
SRCS+=xg_mod.f90
endif
OBJS =${SRCS:.f90=.o} ${SRCS_F90:.F90=.o} ${SRCS_C:.c=.o} ${SRCS_F:.f=.o}
FPP =${SRCS:.f90=.i90}
OBJS_ =$(addprefix ./$(OUT_DIR)/,$(OBJS))
debug: F90FLAGS += $(DEBUGFLAGS)
debug: OUT_DIR=debug
debug: $(OUT_DIR) all
profile: F90FLAGS+=$(PROFILEFLAGS)
profile: LDFLAGS+= $(PROFILEFLAGS)
profile: OUT_DIR=profile
profile: $(OUT_DIR) all
$(info *** Using $(OBJS) ***)
.PHONY: directories clean debug profile
all: directories $(PROG)
$(PROG): $(OBJS)
$(F90) $(LDFLAGS) $(F90FLAGS) -o $@ $(OBJS_) $(LIBS)
tags:
etags *.f90
clean:
rm -f $(OBJS_) *.mod $(FPP)
distclean: clean
rm -f $(PROG) *~ a.out *.o TAGS
extra.o: extra.c
ifeq ($(USE_X),)
./$(OUT_DIR)/diagnose.o : diagnose.f90 fields_mod.o beam_mod.o basic_mod.o
else
./$(OUT_DIR)/diagnose.o : diagnose.f90 fields_mod.o xg_mod.o beam_mod.o basic_mod.o
endif
directories: ${OUT_DIR}
${OUT_DIR}:
${MKDIR_P} ${OUT_DIR}
#tinyspline.o: tinyspline.h parson.o
# $(CC) $(CCFLAGS) -c -o ./$(OUT_DIR)/$@ $<
#
#tinyspline_wrap.o: tinyspline.h tinyspline_wrap.c ./$(OUT_DIR)/tinyspline_wrap.o
# $(CC) $(CCFLAGS) -c -o $@ $<
#
#$(OUT_DIR)/tinyspline_wrap.o: tinyspline.h tinyspline_wrap.c
# $(CC) $(CCFLAGS) -c -o $@ $<
#
#$(OUT_DIR)/tinysplinef.o: tinyspline_wrap.o
# $(CC) $(CCFLAGS) -c -o $@ $<
.SUFFIXES: $(SUFFIXES) .f90 .c .f
./$(OUT_DIR)/%.o: %.f90
$(F90) $(F90FLAGS) -MD -c -o $@ $<
./$(OUT_DIR)/%.o: %.f
$(F90) $(F90FLAGS) -MD -c -o $@ $<
./$(OUT_DIR)/%.o: %.c
$(CC) $(CCFLAGS) -c -o $@ $<
%.o: %.c
$(CC) $(CCFLAGS) -c -o ./$(OUT_DIR)/$@ $<
%.o: %.f90
$(F90) $(F90FLAGS) -c -o ./$(OUT_DIR)/$@ $<
%.o: %.f
$(F90) $(F90FLAGS) -c -o ./$(OUT_DIR)/$@ $<
depend .depend .depend_rel .depend_deb :
makedepf90 *.[fF]90 > .depend

Event Timeline