NMakefile 1.89 KB
Newer Older
1
# ----------------------------------------------------------------------
Michael Sherman's avatar
Michael Sherman committed
2
3
# Microsoft NMakefile for OpenMM Preview Release 4 "hello world" examples.
# August 19, 2009.
4
5
6
7
8
# See https://simtk.org/home/openmm.
# ----------------------------------------------------------------------
# This assumes you have gcc compilers for whatever language you are
# using: cl for C++ and C, ifort for Fortran 95.
# 
Michael Sherman's avatar
Michael Sherman committed
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
OpenMM_INSTALL_DIR="C:/Program Files/OpenMM"
CC = cl
FC = ifort
CFLAGS = /MD /EHsc
FFLAGS = /MD

# Extra libraries required when ifort links with a C++ module.
FCPPLIBS = 

LIB_DIR=$(OpenMM_INSTALL_DIR)/lib
INCLUDE_DIR=$(OpenMM_INSTALL_DIR)/include
LIBS= OpenMM.lib

ALL_CPP_EXAMPLES = HelloArgon HelloSodiumChloride HelloEthane HelloWaterBox
ALL_C_EXAMPLES   = HelloArgonInC HelloSodiumChlorideInC
ALL_F95_EXAMPLES = HelloArgonInFortran HelloSodiumChlorideInFortran

ALL_PROGS = $(ALL_CPP_EXAMPLES) $(ALL_C_EXAMPLES) $(ALL_F95_EXAMPLES)

default: HelloArgon

all : cpp cc fortran

cpp c++: $(ALL_CPP_EXAMPLES)

cc: $(ALL_C_EXAMPLES)

fortran: $(ALL_F95_EXAMPLES)


Michael Sherman's avatar
Michael Sherman committed
40
# Treat all .cpp source files the same way.
41
42
43
HelloArgon HelloSodiumChloride HelloEthane HelloWaterBox: 
	$(CC) $(CFLAGS) -I$(INCLUDE_DIR) $*.cpp /link /libpath:$(LIB_DIR) $(LIBS) /out:$*.exe

Michael Sherman's avatar
Michael Sherman committed
44
45
HelloArgonInC: HelloArgonInC.c
	$(CC) $(CFLAGS) -I$(INCLUDE_DIR) $*.c /link /libpath:$(LIB_DIR) $(LIBS) /out:$*.exe
46

Michael Sherman's avatar
Michael Sherman committed
47
48
HelloSodiumChlorideInC: HelloSodiumChlorideInC.c
	$(CC) $(CFLAGS) -I$(INCLUDE_DIR) $*.c /link /libpath:$(LIB_DIR) $(LIBS) /out:$*.exe
49

Michael Sherman's avatar
Michael Sherman committed
50
51
HelloArgonInFortran: HelloArgonInFortran.f90 openmm.mod
	$(FC) $(FFLAGS) $*.f90 /link /libpath:$(LIB_DIR) $(LIBS) /out:$*.exe
52

Michael Sherman's avatar
Michael Sherman committed
53
54
HelloSodiumChlorideInFortran: HelloSodiumChlorideInFortran.f90 openmm.mod
	$(FC) $(FFLAGS) $*.f90 /link /libpath:$(LIB_DIR) $(LIBS) /out:$*.exe
55
56
57


# Build Fortran 95 Module file
Michael Sherman's avatar
Michael Sherman committed
58
59
openmm.mod:
	$(FC) -c $(FFLAGS) $(INCLUDE_DIR)/OpenMMFortranModule.f90
60
61
62
63

clean : 
	del *.mod *.obj *.exe *.pdb *.exe.manifest