diff options
author | ben <benjaminfranzke@googlemail.com> | 2010-07-08 23:21:50 +0200 |
---|---|---|
committer | ben <benjaminfranzke@googlemail.com> | 2010-07-08 23:21:50 +0200 |
commit | 70103f0b4c7b750487b959eb00f2345665ba5d28 (patch) | |
tree | 33928a30cc27c3c2f4ade0c34ea1d3180ed8ad74 | |
parent | 7a66e48912923921f8e5c46c08d3445d80f2e321 (diff) | |
download | pa-sink-ctl-70103f0b4c7b750487b959eb00f2345665ba5d28.tar.gz pa-sink-ctl-70103f0b4c7b750487b959eb00f2345665ba5d28.tar.bz2 pa-sink-ctl-70103f0b4c7b750487b959eb00f2345665ba5d28.zip |
makefile: add dynamic dependencies for make-rules
-rw-r--r-- | Makefile | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -1,18 +1,30 @@ BIN=pa-sink-ctl -OBJS=pa-sink-ctl.o interface.o sink.o sink_input.o +SRCS=interface.c sink.c sink_input.c pa-sink-ctl.c + +OBJS=$(SRCS:%.c=%.o) +HEADS=$(SRCS:%.c=%.h) CC=gcc CFLAGS=-std=c99 -Wall -Werror -pedantic LDFLAGS=-lncurses -lpulse -lform -all: $(BIN) -.PHONY: all +DEPENDFILE=.depend + +all: $(DEPENDFILE) $(BIN) +.PHONY: all clean $(BIN): $(OBJS) $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) -%.o: %.c %.h +%.o: %.c $(CC) $(CFLAGS) -c -o $@ $< +$(DEPENDFILE): $(SRCS) $(HEADS) + $(CC) -MM $(SRCS) > $(DEPENDFILE) + +-include $(DEPENDFILE) + clean: - rm -f $(BIN) $(OBJS) + rm -f $(OBJS) $(DEPENDFILE) +distclean: clean + rm -f $(BIN) |