mirror of https://github.com/YosysHQ/abc.git
(1) Makefile: added a shared library target, (2) no longer compile the main function as part of libabc.a
This commit is contained in:
parent
7d0648e240
commit
b9dfb992c7
8
Makefile
8
Makefile
|
|
@ -139,6 +139,8 @@ OBJ := \
|
|||
$(patsubst %.c, %.o, $(filter %.c, $(SRC))) \
|
||||
$(patsubst %.y, %.o, $(filter %.y, $(SRC)))
|
||||
|
||||
LIBOBJ := $(filter-out src/base/main/main.o,$(OBJ))
|
||||
|
||||
DEP := $(OBJ:.o=.d)
|
||||
|
||||
# implicit rules
|
||||
|
|
@ -186,11 +188,15 @@ $(PROG): $(OBJ)
|
|||
@echo "$(MSG_PREFIX)\`\` Building binary:" $(notdir $@)
|
||||
$(VERBOSE)$(LD) -o $@ $^ $(LIBS)
|
||||
|
||||
lib$(PROG).a: $(OBJ)
|
||||
lib$(PROG).a: $(LIBOBJ)
|
||||
@echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@)
|
||||
$(VERBOSE)ar rv $@ $?
|
||||
$(VERBOSE)ranlib $@
|
||||
|
||||
lib$(PROG).so: $(LIBOBJ)
|
||||
@echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@)
|
||||
$(VERBOSE)$(CXX) -shared -o $@ $^ $(LIBS)
|
||||
|
||||
docs:
|
||||
@echo "$(MSG_PREFIX)\`\` Building documentation." $(notdir $@)
|
||||
$(VERBOSE)doxygen doxygen.conf
|
||||
|
|
|
|||
|
|
@ -53,6 +53,13 @@ The current version of ABC can be compiled with C compiler or C++ compiler.
|
|||
* To compile as C++ code with namespaces: make sure that `CC=g++` and `ABC_NAMESPACE` is set to
|
||||
the name of the requested namespace. For example, add `-DABC_NAMESPACE=xxx` to OPTFLAGS.
|
||||
|
||||
## Building a shared library
|
||||
|
||||
* Compile the code as position-independent by adding `ABC_USE_PIC=1`.
|
||||
* Build the `libabc.so` target:
|
||||
|
||||
make ABC_USE_PIC=1 libabc.so
|
||||
|
||||
## Bug reporting:
|
||||
|
||||
Please try to reproduce all the reported bugs and unexpected features using the latest
|
||||
|
|
|
|||
Loading…
Reference in New Issue