# SPDX-License-Identifier: GPL-3.0-or-later
# pomelo-power — Pomelo 電源管理
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-power: pomelo-power.c
	$(CC) $(CFLAGS) $(POMELO_CFLAGS) $$(pkg-config --cflags dbus-1) -o $@ pomelo-power.c $(POMELO_LIBS) $$(pkg-config --libs dbus-1) -lm $(LDFLAGS)

install: pomelo-power
	install -Dm755 pomelo-power $(DESTDIR)$(PREFIX)/bin/pomelo-power

clean:
	rm -f pomelo-power

.PHONY: install clean
