# EtherPix library
#
# Copyright 2010-2017 Stefan Schuermans <stefan schuermans info>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
LIBTARGET := libetherpix
VER_MAJ := 1
VER_MIN := 2
VER_REV := 0
VERSION := $(VER_MAJ).$(VER_MIN).$(VER_REV)
SRCS := $(wildcard src/*.c)
EX_SRCS := $(wildcard examples/src/*.c)
CFLAGS := -Wall -Wextra -Werror -O3
DEFINES := -DETP_VER_MAJ=$(VER_MAJ) -DETP_VER_MIN=$(VER_MIN) \
-DETP_VER_REV=$(VER_REV)
INCLUDES := -Iinclude
SH_LDFLAGS :=
SH_LIBS :=
EX_LDFLAGS := -Llib
EX_LIBS := -letherpix -lm
STOW_DIR := /usr/local/stow
DEF_PREFIX := /usr/local
OS_RAW := $(shell uname -s)
ifeq ($(OS_RAW),Linux)
OS := linux
CC := gcc
AR := ar
RANLIB := ranlib
LEXT := so
LEXTSUF := .$(VERSION)
BSUF :=
INSTALL := install
CFLAGS += -fPIC
SH_LDFLAGS += -shared -Wl,-soname,$(LIBTARGET).so.$(VER_MAJ)
EX_LDFLAGS += -Wl,-rpath,\$$ORIGIN/../../lib
EX_LIBS += -lpthread