aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2025-02-09 15:51:28 -0600
committerTim Keller <tjkeller.xyz>2025-02-09 15:51:28 -0600
commit25ecc7f4c0b4a24ac9db349bb17fd2260a273b64 (patch)
treed3eb3c6ff791cf4de37672ef3f95a067693ddf85 /Makefile
parent9f5870e4ee74213b3dbc2814d892f3e8ad6d477e (diff)
downloadpavolctld-25ecc7f4c0b4a24ac9db349bb17fd2260a273b64.tar.xz
pavolctld-25ecc7f4c0b4a24ac9db349bb17fd2260a273b64.zip
add prefix option to make and make installHEADv1.0.1master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 17 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index a2b542d..918f075 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,27 @@
CC = gcc
-CFLAGS = -Wall -Ofast
+CFLAGS = -Wall -O2
LDFLAGS = -lpulse
-
TARGET = pavolctld
-SOURCES = pavolctld.c
+SRCS = pavolctld.c
+PREFIX = /usr/local
all: $(TARGET)
-$(TARGET): $(SOURCES)
- $(CC) $(CFLAGS) -o $(TARGET) $(SOURCES) $(LDFLAGS)
+$(TARGET): $(SRCS)
+ $(CC) $(CFLAGS) -o $@ $(SRCS) $(LDFLAGS)
clean:
rm -f $(TARGET)
+install: all
+ mkdir -p $(PREFIX)/bin
+ cp pavolctld $(PREFIX)/bin/pavolctld
+ chmod 755 $(PREFIX)/bin/pavolctld
+ mkdir -p $(PREFIX)/share/man/man1
+ cp pavolctld.1 $(PREFIX)/share/man/man1/pavolctld.1
+ chmod 644 $(PREFIX)/share/man/man1/pavolctld.1
+
+uninstall:
+ rm -f $(PREFIX)/bin/pavolctld $(PREFIX)/share/man/man1/pavolctld.1
+
+.PHONY: all clean