mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 13:19:54 +00:00
Statically link the binaries when using --with-libr
This commit is contained in:
parent
4c6aca5cd7
commit
f97aded52a
@ -19,7 +19,6 @@ OBJ+=${BIN}.o
|
||||
BEXE=${BIN}${EXT_EXE}
|
||||
|
||||
LDFLAGS+=${DL_LIBS}
|
||||
LDFLAGS+=${LINK}
|
||||
ifneq (${ANDROID},1)
|
||||
ifneq (${OSTYPE},windows)
|
||||
ifneq (${OSTYPE},linux)
|
||||
@ -40,24 +39,34 @@ endif
|
||||
# Rules for programs #
|
||||
#--------------------#
|
||||
|
||||
LDFLAGS+=-lm
|
||||
# For some reason w32 builds contain -shared in LDFLAGS. boo!
|
||||
|
||||
ifneq ($(BIN)$(BINS),)
|
||||
|
||||
all: ${BEXE} ${BINS}
|
||||
|
||||
ifeq ($(WITH_LIBR),1)
|
||||
${BINS}: ${OBJS}
|
||||
${CC} ${CFLAGS} $@.c ${OBJS} ../../libr/libr.a -o $@ $(LDFLAGS)
|
||||
|
||||
${BEXE}: ${OBJ} ${SHARED_OBJ}
|
||||
${CC} ${CFLAGS} $+ -L.. -o $@ ../../libr/libr.a $(LDFLAGS)
|
||||
else
|
||||
|
||||
${BINS}: ${OBJS}
|
||||
ifneq ($(SILENT),)
|
||||
@echo CC $@
|
||||
endif
|
||||
${CC} ${CFLAGS} $@.c ${OBJS} ${REAL_LDFLAGS} -o $@
|
||||
${CC} ${CFLAGS} $@.c ${OBJS} ${REAL_LDFLAGS} $(LINK) -o $@
|
||||
|
||||
# -static fails because -ldl -lpthread static-gcc ...
|
||||
${BEXE}: ${OBJ} ${SHARED_OBJ}
|
||||
ifneq ($(SILENT),)
|
||||
@echo LD $@
|
||||
endif
|
||||
${CC} ${CFLAGS} $+ -L.. -o $@ $(REAL_LDFLAGS)
|
||||
${CC} ${CFLAGS} $+ -L.. -o $@ $(REAL_LDFLAGS) $(LINK)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Dummy myclean rule that can be overriden by the t/ Makefile
|
||||
|
Loading…
Reference in New Issue
Block a user