summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Pawelczyk <przemoc@gmail.com>2016-01-09 00:44:23 +0100
committerPrzemyslaw Pawelczyk <przemoc@gmail.com>2016-01-09 00:44:23 +0100
commit58955dd621099cfc50a4efdea481bc1fa00e3df0 (patch)
treedb9c2bcaf73c87dcc0b388b3d16a76369911a220
parentf256eda0f284f727ab2553934d19fdc94f401fa5 (diff)
Makefile: Link with libbsd only on non-BSD platforms.
BSD platforms are not supported yet, though.
-rw-r--r--Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5c54f70..8d84b6c 100644
--- a/Makefile
+++ b/Makefile
@@ -19,12 +19,21 @@
#
PROJ_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
METASTORE_VER := $(shell "$(PROJ_DIR)"/version.sh)
+UNAME_S := $(shell uname -s)
CC = gcc
CFLAGS += -g -Wall -pedantic -std=c99 -D_FILE_OFFSET_BITS=64 -O2
CFLAGS += -DMETASTORE_VER="\"$(METASTORE_VER)\""
LDFLAGS +=
+
+ifeq ($(findstring BSD,$(UNAME_S)),)
+ifneq (DragonFly,$(UNAME_S))
+ifneq (Darwin,$(UNAME_S))
LIBS += -lbsd
+endif
+endif
+endif
+
INCLUDES =
INSTALL = install
INSTALL_PROGRAM = ${INSTALL} -c