title: No rule to make target *, needed by *
body: <p>I can't get what's wrong with my makefile: </p>
  
  <pre><code>DIST_PATH = ../dist/libs
  BUILD_PATH = ../build
  
  MKDIR_P = mkdir -p
  
  .PHONY: all
  
  SHELL   = /bin/sh
  CC      = gcc
  FLAGS   = -std=gnu99
  CFLAGS  = -fPIC -pedantic -Wall -Werror
  LDFLAGS = -shared
  
  LOG_SRCS = $(shell echo log/*.c)
  LOG_HEADERS = $(shell echo log/*.h)
  LOG_OBJS = $(addprefix $(BUILD_PATH)/, $(notdir $(LOG_SRCS:.c=.o)))
  LOG_TARGET = $(DIST_PATH)/liblog.so
  
  all: dirs $(LOG_TARGET)
  
  dirs : 
      $(MKDIR_P) $(DIST_PATH)
      $(MKDIR_P) $(BUILD_PATH)
  
  $(LOG_TARGET) : $(LOG_OBJS)
      $(CC) $(FLAGS) $(CFLAGS) -o $@ $(LDFLAGS)
  </code></pre>
  
  <p>I need to build a shared library from sources in <code>log/</code> folder to <code>../dist/libs</code> and put obj file in <code>../build</code> but I am getting the error:  </p>
  
  <pre><code>make: *** No rule to make target '../build/log.o', needed by '../dist/libs/liblog.so'.  Stop.
  </code></pre>
  
  <p><strong>P.S.</strong> I know there are many similar questions but I couldn't get from these questions how to resolve my problem.</p>