-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile.omdev.mingw
37 lines (31 loc) · 1.22 KB
/
Makefile.omdev.mingw
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
ifeq ($(OMBUILDDIR),)
$(error OMBUILDDIR variable is not set.)
endif
ifndef OMDEV
$(error Environment variable OMDEV not set!)
endif
#ifndef OMDEV_MSYS
#$(error Environment variable OMDEV_MSYS not set!)
#endif
ifndef MSYSTEM_PREFIX
$(error Environment variable MSYSTEM_PREFIX not set. Is this a msys2 shell?)
endif
OMDEV = $(shell cygpath $$OMDEV)
OMDEV_MSYS = $(shell cygpath $$OMDEV/tools/msys)
MSYSTEM_PREFIX = $(shell cygpath $$MSYSTEM_PREFIX)
OM_MSYS_ENV_DIR = $(MSYSTEM_PREFIX)
FORTRANDIR = fortran_interface
all: install
install: build
mkdir -p $(OMBUILDDIR)/share/OMSens
cp -rfp . $(OMBUILDDIR)/share/OMSens
build:
(cd $(FORTRANDIR) && $(OM_MSYS_ENV_DIR)/bin/gfortran.exe -fPIC -c Rutf.for Rut.for Curvif.for)
(cd $(FORTRANDIR) && f2py -c -I. Curvif.o Rutf.o Rut.o -m curvif_simplified curvif_simplified.pyf Curvif_simplified.f90 --compiler=mingw32 --fcompiler=gfortran -DNPY_OS_MINGW)
cp -puf $(OM_MSYS_ENV_DIR)/bin/libgcc_s_*.dll $(FORTRANDIR)
cp -puf $(OM_MSYS_ENV_DIR)/bin/libgfortran*.dll $(FORTRANDIR)
cp -puf $(OM_MSYS_ENV_DIR)/bin/libquadmath*.dll $(FORTRANDIR)
cp -puf $(OM_MSYS_ENV_DIR)/bin/libwinpthread*.dll $(FORTRANDIR)
clean:
(cd $(FORTRANDIR) && rm -f *.o *.dll)
rm -rf $(OMBUILDDIR)/share/OMSens