.PHONY: all native all-with-ui install install-with-ui protocol protocol-go opensnitch_daemon gui daemon-only ebpf install-daemon install-ebpf check-install clean clean-with-ui run test adblocker # Local Linux defaults: build against the running kernel, not the latest # lexicographically sorted installed headers. All three remain overridable. KERNEL_VER ?= $(shell uname -r) KERNEL_DIR ?= /usr/lib/modules/$(KERNEL_VER)/build KERNEL_HEADERS ?= $(KERNEL_DIR) export KERNEL_VER KERNEL_DIR KERNEL_HEADERS all: native native: daemon-only ebpf # The Python desktop UI is an explicit opt-in, not a native build dependency. all-with-ui: protocol opensnitch_daemon gui ebpf # Native-only entry points: no Python GUI/protocol/translation commands. protocol-go: $(MAKE) -C proto ../daemon/ui/protocol/ui.pb.go daemon-only: protocol-go $(MAKE) -C daemon # These native-header objects depend on kernel/toolchain settings as well as # local sources. Rebuild on each native build instead of reusing stale objects. ebpf: $(MAKE) -B -C ebpf_prog check install-daemon: $(MAKE) -C daemon install install-ebpf: $(MAKE) -C ebpf_prog install check-install: sh utils/packaging/test_install.sh # Build unprivileged first; installation never reloads/restarts the service. install: install-daemon install-ebpf install-with-ui: install $(MAKE) -C ui install protocol: @cd proto && make opensnitch_daemon: @cd daemon && make gui: @cd ui && make clean: $(MAKE) -C daemon clean $(MAKE) -C ebpf_prog clean # Also removes generated Python protocol files; use only intentionally. clean-with-ui: clean $(MAKE) -C proto clean $(MAKE) -C ui clean run: cd ui && pip3 install --upgrade . && cd .. opensnitch-ui --socket unix:///tmp/osui.sock & ./daemon/opensnitchd -rules-path /etc/opensnitchd/rules -ui-socket unix:///tmp/osui.sock -cpu-profile cpu.profile -mem-profile mem.profile test: clear make clean clear mkdir -p rules make clear make run adblocker: clear make clean clear make clear python make_ads_rules.py clear cd ui && pip3 install --upgrade . && cd .. opensnitch-ui --socket unix:///tmp/osui.sock & ./daemon/opensnitchd -rules-path /etc/opensnitchd/rules -ui-socket unix:///tmp/osui.sock