# SPDX-License-Identifier: GPL-3.0-or-later
# pomelo-polkit — Pomelo 密碼認證視窗（取代 policykit-1-gnome，不需要 GTK）
PREFIX ?= /usr/local
CFLAGS ?= -Os -pipe -Wall -Wextra -Wno-unused-parameter -Wno-format-truncation
POMELO_CFLAGS ?= $(shell pkg-config --cflags pomelo)
POMELO_LIBS   ?= $(shell pkg-config --libs pomelo)

pomelo-polkit: pomelo-polkit.c
	$(CC) $(CFLAGS) $(POMELO_CFLAGS) $$(pkg-config --cflags polkit-agent-1) -o $@ pomelo-polkit.c $(POMELO_LIBS) $$(pkg-config --libs polkit-agent-1) -lm $(LDFLAGS)

install: pomelo-polkit
	install -Dm755 pomelo-polkit $(DESTDIR)$(PREFIX)/libexec/pomelo-polkit

clean:
	rm -f pomelo-polkit

.PHONY: install clean
