radare2/libr/config.mk.tail
pancake 7e917da3db * Use $(shell) instead of ``
- Compile time should be a little faster now
* Fix warning in lang_perl
2011-05-15 04:31:08 +02:00

80 lines
2.1 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'`
#OK#LDFLAGS+=`echo $DEPS | awk '{gsub(/r_([^ ]*)/,"../&/lib&.a");gsub(/\/r_/,"\/");print}'`
LDFLAGS+=$(shell echo $DEPS | awk '{gsub(/r_([^ ]*)/,"../&/lib&.a");gsub(/\/r_/,"\/");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 `
#OK#LDFLAGS+=`echo "${BINDEPS} " | if [ -d ../../libr ]; then echo $BINDEPS | awk '{gsub(/r_([^ ]*)/,"../../libr/&/lib&.a");gsub(/\/r_/,"\/");print}' ; else awk '{gsub(/r_([^ ]*)/,"../../&/lib&.a");gsub(/\/r_/,"\/");print}'; fi`
LDFLAGS+=$(shell echo "${BINDEPS} " | if [ -d ../../libr ]; then echo $BINDEPS | awk '{gsub(/r_([^ ]*)/,"../../libr/&/lib&.a");gsub(/\/r_/,"\/");print}' ; else awk '{gsub(/r_([^ ]*)/,"../../&/lib&.a");gsub(/\/r_/,"\/");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}