Commit 208be821 authored by Federico Vaga's avatar Federico Vaga

sw:lib: install libraries

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent c847680c
......@@ -8,11 +8,16 @@ REPO_PARENT ?= ../..
-include $(REPO_PARENT)/parent_common.mk
GIT_VERSION := $(shell git describe --dirty --long --tags)
SO_VERSION := $(shell git describe --abbrev=0 | grep -o -E "[0-9]+\.[0-9]+\.[0-9]")
PREFIX ?= /usr/local
DESTLIBDIR ?= $(PREFIX)/lib
TRTL ?= ../..
TRTL_SW = $(TRTL)/software
LIBS = libmockturtle.so
LIBSV = $(LIBS).$(SO_VERSION)
LIB = libmockturtle.a
LOBJ := libmockturtle.o
LOBJ += libmockturtle-rt-msg.o
......@@ -32,15 +37,27 @@ modules all: $(LIB) $(LIBS)
$(LIB): $(LOBJ)
$(AR) $(ARFLAGS) $@ $^
$(LIBS): $(LIB)
$(LIBSV): $(LIB)
$(CC) -shared -o $@ -Wl,--whole-archive,-soname,$@ $^ -Wl,--no-whole-archive
$(LIBS): $(LIBSV)
ln -s $@ $(shell echo $@ | grep -o -E ".*\.so")
clean:
rm -f $(LIB) $(LIBS) .depend *.o *~
rm -f $(LIB) $(LIBS) $(LIBSV) .depend *.o *~
.depend: Makefile $(wildcard *.c *.h)
$(CC) $(CFLAGS) -M $(LOBJ:.o=.c) -o $@
install modules_install:
install:
install -d $(DESTLIBDIR)
install -D $(LIB) $(DESTLIBDIR)
install -D $(LIBSV) $(DESTLIBDIR)
ln -sf $(LIBSV) $(DESTLIBDIR)/$(LIBS)
uninstall:
rm -f $(DESTLIBDIR)/$(LIB) $(DESTLIBDIR)/$(LIBS) $(DESTLIBDIR)/$(LIBSV)
rmdir --ignore-fail-on-non-empty $(DESTLIBDIR)
modules_install:
-include .depend
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