summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBaruch Sterin <baruchs@gmail.com>2016-12-22 18:15:29 -0800
committerBaruch Sterin <baruchs@gmail.com>2016-12-22 18:15:29 -0800
commitb9dfb992c78e3c8786dee303e4a9994d46b6990a (patch)
tree0db7240b7082759875246103ff6f6d57cedf7063 /Makefile
parent7d0648e24098ed0e6a0a1471a52946303c351c87 (diff)
downloadabc-b9dfb992c78e3c8786dee303e4a9994d46b6990a.tar.gz
abc-b9dfb992c78e3c8786dee303e4a9994d46b6990a.tar.bz2
abc-b9dfb992c78e3c8786dee303e4a9994d46b6990a.zip
(1) Makefile: added a shared library target, (2) no longer compile the main function as part of libabc.a
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2385431c..d45978a9 100644
--- a/Makefile
+++ b/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