2022-12-21 23:53:54 +01:00
|
|
|
all:
|
|
|
|
|
2022-12-27 22:39:23 +01:00
|
|
|
ZIGMAKEDOC = -femit-docs -fno-emit-bin
|
|
|
|
ZIGOPTIM ?= Debug
|
2023-01-11 16:04:16 +01:00
|
|
|
# Linking against libc is almost mandatory, C allocator is used
|
|
|
|
# for switching (default reception and emission functions).
|
|
|
|
ZIGBUSEOPTS ?= -O$(ZIGOPTIM) -freference-trace -lc
|
2022-12-27 22:39:23 +01:00
|
|
|
ZIGUSROPTS ?=
|
2022-12-23 02:36:10 +01:00
|
|
|
ZIGC ?= zig
|
|
|
|
ZIGOPTS ?= $(ZIGBUSEOPTS) $(ZIGUSROPTS)
|
2022-12-21 23:53:54 +01:00
|
|
|
|
2023-01-18 20:09:38 +01:00
|
|
|
# Debug with valgrind.
|
|
|
|
ifdef VG_SUPPRESS_WARNINGS
|
|
|
|
VALGRIND_SUPPRESS_WARNINGS ?= --suppressions=./valgrind.suppr
|
|
|
|
endif
|
|
|
|
ifdef VG_GENERATE_SUPPRESSION
|
|
|
|
VALGRIND_GEN_SUPPRESSION ?= --gen-suppressions=all
|
|
|
|
endif
|
|
|
|
ifdef USE_VALGRIND
|
|
|
|
VALGRIND ?= valgrind $(VALGRIND_SUPPRESS_WARNINGS) $(VALGRIND_GEN_SUPPRESSION) -v --leak-check=full
|
|
|
|
endif
|
|
|
|
# Optional parameters (copied here to help with autocompletion).
|
|
|
|
VG_SUPPRESS_WARNINGS ?=
|
|
|
|
VG_GENERATE_SUPPRESSION ?=
|
|
|
|
USE_VALGRIND ?=
|
|
|
|
|
2022-12-27 22:39:23 +01:00
|
|
|
ipcd: src/ipcd.zig
|
2022-12-21 23:53:54 +01:00
|
|
|
$(ZIGC) build-exe $(ZIGOPTS) $^
|
|
|
|
|
2023-01-11 16:04:16 +01:00
|
|
|
tcpd: src/tcpd.zig
|
|
|
|
$(ZIGC) build-exe $(ZIGOPTS) $^
|
|
|
|
|
2022-12-27 22:39:23 +01:00
|
|
|
test-libipc: src/main.zig
|
|
|
|
$(ZIGC) test $(ZIGOPTS) $^
|
2022-12-21 23:53:54 +01:00
|
|
|
|
2022-12-27 22:39:23 +01:00
|
|
|
test-ipcd: src/ipcd.zig
|
2022-12-23 00:53:47 +01:00
|
|
|
$(ZIGC) test $(ZIGOPTS) $^
|
2022-12-22 08:30:15 +01:00
|
|
|
|
2022-12-27 22:39:23 +01:00
|
|
|
doc: src/ipcd.zig
|
|
|
|
$(ZIGC) build-exe $(ZIGOPTS) $(ZIGMAKEDOC) $^
|
2022-12-23 00:53:47 +01:00
|
|
|
|
2022-12-29 10:33:02 +01:00
|
|
|
TO_CLEAN != ls misc/*.zig | sed 's/.zig$\//' | sed 's_misc/__'
|
2023-01-18 14:01:42 +01:00
|
|
|
TO_CLEAN += ipcd tcpd pong pongd
|
2022-12-29 12:19:07 +01:00
|
|
|
TO_CLEAN += *.o
|
2022-12-29 10:33:02 +01:00
|
|
|
clean:
|
|
|
|
@-rm $(TO_CLEAN) 2>/dev/null
|
|
|
|
|
|
|
|
mrproper: clean
|
2023-01-18 14:01:42 +01:00
|
|
|
@-rm -r docs build zig-cache zig-out 2>/dev/null
|
2022-12-27 22:39:23 +01:00
|
|
|
|
2022-12-31 05:00:01 +01:00
|
|
|
ACCESS_LOGS ?= ./access.log
|
2022-12-29 12:15:20 +01:00
|
|
|
servedoc:
|
2022-12-31 05:00:01 +01:00
|
|
|
darkhttpd docs/ --addr 127.0.0.1 --port 35000 --log $(ACCESS_LOGS)
|
2022-12-29 12:15:20 +01:00
|
|
|
|
2022-12-27 22:39:23 +01:00
|
|
|
# You can add your specific instructions there.
|
|
|
|
-include makefile.user
|