2023-07-12 12:20:53 +02:00
|
|
|
CC ?= cc
|
|
|
|
INSTALL_PATH ?= /usr
|
|
|
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
build: target/mpfm target/mpfm.service
|
|
|
|
|
|
|
|
target/mpfm: mpfm.c
|
|
|
|
mkdir -p target
|
2023-07-12 14:01:23 +02:00
|
|
|
$(CC) -std=gnu99 -O2 mpfm.c -lusb-1.0 -o target/mpfm
|
2023-07-12 12:20:53 +02:00
|
|
|
|
|
|
|
target/mpfm.service: mpfm.service
|
|
|
|
mkdir -p target
|
|
|
|
sed -E 's|__INSTALL_PATH__|$(INSTALL_PATH)|g' mpfm.service > target/mpfm.service
|
|
|
|
|
|
|
|
install: build mpfm.rules
|
|
|
|
mkdir -p $(INSTALL_PATH)/{bin,lib/systemd/system}
|
|
|
|
install target/mpfm $(INSTALL_PATH)/bin/mpfm
|
|
|
|
install target/mpfm.service $(INSTALL_PATH)/lib/systemd/system/mpfm.service
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(INSTALL_PATH)/lib/systemd/system/mpfm.service
|
|
|
|
rm -f $(INSTALL_PATH)/bin/mpfm
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf target
|
|
|
|
|
|
|
|
.PHONY: all build clean install uninstall
|