Makefile 2.25 KB
Newer Older
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
#!/bin/sh
#
# This is a Gromacs 3.0 template makefile for your own utility programs.
#
# Copy this file to whatever directory you are using for your own
# software and add more targets like the template one below.
#
# If you are using gmake it is relatively straightforward to add
# an include based on environment variables (like previous Gromacs versions)
# to select compiler flags and stuff automatically, but below it is static:
#

SHELL=/bin/sh


# this is where executable and libraries will go - we recommend to 
# leave PREFIX to the default 
# PREFIX must match the PREFIX later used in the ../src/Makefile 
# 
# note that PREFIX/lib has to be in your LD_LIBRARYPATH to run the program. 
PREFIX	= ../../g_permute-1.1
EXEC_PREFIX = $(PREFIX)
BINDIR	= $(EXEC_PREFIX)/bin
LIBDIR	= $(EXEC_PREFIX)/lib
INCDIR = $(EXEC_PREFIX)/include

# pointer to your Gromacs installation - please adjust
28
29
30
31
GMXDIR	= /usr/local/gromacs/3.3/334-impi403-fftw331-gcc470
#/usr/local/gromacs/5.1/514-impi2017-fftw332-gcc540-cuda80
#/usr/local/gromacs/3.3/334-impi403-fftw331-gcc470
GMXLIB	= $(GMXDIR)/lib
32
33
34
35
36
37
38
39
40
41
GMXINC	= $(GMXDIR)/include/gromacs

# Source of the installation. No need to change this
SRCDIR	= ..

CC	= cc 
LDFLAGS	= -L$(GMXLIB) -lm
INCFLAGS	= -I$(SRCDIR)/include -I$(GMXINC)  
LDSOFLAGS	= -shared -Wl,-soname,
#for compilation on 64bit systems uncomment the following line
42
CFLAGS	= -O0 -fomit-frame-pointer -finline-functions -Wall -Wno-unused -fPIC -DPIC -funroll-all-loops -ggdb
43
#for compilation on 32bit systems uncomment the following line
44
#CFLAGS	= -O0 -fomit-frame-pointer -finline-functions -Wall -Wno-unused -malign-double -funroll-all-loops -ggdb
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

OBJS	= lap.o memory.o 
EXE	= liblap.so

tvar := $(shell if (test -h $(LIBDIR)/$(EXE).1);then echo 1;else echo 0;fi)

# pattern rule to compile object files from C files
# might not work with make programs other than GNU make
%.o : %.c Makefile
	$(CC) $(INCFLAGS) $(CFLAGS) -c $< -o $@

all: $(EXE)

install:	$(EXE)
	mkdir -p $(BINDIR) $(LIBDIR) $(INCDIR)
	cp $(EXE) $(LIBDIR)
	cp ../include/lap.h ../include/gnrl.h   $(INCDIR)
ifeq ($(tvar),0)
	ln -s $(LIBDIR)/$(EXE) $(LIBDIR)/$(EXE).1
endif

$(EXE): $(OBJS) Makefile
	$(CC) $(LDSOFLAGS)$(EXE).1 -o $(EXE) $(OBJS) $(LDFLAGS) $(CFLAGS)

.PHONY : clean
clean:
	rm -f $(OBJS) $(EXE)  $(LIBDIR)/$(EXE)