summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <benjaminfranzke@googlemail.com>2010-07-08 22:54:42 +0200
committerben <benjaminfranzke@googlemail.com>2010-07-08 22:54:42 +0200
commit7a66e48912923921f8e5c46c08d3445d80f2e321 (patch)
tree714e0f9839dea85d0dce7f8ce85208daba1fded2
parentb35c511d120e732374fe986c884187c36f3c4359 (diff)
downloadpa-sink-ctl-7a66e48912923921f8e5c46c08d3445d80f2e321.tar.gz
pa-sink-ctl-7a66e48912923921f8e5c46c08d3445d80f2e321.tar.bz2
pa-sink-ctl-7a66e48912923921f8e5c46c08d3445d80f2e321.zip
makefile is more dynamic now
-rw-r--r--Makefile29
1 files changed, 12 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 77c77c0..750b1d9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,18 @@
-CC=gcc
-CFLAGS=-pedantic -std=c99 -Wall -Werror -lpulse -lncurses -lform
-
-all: pa-sink-ctl.o interface.o sink_input.o sink.o
- $(CC) $(CFLAGS) -o pa-sink-ctl pa-sink-ctl.o interface.o sink_input.o sink.o
+BIN=pa-sink-ctl
+OBJS=pa-sink-ctl.o interface.o sink.o sink_input.o
-pa-sink-ctl.o: pa-sink-ctl.c pa-sink-ctl.h
- $(CC) $(CFLAGS) -c pa-sink-ctl.c -o pa-sink-ctl.o
+CC=gcc
+CFLAGS=-std=c99 -Wall -Werror -pedantic
+LDFLAGS=-lncurses -lpulse -lform
-interface: interface.c interface.h
- $(CC) $(CFLAGS) -c interface.c -o interface.o
+all: $(BIN)
+.PHONY: all
-sink_input: sink_input.c sink_input.h
- $(CC) $(CFLAGS) -c sink_input.c -o sink_input.o
+$(BIN): $(OBJS)
+ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS)
-sink: sink.c sink.h
- $(CC) $(CFLAGS) -c sink.c -o sink.o
+%.o: %.c %.h
+ $(CC) $(CFLAGS) -c -o $@ $<
clean:
- rm *.o pa-sink-ctl
-
-test:
- $(CC) $(CFLAGS) nc-test.c -o nc-test
+ rm -f $(BIN) $(OBJS)