2010-01-21 21:22:30 +01:00
|
|
|
# config.mk.tail
|
2010-01-15 13:02:54 +01:00
|
|
|
|
|
|
|
ifneq (${BINDEPS},)
|
|
|
|
include ../../../config-user.mk
|
|
|
|
include ../../../global.mk
|
|
|
|
include ../../../mk/${COMPILER}.mk
|
|
|
|
else
|
2010-01-15 01:32:28 +01:00
|
|
|
-include ../../config-user.mk
|
2010-01-15 13:02:54 +01:00
|
|
|
-include ../../global.mk
|
2010-01-15 01:32:28 +01:00
|
|
|
-include ../../mk/${COMPILER}.mk
|
2010-01-15 13:02:54 +01:00
|
|
|
|
2010-01-15 01:32:28 +01:00
|
|
|
-include ../../../config-user.mk
|
2010-01-15 13:02:54 +01:00
|
|
|
-include ../../../global.mk
|
2010-01-15 01:32:28 +01:00
|
|
|
-include ../../../mk/${COMPILER}.mk
|
2010-01-15 13:02:54 +01:00
|
|
|
endif
|
|
|
|
|
2010-01-15 01:32:28 +01:00
|
|
|
|
|
|
|
CFLAGS+=-DUSE_RIO=${USE_RIO}
|
|
|
|
CFLAGS+=${CFLAGS_APPEND}
|
2010-01-21 21:22:30 +01:00
|
|
|
|
|
|
|
ifeq ($(WITHPIC),1)
|
2010-01-15 01:32:28 +01:00
|
|
|
LDFLAGS+=$(subst r_,-lr_,$(DEPS))
|
|
|
|
LDFLAGS+=$(subst r_,-L../,$(DEPS))
|
|
|
|
LDFLAGS+=$(subst r_,-lr_,$(BINDEPS))
|
|
|
|
LDFLAGS+=$(subst r_,-L../../,$(BINDEPS))
|
2010-01-21 21:22:30 +01:00
|
|
|
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} " | perl -ne 's,r_([^ ]*),../../$$1/libr_$$1.a,g; print'`
|
|
|
|
endif
|
|
|
|
endif
|
2010-01-15 01:32:28 +01:00
|
|
|
|
|
|
|
# Compiler: see mk/gcc.mk
|
|
|
|
# CC CFLAGS CC_LIB CC_AR LINK
|
|
|
|
|
|
|
|
# Debug
|
|
|
|
CFLAGS+=-g -Wall
|
|
|
|
|
2010-05-28 02:44:51 +02:00
|
|
|
# libgmp
|
|
|
|
ifeq (${HAVE_LIB_GMP},1)
|
|
|
|
CFLAGS+=-DHAVE_LIB_GMP=1
|
|
|
|
BN_LIBS=-lgmp
|
|
|
|
endif
|
|
|
|
|
2010-01-15 01:32:28 +01:00
|
|
|
# XXX do it in configure stage
|
|
|
|
OSTYPE?=gnulinux
|
|
|
|
# Output
|
|
|
|
ifeq (${OSTYPE},windows)
|
2010-01-15 17:02:04 +01:00
|
|
|
CFLAGS+=-D__WINDOWS__=1
|
2010-01-15 01:32:28 +01:00
|
|
|
EXT_AR=lib
|
|
|
|
EXT_SO=dll
|
|
|
|
EXT_EXE=.exe
|
2010-01-21 21:22:30 +01:00
|
|
|
TH_LIBS=
|
2010-01-15 01:32:28 +01:00
|
|
|
endif
|
|
|
|
ifeq (${OSTYPE},gnulinux)
|
2010-01-15 17:02:04 +01:00
|
|
|
CFLAGS+=-D__UNIX__=1
|
2010-01-15 01:32:28 +01:00
|
|
|
EXT_AR=a
|
|
|
|
EXT_SO=so
|
|
|
|
EXT_EXE=
|
2010-01-21 21:22:30 +01:00
|
|
|
TH_LIBS=-lpthread
|
2010-01-15 01:32:28 +01:00
|
|
|
endif
|
2010-02-21 20:49:39 +01:00
|
|
|
ifeq (${OSTYPE},darwin)
|
2010-01-15 17:02:04 +01:00
|
|
|
CFLAGS+=-D__UNIX__=1
|
2010-01-15 01:32:28 +01:00
|
|
|
EXT_AR=a
|
|
|
|
EXT_SO=dylib
|
|
|
|
EXT_EXE=
|
2010-01-21 21:22:30 +01:00
|
|
|
TH_LIBS=-lpthread
|
2010-01-15 01:32:28 +01:00
|
|
|
endif
|
|
|
|
|
2010-07-03 03:35:26 +02:00
|
|
|
ifeq (${EXT_SO},)
|
|
|
|
all:
|
|
|
|
@echo Unidentified platform; exit 1
|
|
|
|
endif
|
|
|
|
|
2010-01-15 01:32:28 +01:00
|
|
|
LIB=lib${NAME}
|
|
|
|
LIBAR=${LIB}.${EXT_AR}
|
|
|
|
LIBSO=${LIB}.${EXT_SO}
|