radare2/binr/rules.mk

85 lines
1.7 KiB
Makefile
Raw Normal View History

BINR_PROGRAM=1
include ../../libr/config.mk
2015-02-22 21:01:46 +00:00
include ../../shlr/zip/deps.mk
ifneq ($(OSTYPE),windows)
2015-09-25 13:53:29 +00:00
CFLAGS+=-pie
endif
2015-09-24 01:36:06 +00:00
CFLAGS+=-I$(LTOP)/include
ifeq (${COMPILER},emscripten)
EXT_EXE=.js
endif
2012-10-29 12:15:18 +00:00
ifeq ($(USE_RPATH),1)
LDFLAGS+=-Wl,-rpath "${PREFIX}/lib"
2012-10-29 12:15:18 +00:00
endif
OBJ+=${BIN}.o
BEXE=${BIN}${EXT_EXE}
ifeq ($(WITHNONPIC),1)
2013-09-06 23:35:11 +00:00
## LDFLAGS+=$(addsuffix /lib${BINDEPS}.a,$(addprefix ../../libr/,$(subst r_,,$(BINDEPS))))
LDFLAGS+=$(shell for a in ${BINDEPS} ; do b=`echo $$a |sed -e s,r_,,g`; echo ../../libr/$$b/lib$$a.a ; done )
2013-08-26 00:43:15 +00:00
LDFLAGS+=../../shlr/sdb/src/libsdb.a
2013-12-14 11:37:35 +00:00
LDFLAGS+=../../shlr/grub/libgrubfs.a
LDFLAGS+=../../shlr/gdb/lib/libgdbr.a
2014-08-31 16:09:25 +00:00
LDFLAGS+=../../shlr/wind/libr_wind.a
LDFLAGS+=../../shlr/capstone/libcapstone.a
2014-06-25 02:11:43 +00:00
LDFLAGS+=../../shlr/java/libr_java.a
2015-01-24 22:17:55 +00:00
ifneq (${ANDROID},1)
ifneq (${OSTYPE},linux)
LDFLAGS+=-lpthread
endif
2015-01-24 22:17:55 +00:00
endif
2013-06-05 21:58:31 +00:00
ifneq (${OSTYPE},haiku)
LDFLAGS+=-lm
endif
2013-06-05 21:58:31 +00:00
endif
2013-02-06 10:47:31 +00:00
LDFLAGS+=${DL_LIBS}
2013-11-15 00:30:11 +00:00
LDFLAGS+=${LINK}
2014-04-18 23:23:04 +00:00
REAL_LDFLAGS=$(subst -shared,,$(LDFLAGS))
2014-03-01 23:47:05 +00:00
ifeq ($(ISLIB),1)
BEXE=$(BIN).$(EXT_SO)
2014-04-18 23:23:04 +00:00
REAL_LDFLAGS+=-shared
2014-03-01 23:47:05 +00:00
endif
#--------------------#
# Rules for programs #
#--------------------#
2014-04-18 23:23:04 +00:00
# For some reason w32 builds contain -shared in LDFLAGS. boo!
ifneq ($(BIN)$(BINS),)
all: ${BEXE} ${BINS}
${BINS}: ${OBJS}
ifneq ($(SILENT),)
@echo CC $@
endif
${CC} ${CFLAGS} $@.c ${OBJS} ${REAL_LDFLAGS} -o $@
${BEXE}: ${OBJ} ${SHARED_OBJ}
ifneq ($(SILENT),)
@echo LD $@
endif
${CC} ${CFLAGS} $+ -L.. -o $@ $(REAL_LDFLAGS)
endif
# Dummy myclean rule that can be overriden by the t/ Makefile
# TODO: move to config.mk ? it must be a precondition
myclean:
clean:: myclean
2013-09-06 23:35:11 +00:00
-rm -f ${OBJS} ${OBJ} ${BEXE}
mrproper: clean
-rm -f *.d
install:
cd ../.. && ${MAKE} install
.PHONY: all clean myclean mrproper install