2023-02-08 12:05:03 +01:00
|
|
|
all: build
|
|
|
|
|
|
|
|
help:
|
2023-04-22 15:49:19 +02:00
|
|
|
@echo "usage: make [build|install|doc|serve-doc]"
|
2023-02-08 12:05:03 +01:00
|
|
|
|
2023-05-03 03:21:30 +02:00
|
|
|
ZIGOPTS ?=
|
2023-02-08 12:05:03 +01:00
|
|
|
ZIGOPTIM ?= ReleaseSafe
|
2024-03-21 13:02:02 +01:00
|
|
|
|
|
|
|
-include makefile.target
|
|
|
|
|
2023-02-08 12:05:03 +01:00
|
|
|
build:
|
2024-03-21 13:02:02 +01:00
|
|
|
zig build -Doptimize=$(ZIGOPTIM) $(ZIGOPTS) $(TARGET_OPTION)
|
2023-02-08 12:05:03 +01:00
|
|
|
|
2024-05-31 19:29:55 +02:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
LIBDIR ?= $(PREFIX)/lib
|
|
|
|
INCLUDEDIR ?= $(PREFIX)/include
|
|
|
|
PKGCONFIGDIR ?= /usr/share/pkgconfig
|
2024-06-21 21:33:41 +02:00
|
|
|
|
|
|
|
$(PKGCONFIGDIR):; install -m 0755 -d $(PKGCONFIGDIR)
|
|
|
|
$(PKGCONFIGDIR)/ipc.pc: ipc.pc; install -m 0644 ipc.pc $(PKGCONFIGDIR)
|
|
|
|
install-pkgconfig: $(PKGCONFIGDIR) $(PKGCONFIGDIR)/hexa.pc
|
|
|
|
|
|
|
|
$(LIBDIR):; install -m 0755 -d $(LIBDIR)
|
|
|
|
$(LIBDIR)/libipc.a: zig-out/lib/libipc.a; install -m 0644 zig-out/lib/libipc.a $(LIBDIR)
|
|
|
|
$(LIBDIR)/libipc.so: zig-out/lib/libipc.so; install -m 0644 zig-out/lib/libipc.so $(LIBDIR)
|
|
|
|
install-library: $(LIBDIR) $(LIBDIR)/libipc.a $(LIBDIR)/libipc.so
|
|
|
|
|
|
|
|
$(INCLUDEDIR):; install -m 0755 -d $(INCLUDEDIR)
|
|
|
|
$(INCLUDEDIR)/libipc.h: libipc.h; install -m 0644 libipc.h $(INCLUDEDIR)
|
|
|
|
install-header: $(INCLUDEDIR) $(INCLUDEDIR)/libipc.h
|
|
|
|
|
2024-05-31 19:29:55 +02:00
|
|
|
install: install-pkgconfig install-library install-header
|
2024-06-21 21:33:41 +02:00
|
|
|
@echo "Now that you have installed the library, you should (probably) run ldconfig."
|
2023-02-08 12:05:03 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-02-08 12:05:03 +01:00
|
|
|
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
|
2024-06-16 16:02:03 +02:00
|
|
|
VERSION ?= 0.2.0
|
2023-02-08 12:05:03 +01:00
|
|
|
PKG = $(PACKAGE)-$(VERSION)
|
|
|
|
$(PKG).tar.gz: dist-dir
|
|
|
|
tar zcf $@ \
|
|
|
|
$(PKG)/src \
|
2024-06-21 21:33:41 +02:00
|
|
|
$(PKG)/build.zig* \
|
2023-02-08 12:05:03 +01:00
|
|
|
$(PKG)/libipc.h \
|
2024-06-21 21:33:41 +02:00
|
|
|
$(PKG)/ipc.pc \
|
2023-02-08 12:05:03 +01:00
|
|
|
$(PKG)/makefile* \
|
|
|
|
$(PKG)/README* \
|
|
|
|
$(PKG)/TODO*
|
2024-06-21 21:33:41 +02:00
|
|
|
$(PKG):; ln -s . $(PKG)
|
|
|
|
dist-dir: $(PKG)
|
|
|
|
dist-rm-dir:; rm $(PKG)
|
|
|
|
dist-gz: $(PKG).tar.gz
|
2023-02-08 12:05:03 +01:00
|
|
|
dist: dist-gz dist-rm-dir
|
|
|
|
|
|
|
|
# You can add your specific instructions there.
|
|
|
|
-include makefile.user
|