Makerules 2.25 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)

OBJS_DIR := $(PWD)/objs

SVN_REV = $(shell svnversion -n .)
9
DATE_REV = $(shell date '+%F %T')
10 11 12

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

13
# Check for libraries and export cflags/linker variables
14
NETTLE_FOUND    = $(shell if pkg-config --exists nettle; then echo "1" ; else echo "0"; fi)
15 16 17 18
ifeq ($(NETTLE_FOUND), 1)
NETTLE_LIBS     = `pkg-config --libs nettle`
endif

19
OPENSSL_FOUND   = $(shell if pkg-config --exists openssl; then echo "1" ; else echo "0"; fi)
20 21 22 23
ifeq ($(OPENSSL_FOUND), 1)
OPENSSL_LIBS     = `pkg-config --libs openssl`
endif

24
PGM_FOUND       = $(shell if pkg-config --exists openpgm-5.1; then echo "1" ; else echo "0"; fi)
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
ifeq ($(PGM_FOUND), 1)
PGM_CFLAGS  = `pkg-config --cflags openpgm-5.1`
PGM_LIBS    = `pkg-config --libs openpgm-5.1`
endif

LIBXML2_FOUND   = $(shell if pkg-config --exists libxml-2.0; then echo "1" ; else echo "0"; fi)
ifeq ($(LIBXML2_FOUND), 1)
LIBXML2_CFLAGS  = `pkg-config --cflags libxml-2.0`
LIBXML2_LIBS    = `pkg-config --libs libxml-2.0`
endif

XPM_FOUND       = $(shell if pkg-config --exists xpm; then echo "1" ; else echo "0"; fi)
ifeq ($(XPM_FOUND), 1)
XPM_LIBS        = `pkg-config --libs xpm`
endif

LIBBLAS_FOUND   = $(shell if [ -f /usr/include/cblas.h ]; then echo "1"; else echo "0"; fi)
ifeq ($(LIBBLAS_FOUND), 1)
LIBBLAS_LIBS    = -lblas
else
echo "libblas not found, please install it"
endif

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

#Export common cflags (between softmodem and oaisim)
COMMON_CFLAGS =                 \
    -Wall                       \
    -fno-strict-aliasing        \
    -g                          \
    -ggdb                       \
61 62 63
    -O2

COMMON_UTILS_DIR    = $(OPENAIR_HOME)/common/utils
64
UE_NAS_DIR          = $(OPENAIR_HOME)/openair-cn/NAS
65 66
S1AP_DIR            = $(OPENAIR_HOME)/openair-cn/S1AP
SCTP_DIR            = $(OPENAIR_HOME)/openair-cn/SCTP
67 68

UE_NAS_OBJ_DIR      = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(UE_NAS_DIR))
69 70 71
S1AP_OBJ_DIR        = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(S1AP_DIR))
SCTP_OBJ_DIR        = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(SCTP_DIR))

linhuang's avatar
linhuang committed
72
export COMMON_UTILS_DIR
73 74 75
export UE_NAS_DIR
export S1AP_DIR
export SCTP_DIR