aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 21 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index a6b89f2..b41b05c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,28 @@
-CC = gcc -std=gnu99
-CFLAGS := -Wall -Wextra -pedantic -O2 -g -D_REENTRANT $(CFLAGS)
-LDLIBS := -lpulse -lm
+CXX = g++ -std=c++11
-ponymix: ponymix.o
+base_CXXFLAGS = -Wall -Wextra -pedantic -O2 -g
+base_LIBS = -lm
+
+libpulse_CXXFLAGS = $(shell pkg-config --cflags libpulse)
+libpulse_LIBS = $(shell pkg-config --libs libpulse)
+
+CXXFLAGS := \
+ $(base_CXXFLAGS) \
+ $(libpulse_CXXFLAGS) \
+ $(CXXFLAGS)
+
+LDLIBS := \
+ $(base_LIBS) \
+ $(libpulse_LIBS)
+
+all: ponymix
+
+ponymix: ponymix.cc pulse.o
+pulse.o: pulse.cc pulse.h
install: ponymix
install -Dm755 ponymix $(DESTDIR)/usr/bin/ponymix
install -Dm644 ponymix.1 $(DESTDIR)/usr/share/man/man1/ponymix.1
-check: ponymix
- ./runtests ./ponymix
-
clean:
- $(RM) ponymix ponymix.o
+ $(RM) ponymix pulse.o