Commit 4a9dc0cb authored by Milosz Malczak's avatar Milosz Malczak Committed by Dimitris Lampridis

sw: Modified lib Makefile to also produce the .so file

parent ad76433e
......@@ -8,9 +8,10 @@
REPO_PARENT ?= ..
-include $(REPO_PARENT)/parent_common.mk
WRTD_DEP_TRTL ?= ../../dependencies/mock-turtle/
WRTD_DEP_TRTL ?= ../../dependencies/mock-turtle/
LIB = libwrtd.a
LIBSO = libwrtd.so
LIB = libwrtd.a
OBJS := libwrtd-base.o libwrtd-attributes.o libwrtd-rules.o
INCFLAGS=-I. -I../include -I$(WRTD_DEP_TRTL)/software/include \
......@@ -19,16 +20,20 @@ INCFLAGS=-I. -I../include -I$(WRTD_DEP_TRTL)/software/include \
CFLAGS += -fno-strict-aliasing $(INCFLAGS)
CFLAGS += -Wall -Werror
CFLAGS += -g
CFLAGS += -fPIC
CFLAGS += $(EXTRACFLAGS)
ARFLAGS = rc
all: $(LIB)
all: $(LIB) $(LIBSO)
$(LIB): $(OBJS)
$(AR) $(ARFLAGS) $@ $^
$(LIBSO): $(LIB)
$(CC) -shared -o $@ -Wl,--whole-archive,-soname,$@ $^ -Wl,--no-whole-archive $(WRTD_DEP_TRTL)/software/lib/libmockturtle.a
clean:
rm -f $(LIB) *.d *.o *~
rm -f $(LIB) $(LIBSO) *.d *.o *~
%.o: %.c
$(CC) -c $(CFLAGS) -MMD $< -o $@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment