Compiling custom package with LEDE

Hi everyone,

I'm new to LEDE, and I've been struggling for days to cross compile a custom C code with LEDE. I followed steps from the tutorial from LEDE, when I arrived at the cross compiling step, I had a problem. The compilation is 'successful' but I can't find the .ipk file resulting from the "make package/getportal/compile" which is supposed to be inside the bin/package/... folder,
(the folder is there but not the ipk file.) . I did a find to locate the *.ipk and I couldn't find it either.

Here is my Makefile (the one from the tutorial, I just changed the names and the paths)

include $(TOPDIR)/rules.mk

# Name, version and release number
# The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR)
PKG_NAME:=getportal
PKG_VERSION:=1.0
PKG_RELEASE:=1

# Source settings (i.e. where to find the source codes)
# This is a custom variable, used below
SOURCE_DIR:=/home/ctp/buildbot/getportal

include $(INCLUDE_DIR)/package.mk

# Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig')
define Package/getportal
 SECTION:=examples
 CATEGORY:=Examples
 TITLE:=Hello, World!
endef

# Package description; a more verbose description on what our package does
define Package/getportal/description
 A simple "get portal" -application.
endef

# Package preparation instructions; create the build directory and copy the source code. 
# The last command is necessary to ensure our preparation instructions remain compatible with the patching system.
define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	cp $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
	$(Build/Patch)
endef

# Package build instructions; invoke the target-specific compiler to first compile the source file, and then to link the file into the final executable
define Build/Compile
	$(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/getportal.o -c $(PKG_BUILD_DIR)/getportal.c
	$(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1 $(PKG_BUILD_DIR)/getportal.o
endef

# Package install instructions; create a directory inside the package to hold our executable, and then copy the executable we built previously into the folder
define Package/portal/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/getportal $(1)/usr/bin
endef

# This command is always the last, it uses the definitions and variables we give above in order to get the job done
$(eval $(call BuildPackage,getportal))

Result from >make package/getportal/compile V=s -j1


make[1]: Entering directory '/home/ctp/buildbot/source/lede'
make[2]: Entering directory '/home/ctp/buildbot/source/lede/package/libs/toolchain'
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
echo "libc" >> /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
echo "libgcc" >> /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
echo "libpthread" >> /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
if [ -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean ]; then rm -f /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install /home/ctp/buildbot/source/lede/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/toolchain.default.install.clean; fi
make[2]: Leaving directory '/home/ctp/buildbot/source/lede/package/libs/toolchain'
make[2]: Entering directory '/home/ctp/buildbot/mypackages/examples/getportal'
make[2]: Leaving directory '/home/ctp/buildbot/mypackages/examples/getportal'
make[1]: Leaving directory '/home/ctp/buildbot/source/lede'

Thanks in advance :slight_smile: