liblash

Basic tools written and used by lash in c programming.
Log | Files | Refs

commit f391b7d7ad66d72a582904a15a60a1fa5b79e5a2
parent 5c93383795fb813a318de494f9b4b7b630b11303
Author: lash <dev@holbrook.no>
Date:   Fri, 31 May 2024 20:29:16 +0100

Add install

Diffstat:
M.gitignore | 2++
MMakefile | 22+++++++++++++++-------
Msrc/Makefile | 10+++++++++-
3 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,3 +1,5 @@ *.o *.testbin *.so +build +*.tar.gz diff --git a/Makefile b/Makefile @@ -1,20 +1,28 @@ -VERSION=0.0.1 +VERSION = 0.0.1 +DESTDIR := /usr/local +export DESTDIR +export VERSION all: - make -C src all + $(MAKE) -C src all shared: - make -C src shared + $(MAKE) -C src shared src: - make -C src + $(MAKE) -C src test: src - make -C src test + $(MAKE) -C src test clean: - make -C src clean + $(MAKE) -C src clean archive: - git archive --format=tar.gz HEAD liblash-$(VERSION).tar.gz + git archive --format=tar.gz HEAD > liblash-$(VERSION).tar.gz + +install: + mkdir -vp $(DESTDIR)/lib + mkdir -vp $(DESTDIR)/include + $(MAKE) -e -C src install .PHONY: clean diff --git a/src/Makefile b/src/Makefile @@ -22,12 +22,20 @@ test: all make -C rerr test #make -C case test -shared: endian hex +shared: all make -C endian shared make -C hex shared make -C llog shared make -C rerr shared $(CC) $(CFLAGS) -shared -o liblash.so endian/strip.so.o endian/endian.so.o hex/hex.so.o llog/llog.so.o rerr/rerr.so.o +install: shared + cat -v endian/*.h >> $(DESTDIR)/include/lash.h + cat -v hex/*.h >> $(DESTDIR)/include/lash.h + cat -v llog/*.h >> $(DESTDIR)/include/lash.h + cat -v rerr/*.h >> $(DESTDIR)/include/lash.h + cp -v liblash.so $(DESTDIR)/lib/ + cd $(DESTDIR)/lib && ln -svf liblash.so liblash.so.$(VERSION) + .PHONY: clean