2009-02-05 21:08:46 +00:00
|
|
|
CFLAGS+=-DUSE_RIO=${USE_RIO}
|
|
|
|
CFLAGS+=${CFLAGS_APPEND}
|
2009-02-06 12:17:51 +00:00
|
|
|
LDFLAGS+=$(subst r_,-lr_,$(DEPS))
|
|
|
|
LDFLAGS+=$(subst r_,-L../,$(DEPS))
|
|
|
|
|
|
|
|
LDFLAGS+=$(subst r_,-lr_,$(BINDEPS))
|
|
|
|
LDFLAGS+=$(subst r_,-L../../,$(BINDEPS))
|
|
|
|
BOO=-Wl,-R../../
|
|
|
|
LDFLAGS+=$(subst r_,${BOO},$(BINDEPS))
|
2009-02-05 21:08:46 +00:00
|
|
|
|
|
|
|
# Compiler
|
2009-03-22 04:37:46 +00:00
|
|
|
#CC?=gcc
|
|
|
|
#CFLAGS+=-fPIC
|
|
|
|
#CC_LIB=${CC} -shared -o ${LIBSO}
|
|
|
|
#CC_AR=ar -r ${LIBAR}
|
|
|
|
#LINK?=
|
2009-02-05 21:08:46 +00:00
|
|
|
|
|
|
|
# Debug
|
|
|
|
CFLAGS+=-g -Wall
|
|
|
|
|
2009-03-10 21:58:00 +00:00
|
|
|
# XXX hardcoded XXX #
|
|
|
|
OSTYPE=gnulinux
|
2009-02-05 21:08:46 +00:00
|
|
|
# Output
|
2009-03-10 21:58:00 +00:00
|
|
|
ifeq (${OSTYPE},windows)
|
|
|
|
EXT_AR=lib
|
|
|
|
EXT_SO=dll
|
|
|
|
endif
|
|
|
|
ifeq (${OSTYPE},gnulinux)
|
2009-02-05 21:08:46 +00:00
|
|
|
EXT_AR=a
|
|
|
|
EXT_SO=so
|
2009-03-10 21:58:00 +00:00
|
|
|
endif
|
|
|
|
ifeq (${OSTYPE},osx)
|
|
|
|
EXT_AR=a
|
|
|
|
EXT_SO=dylib
|
|
|
|
endif
|
|
|
|
|
2009-02-05 21:08:46 +00:00
|
|
|
LIB=lib${NAME}
|
|
|
|
LIBAR=${LIB}.${EXT_AR}
|
|
|
|
LIBSO=${LIB}.${EXT_SO}
|
2009-03-10 21:58:00 +00:00
|
|
|
|
|
|
|
#-------------------------------------#
|
2009-02-05 21:08:46 +00:00
|
|
|
# Rules
|
2009-02-06 17:22:27 +00:00
|
|
|
ifeq (${BINDEPS},)
|
2009-02-06 12:17:51 +00:00
|
|
|
ifneq ($(NAME),)
|
2009-03-10 21:58:00 +00:00
|
|
|
include ../../config.mk
|
2009-03-22 04:37:46 +00:00
|
|
|
include ../../mk/${COMPILER}.mk
|
2009-03-10 21:58:00 +00:00
|
|
|
|
2009-02-06 17:22:27 +00:00
|
|
|
CFLAGS+=-I../include
|
2009-03-31 00:50:02 +00:00
|
|
|
real_all all: ${LIBSO} ${EXTRA_TARGETS}
|
2009-02-06 12:17:51 +00:00
|
|
|
@-if [ -e t/Makefile ]; then (cd t && ${MAKE} all) ; fi
|
|
|
|
@-if [ -e p/Makefile ]; then (cd p && ${MAKE} all) ; fi
|
|
|
|
@true
|
|
|
|
|
|
|
|
${LIBSO}: ${OBJ}
|
2009-02-05 21:08:46 +00:00
|
|
|
${CC_LIB} ${LDFLAGS} ${LINK} ${OBJ}
|
2009-02-06 12:17:51 +00:00
|
|
|
@if [ -f "../stripsyms.sh" ]; then sh ../stripsyms.sh ${LIBSO} ${NAME} ; fi
|
2009-02-05 21:08:46 +00:00
|
|
|
|
2009-02-06 12:17:51 +00:00
|
|
|
${LIBAR}: ${OBJ}
|
2009-02-05 21:08:46 +00:00
|
|
|
${CC_AR} ${OBJ}
|
|
|
|
|
2009-02-09 00:54:09 +00:00
|
|
|
install:
|
|
|
|
cd .. && ${MAKE} install
|
|
|
|
|
2009-03-31 00:50:02 +00:00
|
|
|
clean: ${EXTRA_CLEAN}
|
2009-02-06 12:17:51 +00:00
|
|
|
-rm -f ${LIBSO} ${LIBAR} ${OBJ} ${BIN} *.so a.out *.a *.exe
|
|
|
|
@if [ -e t/Makefile ]; then (cd t && ${MAKE} clean) ; fi
|
|
|
|
@if [ -e p/Makefile ]; then (cd p && ${MAKE} clean) ; fi
|
|
|
|
@true
|
2009-02-05 21:08:46 +00:00
|
|
|
.PHONY: all clean ${LIBSO} ${LIBAR}
|
2009-02-06 12:17:51 +00:00
|
|
|
endif
|
2009-02-06 17:22:27 +00:00
|
|
|
else
|
2009-03-10 21:58:00 +00:00
|
|
|
|
2009-02-06 17:22:27 +00:00
|
|
|
include ../../config.mk
|
2009-03-22 04:37:46 +00:00
|
|
|
include ../../../mk/${COMPILER}.mk
|
2009-02-06 17:22:27 +00:00
|
|
|
CFLAGS+=-I../../include
|
2009-03-10 21:58:00 +00:00
|
|
|
|
2009-02-06 17:22:27 +00:00
|
|
|
all: ${BIN}
|
|
|
|
@true
|
|
|
|
|
|
|
|
${BIN}: ${OBJ}
|
|
|
|
${CC} ${LDFLAGS} ${OBJ} -o ${BIN} ${LIBS}
|
|
|
|
|
2009-03-06 00:00:41 +00:00
|
|
|
#Dummy myclean rule that can be overriden by the t/ Makefile
|
|
|
|
myclean:
|
|
|
|
|
|
|
|
clean: myclean
|
2009-02-06 17:22:27 +00:00
|
|
|
-rm -f ${OBJ} ${BIN}
|
|
|
|
|
|
|
|
.PHONY: all clean ${BIN}
|
|
|
|
endif
|
2009-03-10 21:58:00 +00:00
|
|
|
|
|
|
|
#-------------------------------
|
2009-03-31 00:50:02 +00:00
|
|
|
|
|
|
|
#if RUNTIME_DEBUG
|
|
|
|
CFLAGS+=-DR_RTDEBUG
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if STATIC_DEBUG
|
|
|
|
CFLAGS+=-DR_DEBUG
|
|
|
|
#endif
|
|
|
|
|