Need help porting software to OpenWrt, pkg_buildir is empty


I'm starting myself in the embedded world and Openwrt. I'm trying to port zerocIce middleware to Openwrt (18.06.2) but I got stuck since my build_dir folder is suddenly empty. So I think I'm doing something wrong and I'm not seeing it.

You can get the Makefile from here
It is not finished yet since I wanted it to start building and then add build_depends and try to fix the errors.

I've tried with make/package/zeroc-ice37/{check,download,prepare,compile} V=s and all of them seems to work fine but the compile which it doesn't throw and error but it shows this line.

sdk/openwrt-sdk-18.06.2-mvebu-cortexa9_gcc-7.3.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/zeroc-ice37-e9e8a21c/.autoremove 2>/dev/null >/dev/null
make[2]: [Makefile:36: compile] Error 1 (ignored)

I think it can be something with the pkg_name, pkg_source_version or I don't know how overwrite a clean operation.

Thanks in advance for the help you may provide me.

At the very least you'll need an empty define Package/zeroc-ice37/install section, otherwise the build system will not do anything.

After you defined that, make sure zeroc-ice37 is enabled in menuconfig (alternatively: echo CONFIG_PACKAGE_zeroc-ice37=m >> .config && make defconfig).

Finally issue make package/zeroc-ice37/{clean,compile} V=s and inspect build_dir/target-*/zeroc-ice37*/.

And instead of defining Build/Compile just add /cpp to PKG_BUILD_DIR?

Hello again,
Thanks for your help I added the two proposals. However if I add the cpp/ to the PKG_BUILD_DIR, it extracts the source code to $(PKG_BUILD_DIR)/cpp, so it's like I move everything inside the cpp folder.
The new Makefile looks like this one

if I do a make package/zeroc-ice37/{download,prepare} V=s seems like the PKG_BUILD_DIR is filled with the source code I'd like to built, however when I do a make package/zeroc-ice37/compile V=s it seems like the PKG_BUILD_DIR is empty, it just has a zeroc-ice37-e9e8a21c/.prepared_fa82bf978611cdf00bbe63a5536ac83a_18f1e190c5d53547fed41a3eaa76e9e file.

and then I have an error similar to the previous one:

sdk/openwrt-sdk-18.06.2-mvebu-cortexa9_gcc-7.3.0_musl_eabi.Linux-x86_64/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/zeroc-ice37-e9e8a21c//.autoremove 2>/dev/null >/dev/null
make[2]: [Makefile:39: compile] Error 1 (ignored)

Does that "autoremove" do something to delete my PKG_BUILD_DIR?
Is there a way (besides V=s argument) so I can debug everything to know what operations is cleaning my PKG_BUILD_DIR?

Many thanks.