radare2/libr/rules.mk

122 lines
2.9 KiB
Makefile
Raw Normal View History

# TODO: use $VPATH here?
-include config.mk
-include ../config.mk
-include ../../config.mk
#-include ../global.mk
#-include ../../global.mk
#-------------------------------------#
# Rules for libraries
ifeq (${BINDEPS},)
ifneq ($(NAME),)
CFLAGS+=-I../include
real_all all: ${LIBSO} ${LIBAR} ${EXTRA_TARGETS}
@-if [ -e t/Makefile ]; then (cd t && ${MAKE} all) ; fi
@-if [ -e p/Makefile ]; then (cd p && ${MAKE} all) ; fi
@true
SRC=$(subst .o,.c,$(OBJ))
ifeq ($(WITHPIC),1)
${LIBSO}: ${OBJ}
@for a in ${OBJ} ${SRC}; do \
do=0 ; [ ! -e ${LIBSO} ] && do=1 ; \
test $$a -nt ${LIBSO} && do=1 ; \
if [ $$do = 1 ]; then \
echo "${CC_LIB} ${OBJ} ${LDFLAGS} ${LINK}" ; \
${CC_LIB} ${OBJ} ${LDFLAGS} ${LINK} ; \
if [ -f "../stripsyms.sh" ]; then sh ../stripsyms.sh ${LIBSO} ${NAME} ; fi ; \
break ; \
fi ; done
else
${LIBSO}:
endif
${LIBAR}: ${OBJ}
${CC_AR} ${OBJ}
pkgcfg:
@echo Generating pkgconfig stub for ${NAME}
@echo 'prefix=@PREFIX@' > ../../pkgcfg/${NAME}.pc.acr
@echo 'exec_prefix=$${prefix}' >> ../../pkgcfg/${NAME}.pc.acr
@echo 'libdir=$${exec_prefix}/lib' >> ../../pkgcfg/${NAME}.pc.acr
@echo 'includedir=$${prefix}/include' >> ../../pkgcfg/${NAME}.pc.acr
@echo >> ../../pkgcfg/${NAME}.pc.acr
@echo 'Name: ${NAME}' >> ../../pkgcfg/${NAME}.pc.acr
@echo 'Description: radare foundation libraries' >> ../../pkgcfg/${NAME}.pc.acr
@echo 'Version: ${VERSION}' >> ../../pkgcfg/${NAME}.pc.acr
@echo 'Requires:' >> ../../pkgcfg/${NAME}.pc.acr
@if [ "${NAME}" = "libr" ]; then NAME=''; else NAME=${NAME}; fi ;\
echo 'Libs: -L$${libdir} '`echo $${NAME} ${DEPS}|sed -e s,r_,-lr_,g` >> ../../pkgcfg/${NAME}.pc.acr
@echo 'Cflags: -I$${includedir}/libr' >> ../../pkgcfg/${NAME}.pc.acr
install:
cd .. && ${MAKE} install
deinstall uninstall:
cd .. && ${MAKE} uninstall
clean: ${EXTRA_CLEAN}
-rm -f *.${EXT_EXE} *.${EXT_SO} *.${EXT_AR}
-rm -f ${LIBSO} ${LIBAR} ${OBJ} ${BIN} *.exe a.out
@if [ -e t/Makefile ]; then (cd t && ${MAKE} clean) ; fi
@if [ -e p/Makefile ]; then (cd p && ${MAKE} clean) ; fi
@true
* Initial import of the 'configure-plugins' script - accepts --static and --shared to setup which plugins you want to build statically in the library or dynamically - normalize .mk and plugin file names to adopt a single standard - WARNING: huge commit * Added 'mk/sloc.mk' with 'sloc' target to count lines with sloccount everywhere (yeah!) --HG-- rename : libr/asm/p/x86bea.mk => libr/asm/p/x86_bea.mk rename : libr/asm/p/x86nasm.mk => libr/asm/p/x86_nasm.mk rename : libr/asm/p/x86olly.mk => libr/asm/p/x86_olly.mk rename : libr/config.h => libr/config.h.head rename : libr/config.mk => libr/config.mk.head rename : libr/debug/p/dbg_gdb.c => libr/debug/p/debug_gdb.c rename : libr/debug/p/dbg_ptrace.c => libr/debug/p/debug_ptrace.c rename : libr/debug/p/dbg_libgdbwrap/Makefile => libr/debug/p/libgdbwrap/Makefile rename : libr/debug/p/dbg_libgdbwrap/README => libr/debug/p/libgdbwrap/README rename : libr/debug/p/dbg_libgdbwrap/client.c => libr/debug/p/libgdbwrap/client.c rename : libr/debug/p/dbg_libgdbwrap/gdbwrapper.c => libr/debug/p/libgdbwrap/gdbwrapper.c rename : libr/debug/p/dbg_libgdbwrap/include/gdbwrapper-internals.h => libr/debug/p/libgdbwrap/include/gdbwrapper-internals.h rename : libr/debug/p/dbg_libgdbwrap/include/gdbwrapper-stddef.h => libr/debug/p/libgdbwrap/include/gdbwrapper-stddef.h rename : libr/debug/p/dbg_libgdbwrap/include/gdbwrapper.h => libr/debug/p/libgdbwrap/include/gdbwrapper.h rename : libr/debug/p/dbg_libgdbwrap/include/libaspect.h => libr/debug/p/libgdbwrap/include/libaspect.h rename : libr/debug/p/dbg_libgdbwrap/include/libe2dbg.h => libr/debug/p/libgdbwrap/include/libe2dbg.h rename : libr/debug/p/dbg_libgdbwrap/include/revm.h => libr/debug/p/libgdbwrap/include/revm.h rename : libr/debug/p/dbg_libgdbwrap/interface.c => libr/debug/p/libgdbwrap/interface.c rename : libr/io/p/dbg.mk => libr/io/p/debug.mk rename : libr/io/p/io_dbg.c => libr/io/p/io_debug.c
2010-01-13 22:42:49 +00:00
sloc:
${MAKE} -C ../.. sloc SLOCDIR=libr/$$(echo ${NAME} | sed -e s,r_,,)
.PHONY: all sloc install pkgcfg clean deinstall uninstall
else
# somewhere else?
endif
else
#-------------------------------------#
# Rules for test programs
# XXX can this be removed?
#include ../../../config-user.mk
#include ../../../mk/${COMPILER}.mk
CFLAGS+=-I../../include -DVERSION=\"${VERSION}\"
2010-01-15 12:02:54 +00:00
ifneq ($(BIN),)
all: ${BIN}${EXT_EXE}
${BIN}${EXT_EXE}: ${OBJ}
${CC} ${OBJ} ${LDFLAGS} ${LIBS} -o ${BIN}${EXT_EXE}
2010-01-15 12:02:54 +00:00
endif
# Dummy myclean rule that can be overriden by the t/ Makefile
# TODO: move to config.mk ? it must be a precondition
2009-03-06 00:00:41 +00:00
myclean:
clean: myclean
-rm -f ${OBJ} ${BIN}
install:
cd ../.. && ${MAKE} install
.PHONY: all clean myclean
endif
#-------------------------------
#if RUNTIME_DEBUG
CFLAGS+=-DR_RTDEBUG
#endif
// TODO: Not working
#if STATIC_DEBUG
#CFLAGS+=-DR_DEBUG
#endif