CFLAGS := -O2 -pipe -Wall OBJS := configfile.o event.o linebuffer.o logging.o sockaddr.o tcpsocket.o all: torrent-stats torrent-stats: $(OBJS) torrent-stats.o $(CC) $(CFLAGS) $^ -o $@ %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ %.d: %.c $(CC) $(CFLAGS) -MM -c $< -o $@ clean: rm -f torrent-stats *.d *.o *.log DEPS := $(wildcard *.c) -include $(DEPS:.c=.d)