diff --git a/binr/rules.mk b/binr/rules.mk index b6a29f2eab..fcd373bf68 100644 --- a/binr/rules.mk +++ b/binr/rules.mk @@ -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