radare2/shlr/bochs/Makefile
whitequark c816dc7e66 Don't try to build shared libraries if configured as --without-pic.
Specifically, avoid building all plugins as non-static objects,
as well as some supplementary libraries. In fact, a large amount
of plugins was already gated to build as shared objects only with
WITHPIC=1, but this was not done consistently.
This gating has been moved to */p/Makefile.

Building these shared objects is a waste of time and breaks
the --without-pic build unless CFLAGS is forced in the make
invocation.
2018-01-11 23:09:22 +01:00

51 lines
1.0 KiB
Makefile

include ../../libr/config.mk
include ../../mk/platform.mk
EDITOR?=vim
CC?=gcc
AR?=ar
RANLIB?=ranlib
LIBNAME=libbochs
LIBFILE=$(LIBNAME).$(EXT_SO)
CFLAGS+=-I$(LIBR)/include $(PIC_CFLAGS)
CFLAGS+=-Iinclude -I${LIBR}/include
MAJOR=0
MINOR=1
LD=$(CC)
ifeq ($(LD),cccl)
LDFLAGS+=-L${LIBR}/socket -llibr_socket
LDFLAGS+=-L${LIBR}/util -llibr_util
else
LDFLAGS+=-L${LIBR}/socket -lr_socket
LDFLAGS+=-L${LIBR}/util -lr_util
endif
ifeq ($(OSTYPE),darwin)
LDFLAGS_SHARED=-dynamiclib
else
LDFLAGS_SHARED=-shared
endif
#OSTYPE=windows
include ../../libr/socket/deps.mk
include ../../shlr/zip/deps.mk
SRC_D=src
SRC_C=$(wildcard $(SRC_D)/*.c)
SRC_O=$(SRC_C:.c=.o)
all: lib/$(LIBNAME).$(EXT_AR)
#$(LD) -shared -Wl,-soname,$(LIBNAME).so -o lib/$(LIBNAME).so $(SRC_O)
lib:
mkdir -p lib
lib/$(LIBNAME).$(EXT_AR): lib $(SRC_O)
mkdir -p lib
ifeq ($(WITHPIC),1)
$(LD) $(PIC_CFLAGS) $(LDFLAGS_SHARED) -o lib/$(LIBFILE) $(CFLAGS) $(SRC_O) $(LDFLAGS) $(LINK)
endif
$(AR) rvs lib/$(LIBNAME).$(EXT_AR) $(SRC_O)
$(RANLIB) lib/$(LIBNAME).$(EXT_AR)
clean:
-rm -f $(SRC_O)
-rm -rf lib