radare2/shlr/sdb/config.mk

136 lines
2.4 KiB
Makefile
Raw Normal View History

PREFIX?=/usr
2015-10-16 10:54:44 +00:00
BINDIR=${PREFIX}/bin
LIBDIR=${PREFIX}/lib
DATADIR=${PREFIX}/share
INCDIR=${PREFIX}/include
VAPIDIR=${DATADIR}/vala/vapi/
MANDIR=${DATADIR}/man/man1
2016-07-29 12:49:57 +00:00
SDBVER=0.10.4
2015-05-24 21:30:13 +00:00
BUILD_MEMCACHE=0
2014-02-06 01:31:57 +00:00
INSTALL?=install
ifeq ($(INSTALL),cp)
INSTALL_DIR=mkdir -p
INSTALL_DATA=cp -f
INSTALL_PROGRAM=cp -f
INSTALL_SCRIPT=cp -f
INSTALL_MAN=cp -f
INSTALL_LIB=cp -f
else
2014-02-05 15:36:03 +00:00
INSTALL_DIR=$(INSTALL) -d
INSTALL_DATA=$(INSTALL) -m 644
INSTALL_PROGRAM=$(INSTALL) -m 755
INSTALL_SCRIPT=$(INSTALL) -m 755
INSTALL_MAN=$(INSTALL) -m 444
INSTALL_LIB=$(INSTALL) -c
2014-02-06 01:31:57 +00:00
endif
2014-02-05 15:36:03 +00:00
2016-01-20 15:28:07 +00:00
# link time optimization
#CFLAGS_STD=-std=gnu99 -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -flto -O2
CFLAGS_STD=-std=gnu99 -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L
#CFLAGS+=-Wno-initializer-overrides
2013-04-01 03:52:21 +00:00
CFLAGS+=${CFLAGS_STD}
2014-01-15 00:23:10 +00:00
# Hack to fix clang warnings
2014-03-26 03:16:03 +00:00
ifeq ($(CC),cc)
2014-01-15 00:23:10 +00:00
CFLAGS+=$(shell gcc -v 2>&1 | grep -q LLVM && echo '-Wno-initializer-overrides')
2014-03-26 03:16:03 +00:00
endif
CFLAGS+=-Wall
CFLAGS+=-Wsign-compare
2015-07-13 14:02:28 +00:00
# some old gcc doesnt support this
# CFLAGS+=-Wmissing-field-initializers
CFLAGS+=-O3
2011-09-14 10:37:26 +00:00
#CFLAGS+=-ggdb -g -Wall -O0
2016-01-20 15:28:07 +00:00
#CFLAGS+=-g
#LDFLAGS+=-g -flto
2013-04-30 23:43:35 +00:00
HAVE_VALA=#$(shell valac --version 2> /dev/null)
2012-09-17 09:18:20 +00:00
# This is hacky
2013-04-01 03:52:21 +00:00
HOST_CC?=gcc
RANLIB?=ranlib
OS?=$(shell uname)
OSTYPE?=$(shell uname -s)
2013-04-01 03:52:21 +00:00
ARCH?=$(shell uname -m)
AR?=ar
CC?=gcc
EXT_EXE=
EXT_SO=.so
ifneq (,$(findstring MINGW32,${OSTYPE}))
OS=w32
CC=gcc
else
2013-04-01 03:52:21 +00:00
ifeq (${OS},w32)
WCP?=i386-mingw32
CC=${WCP}-gcc
AR?=${WCP}-ar
endif
endif
2015-05-11 23:36:42 +00:00
#LDFLAGS_SHARED?=-fPIC -shared
LDFLAGS_SHARED?=-shared
ifeq (${OS},w32)
EXT_EXE=.exe
EXT_SO=.dll
2015-05-11 23:36:42 +00:00
LDFLAGS_SHARED=-shared
2013-04-01 03:52:21 +00:00
endif
# create .d files
2015-10-06 22:40:53 +00:00
ifeq (,$(findstring tcc,${CC}))
2013-04-01 03:52:21 +00:00
CFLAGS+=-MMD
2015-10-06 22:40:53 +00:00
else
CFLAGS+=-MD
endif
2013-04-01 03:52:21 +00:00
2015-05-11 23:36:42 +00:00
ifeq (${OS},w32)
OSTYPE=MINGW32
endif
2016-07-29 13:34:08 +00:00
ifneq (,$(findstring MINGW,${OSTYPE})$(findstring MSYS,${OSTYPE})$(findstring CYGWIN,${OSTYPE}))
2016-07-29 12:49:57 +00:00
EXT_SO=dll
SOVER=${EXT_SO}
else
EXT_SO=so
SOVER=${EXT_SO}.${SDBVER}
endif
2012-09-17 09:18:20 +00:00
ifeq (${OS},Darwin)
EXT_SO=dylib
SOVER=dylib
2012-09-17 09:18:20 +00:00
LDFLAGS+=-dynamic
LDFLAGS_SHARED+=-dynamiclib
2015-03-30 23:31:35 +00:00
ifeq (${ARCH},i386)
#CC+=-arch i386
CC+=-arch x86_64
2015-03-30 23:31:35 +00:00
endif
2012-09-17 09:18:20 +00:00
else
2015-03-30 23:31:35 +00:00
ifneq (,$(findstring CYGWIN,${OSTYPE}))
CFLAGS+=-D__CYGWIN__=1
LDFLAGS_SHARED?=-shared
2015-03-30 23:31:35 +00:00
else
ifneq (,$(findstring MINGW32,${OSTYPE}))
CFLAGS+=-DMINGW32=1
2015-03-30 23:31:35 +00:00
else
CFLAGS+=-fPIC
2013-04-01 03:52:21 +00:00
SOVERSION=0
LDFLAGS_SHARED?=-fPIC
2015-03-30 23:31:35 +00:00
endif
endif
2013-04-01 03:52:21 +00:00
LDFLAGS_SHARED+=-Wl,-soname,libsdb.so.$(SOVERSION)
endif
ifeq ($(MAKEFLAGS),s)
SILENT=1
else
SILENT=
2012-09-17 09:18:20 +00:00
endif
ifneq (${SDB_CONFIG},)
include ${SDB_CONFIG}
endif