title: Build error: make: Nothing to be done for 'compile'
body: <p>I need to add my own package to the openwrt image. On the wiki of the project I found this <a href="https://openwrt.org/docs/guide-developer/packages" rel="nofollow noreferrer">article</a>.</p>
  <p>I tried to follow the instructions for it, but in the end I did not manage to add my own package to the source code tree (the build ignored its presence).</p>
  <p>Because of this, I tried to find some other way. And it turned out to be a <a href="https://forum.openwrt.org/t/solved-add-a-new-package-to-the-source/11542" rel="nofollow noreferrer">this instruction</a>. I followed the directions from there and compiled my own package.</p>
  <p>But as you can see, the source code of that package does not depend on others and does not require any other build header files. Also, his <code>Makefile</code> completely includes instructions for compiling.</p>
  <pre><code>define Build/Compile
      $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/helloworld.o -c $(PKG_BUILD_DIR)/helloworld.c
      $(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1 $(PKG_BUILD_DIR)/helloworld.o
  endef
  </code></pre>
  <p>But now this does not suit me, since another package that I want to add already has such dependencies.
  I tried to bypass them like this (copy the source code to the build folder and <a href="https://www.gnu.org/software/make/manual/html_node/Recursion.html" rel="nofollow noreferrer">call the makefile</a> located there) but nothing came of it:</p>
  <pre><code>define Build/Prepare
      echo $PKG_NAME
      mkdir -p $(PKG_BUILD_DIR)
      cp $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
      $(Build/Patch)
  endef
  
  define Build/Compile
      $(PKG_BUILD_DIR) $(MAKE)
  endef
  </code></pre>
  <p>I am getting next output:</p>
  <pre><code>    $ make -C package/feeds/mypackages/helloworld compile TOPDIR=$PWD
  make: Entering directory '/home/username/mypackages/examples/helloworld'
  bash: mkhash: command not found
  bash: mkhash: command not found
  bash: mkhash: command not found
  bash: mkhash: command not found
  bash: mkhash: command not found
  bash: mkhash: command not found
  bash: mkhash: command not found
  bash: mkhash: command not found
  make: Nothing to be done for 'compile'.
  make: Leaving directory '/home/username/mypackages/examples/helloworld'
  </code></pre>
  <p>My full Makefile for both package and binary:</p>
  <pre><code>include $(TOPDIR)/rules.mk
  PKG_NAME:=helloworld
  PKG_VERSION:=1.0
  PKG_RELEASE:=1
  SOURCE_DIR:=/home/username/helloworld
  include $(INCLUDE_DIR)/package.mk
  define Package/$(PKG_NAME)
      SECTION:=utils
      DEPENDS:= +libstdcpp
      TITLE:=helloworld
  endef
  define Package/helloworld/description
      A simple &quot;Hello, world!&quot; -application.
  endef
  define Build/Prepare
      echo $PKG_NAME
      mkdir -p $(PKG_BUILD_DIR)
      cp $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
      $(Build/Patch)
  endef
  define Build/Compile
      $(PKG_BUILD_DIR) $(MAKE)
  endef
  define Package/helloworld/install
      # Install binary
      #$(INSTALL_DIR) $(1)/usr/bin
      #$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/usr/bin/
  endef
  $(eval $(call BuildPackage,$(PKG_NAME)))
  </code></pre>
  <p>,</p>
  <pre><code>TARGET = heloworld
  OBJS = heloworld.o
  CFLAGS += -Wall -Wextra 
  LDFLAGS += -lxsacpp -lxsac -lubus -lubox 
  CXXFLAGS += $(CFLAGS) -std=c++14
  
  %.o : %.cpp
      $(CXX) -c $(CXXFLAGS) $&lt; -o $@
  
  all: $(TARGET)
  
  $(TARGET): $(OBJS)
      $(CXX) $(LDFLAGS) -o $@ $^
  
  clean:
      rm *.o $(TARGET)
  </code></pre>
  <p>And actually my question is, what needs to be set in the <code>Makefile</code> to copy files correctly and call the local <code>Makefile</code> for package binary?</p>