more installation options

master
Avril 5 years ago
parent de2c29656a
commit f57d643333
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -1,4 +1,5 @@
HOME:=$(shell getent passwd `logname` | cut -d: -f6)
LOCAL_PROJECTS:=$(HOME)/quicklisp/local-projects
ffi:
cd libsipc && make libsipc-ffi
@ -7,8 +8,14 @@ clean:
cd libsipc && make clean
rm -f *.socket
install: ffi
cp -f libsipc.so /usr/lib/libsipc.so
install-ffi:
if [[ $(shell id -u) == 0 ]]; then cp -f libsipc.so /usr/lib/libsipc.so; fi
install: ffi install-ffi
if [ -d "$(LOCAL_PROJECTS)" ]; then sudo -u `logname` ln -nsi "`pwd`" "$(LOCAL_PROJECTS)/cl-sipc"; fi
uninstall-ffi:
if [[ $(shell id -u) == 0 ]]; then rm -f /usr/lib/libsipc.so; fi
uninstall:
rm -f /usr/lib/libsipc.so
uninstall: uninstall-ffi
if [ -L "$(LOCAL_PROJECTS)/cl-sipc" ] && [ "`readlink -f $(LOCAL_PROJECTS)/cl-sipc`" == "`pwd`" ]; then sudo -u `logname` rm -i $(LOCAL_PROJECTS)/cl-sipc; fi

@ -3,10 +3,10 @@ cl-sipc (common lisp socket inter-process communication)
Unix domain socket message passing for Common Lisp.
Run `make' in this directory once to build the CFFI library.
Run `sudo make install' to install system-wide.
Run `sudo make install-ffi' to install the ffi library system-wide. (`sudo make uninstall-ffi' to remove)
The symlinked libsipc.so will resolve after the ffi library is built and the package will work in this directory (the symlink is to libsipc/libsipc-ffi.so)
Additionally you can run `sudo make install' to make it work system-wide (installed to /usr/lib/libsipc.so) (`sudo make uninstall' to remove it)
Additionally you can run `sudo make install-ffi' to make it work system-wide (installed to /usr/lib/libsipc.so) (`sudo make uninstall' to remove it)
Or you can copy/symlink libsipc/libsipc-ffi.so to wherever you need.
Additional tools can be built by running `make all-ffi' in the libsipc/ directory.
@ -32,6 +32,18 @@ Functions:
See `cl-sipc.lisp' for more documentation.
---
Other installation options
Run `sudo make install' to install ffi library system-wide and attempt to symlink to ~/quicklisp/local-projects/cl-sipc (if it exists). Or run `sudo make install-ffi' to just install the library. (note: you can run `make install' without sudo, in which case it will just attempt to symlink and not install the library. the same is true for `make uninstall'.)
-> sudo make install ;; install ffi systemwide and symlink
-> make install ;; only symlink
-> sudo make install-ffi ;; insall only ffi
-> sudo make uninstall ;; uninstall ffi systemwide and remove symlink
-> make uninstall ;; only remove symlink
-> sudo make uninstall-ffi ;; only uninstall ffi
---
Example using sipcli (run `make all-ffi' in libsipc/ directory)

@ -1,7 +1,8 @@
TRANS:=src/sipc.c
INCLUDE:=include/
CFLAGS:= -c -Wall -fPIC -I$(INCLUDE)
STD:=--std=gnu11
STD:=gnu11
CFLAGS:= --std=$(STD) -Wall -pedantic -I$(INCLUDE)
LCFLAGS:= -c $(CFLAGS) -fPIC
all: clean libsipc sipcli
@ -14,13 +15,13 @@ clean:
rm -f *.socket
libsipc:
gcc $(STD) $(CFLAGS) $(TRANS)
gcc $(LCFLAGS) $(TRANS)
gcc -shared -o $@.so *.o
libsipc-ffi:
gcc $(STD) $(CFLAGS) $(TRANS) src/ffi.c
gcc $(LCFLAGS) $(TRANS) src/ffi.c
gcc -shared -o $@.so *.o
sipcli: libsipc
gcc $(STD) -Wall -pedantic -I$(INCLUDE) -Wl,-rpath=./ src/test.c -o $@ -L./ -lsipc
gcc $(CFLAGS) -Wl,-rpath=./ src/cli.c -o $@ -L./ -lsipc
./$@

Loading…
Cancel
Save