Target specific package compilation by including/excluding dependent packages

We have some common packages meant for x86 and ARM target. Those common packages have some dependant package meant for ARM alone and not needed for x86.

What's the best way I can compile the common packages by including/excluding dependent package?

I tried adding @!TARGET_x86 under DEPENDS, no luck.

Tried adding ifdef to skip copying of files during install as below but its not working:

ifdef CONFIG_TARGET_x86
define Build/InstallDev
    $(INSTALL_DIR) $(1)/usr/lib
    $(INSTALL_BIN) $(OBJ)/libtransport.so* $(1)/usr/lib/
endef

define Package/libtransport/install
    $(INSTALL_DIR) $(1)/usr/lib
    $(INSTALL_BIN) files/XXX.so* $(1)/usr/lib/
endef
endif

The makefiles I've seen doing that sort of selection use the in-line checks, like this: https://github.com/openwrt/packages/blob/master/net/snort3/Makefile#L30

1 Like