libipc/makefile

70 lines
1.7 KiB
Makefile
Raw Permalink Normal View History

all: build
help:
2023-04-22 15:49:19 +02:00
@echo "usage: make [build|install|doc|serve-doc]"
2023-05-03 03:21:30 +02:00
ZIGOPTS ?=
ZIGOPTIM ?= ReleaseSafe
2024-03-21 13:02:02 +01:00
-include makefile.target
build:
2024-03-21 13:02:02 +01:00
zig build -Doptimize=$(ZIGOPTIM) $(ZIGOPTS) $(TARGET_OPTION)
PREFIX ?= /usr/local
LIBDIR ?= $(PREFIX)/lib
INCLUDEDIR ?= $(PREFIX)/include
PKGCONFIGDIR ?= /usr/share/pkgconfig
install-pkgconfig:
[ -d $(PKGCONFIGDIR) ] || install -m 0755 -d $(PKGCONFIGDIR)
install -m 0644 ipc.pc $(PKGCONFIGDIR)
install-library:
[ -d $(LIBDIR) ] || install -m 0755 -d $(LIBDIR)
install -m 0644 zig-out/lib/libipc.a $(LIBDIR)
install -m 0644 zig-out/lib/libipc.so $(LIBDIR)
install-header:
[ -d $(INCLUDEDIR) ] || install -m 0755 -d $(INCLUDEDIR)
install -m 0644 libipc.h $(INCLUDEDIR)
install: install-pkgconfig install-library install-header
uninstall-library:
rm $(LIBDIR)/libipc.a \
$(LIBDIR)/libipc.so \
$(LIBDIR)/libipc.so.*
uninstall-header:
rm $(INCLUDEDIR)/libipc.h
uninstall: uninstall-library uninstall-header
mrproper:
rm -r docs zig-cache zig-out 2>/dev/null || true
2023-04-22 15:49:19 +02:00
doc:
zig build-lib -femit-docs src/main.zig
DOC_HTTPD_ACCESS_LOGS ?= /tmp/access.log
DOC_HTTPD_ADDR ?= 127.0.0.1
DOC_HTTPD_PORT ?= 35000
serve-doc:
darkhttpd docs/ --addr $(DOC_HTTPD_ADDR) --port $(DOC_HTTPD_PORT) --log $(DOC_HTTPD_ACCESS_LOGS)
PACKAGE ?= libipc
VERSION ?= 0.2.0
PKG = $(PACKAGE)-$(VERSION)
dist-dir:
[ -d $(PKG) ] || ln -s . $(PKG)
$(PKG).tar.gz: dist-dir
tar zcf $@ \
$(PKG)/src \
$(PKG)/build.zig \
$(PKG)/libipc.h \
$(PKG)/makefile* \
$(PKG)/README* \
$(PKG)/TODO*
dist-rm-dir:
rm $(PKG)
dist-gz: $(PACKAGE)-$(VERSION).tar.gz
dist: dist-gz dist-rm-dir
# You can add your specific instructions there.
-include makefile.user