Skip to content

Commit

Permalink
Added install target
Browse files Browse the repository at this point in the history
  • Loading branch information
BLohner committed Sep 27, 2024
1 parent 3c8a8b3 commit c273cae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions clibrary/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
libtlsrpt - Installation

To install the libtlsrpt in /usr/local/lib and the header files to /usr/local/include:

1. Change directory to the library´s source directory
2. Call "make install" with PREFIX set to "/usr/local"

cd library/src
make install PREFIX=/usr/local

12 changes: 10 additions & 2 deletions clibrary/library/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
# If not, see <http://www.gnu.org/licenses/>.

CC=gcc
INSTALL=install

DEBUG=-g
CFLAGS += -Wall -I ../include -O2 ${DEBUG}
CFLAGS += -Wall -I ../include -fPIC -O2 ${DEBUG}
LDFLAGS += -Wall -L. ${DEBUG}
LDLIBS += libtlsrpt.a

TARGETLIBS=libtlsrpt.a
TARGETLIBS=libtlsrpt.a libtlsrpt.so
TARGETBINS=demo
TARGETS=${TARGETLIBS} ${TARGETBINS}

Expand All @@ -35,6 +37,9 @@ clean:
libtlsrpt.a : libtlsrpt.o json-escape-initializer-list.o
ar -rcs $@ $^

libtlsrpt.so : libtlsrpt.o json-escape-initializer-list.o
${CC} -shared -o $@ $^

demo : demo.o libtlsrpt.a

demo.o : ../include/tlsrpt.h
Expand All @@ -47,3 +52,6 @@ json-escape-initializer-list.c : create-json-escape-initializer-list
create-json-escape-initializer-list : LDLIBS =


install: ${TARGETLIBS}
${INSTALL} -D -t ${DESTDIR}${PREFIX}/lib ${TARGETLIBS}
${INSTALL} -D -t ${DESTDIR}${PREFIX}/include ../include/tlsrpt.h

0 comments on commit c273cae

Please sign in to comment.