radare2/libr/config.mk.tail
pancake/n900 9580907a35 * Fix static and nonpic build with no gmp
* Needs to rerun configur-plugins
2010-11-10 10:45:47 +01:00

76 lines
1.5 KiB
Plaintext

# config.mk.tail
-include ../../config-user.mk
-include ../../global.mk
-include ../../mk/${COMPILER}.mk
-include ../../../config-user.mk
-include ../../../global.mk
-include ../../../mk/${COMPILER}.mk
CFLAGS+=-DUSE_RIO=${USE_RIO}
CFLAGS+=${CFLAGS_APPEND}
ifeq ($(WITHPIC),1)
LDFLAGS+=$(subst r_,-lr_,$(DEPS))
LDFLAGS+=$(subst r_,-L../,$(DEPS))
LDFLAGS+=$(subst r_,-lr_,$(BINDEPS))
LDFLAGS+=$(subst r_,-L../../,$(BINDEPS))
CFLAGS+=${PIC_CFLAGS}
LDFLAGS+=${PIC_CFLAGS}
else
# TODO: is there somebody brave enought to replace this perl oneliner?
ifneq ($(DEPS),)
LDFLAGS+=`echo "${DEPS} " | perl -ne 's,r_([^ ]*),../$$1/libr_$$1.a,g; print'`
endif
ifneq ($(BINDEPS),)
LDFLAGS+=`echo "${BINDEPS} " | if [ -d ../../libr ]; then perl -ne 's,r_([^ ]*),../../libr/$$1/libr_$$1.a,g; print' ; else perl -ne 's,r_([^ ]*),../../$$1/libr_$$1.a,g; print' ; fi `
endif
endif
# Compiler: see mk/gcc.mk
# CC CFLAGS CC_LIB CC_AR LINK
# Debug
CFLAGS+=-g -Wall
# libgmp
ifeq (${HAVE_LIB_GMP},1)
CFLAGS+=-DHAVE_LIB_GMP=1
BN_LIBS=-lgmp
endif
# XXX do it in configure stage
OSTYPE?=gnulinux
# Output
ifeq (${OSTYPE},windows)
CFLAGS+=-D__WINDOWS__=1
EXT_AR=lib
EXT_SO=dll
EXT_EXE=.exe
TH_LIBS=
endif
ifeq (${OSTYPE},gnulinux)
CFLAGS+=-D__UNIX__=1
EXT_AR=a
EXT_SO=so
EXT_EXE=
TH_LIBS=-lpthread
endif
ifeq (${OSTYPE},darwin)
CFLAGS+=-D__UNIX__=1
EXT_AR=a
EXT_SO=dylib
EXT_EXE=
TH_LIBS=-lpthread
endif
ifeq (${EXT_SO},)
all:
@echo Unidentified platform; exit 1
endif
LIB=lib${NAME}
LIBAR=${LIB}.${EXT_AR}
LIBSO=${LIB}.${EXT_SO}