Makerules 1.87 KB
Newer Older
1 2 3 4 5 6 7 8
CC       = gcc
MPICC    = gcc #mpicc
RM_F_V   = rm -f -v
PWD      = $(shell pwd)
export CC
export MPICC
export RM_F_V
export PWD
9 10 11

OBJS_DIR := $(PWD)/objs

12 13
SVN_REV := $(shell svnversion -n .)
DATE_REV := $(shell date '+%F %T')
14

15
NUM_CORES:=$(shell cat /proc/cpuinfo | grep processor | wc -l)
16

17
# Check for libraries and export cflags/linker variables
18
NETTLE_FOUND    := $(shell if pkg-config --exists nettle; then echo "1" ; else echo "0"; fi)
19
ifeq ($(NETTLE_FOUND), 1)
20
NETTLE_LIBS     := $(shell pkg-config --libs nettle)
knopp's avatar
knopp committed
21 22
#else 
#@echo "package nettle not installed"
23 24
endif

25
OPENSSL_FOUND   := $(shell if pkg-config --exists openssl; then echo "1" ; else echo "0"; fi)
26
ifeq ($(OPENSSL_FOUND), 1)
27
OPENSSL_LIBS    := $(shell pkg-config --libs openssl)
knopp's avatar
knopp committed
28 29
#else 
#@echo "package openssl not installed"
30 31
endif

32
PGM_FOUND       := $(shell if pkg-config --exists openpgm-5.1; then echo "1" ; else echo "0"; fi)
33
ifeq ($(PGM_FOUND), 1)
34 35
PGM_CFLAGS  := $(shell pkg-config --cflags openpgm-5.1)
PGM_LIBS    := $(shell pkg-config --libs openpgm-5.1)
knopp's avatar
knopp committed
36 37
#else 
#@echo "package pgm not installed"
38 39
endif

40
LIBXML2_FOUND   := $(shell if pkg-config --exists libxml-2.0; then echo "1" ; else echo "0"; fi)
41
ifeq ($(LIBXML2_FOUND), 1)
42 43
LIBXML2_CFLAGS  := $(shell pkg-config --cflags libxml-2.0)
LIBXML2_LIBS    := $(shell pkg-config --libs libxml-2.0)
knopp's avatar
knopp committed
44 45
#else 
#@echo "package libxml2 not installed"
46 47
endif

48
XPM_FOUND       := $(shell if pkg-config --exists xpm; then echo "1" ; else echo "0"; fi)
49
ifeq ($(XPM_FOUND), 1)
50
XPM_LIBS        := $(shell pkg-config --libs xpm)
knopp's avatar
knopp committed
51 52
#else 
#@echo "package xmp not installed"
53 54
endif

55
LIBBLAS_FOUND   := $(shell if [ -f /usr/include/cblas.h ]; then echo "1"; else echo "0"; fi)
56
ifeq ($(LIBBLAS_FOUND), 1)
57
LIBBLAS_LIBS    := -lblas
58
else
59
$(error "libblas not found, please install it")
60 61 62 63 64 65 66 67
endif

#Export common libs
LIBS =  \
    -lm                 \
    $(LIBBLAS_LIBS)     \
    $(LIBXML2_LIBS)     \
    $(XPM_LIBS)