kernel: modules: package driver for MediaTek T7xx PCIe 5G modem
[openwrt/staging/nbd.git] / package / Makefile
index 209be34674747a728606f0c8b2d7dbcd2930ba7b..d72ce09a816b42ad879c507c1e9517db3dbe33de 100644 (file)
@@ -59,6 +59,7 @@ $(curdir)/merge-index: $(curdir)/merge
        (cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
 
 ifndef SDK
+  $(curdir)//compile = $(STAGING_DIR)/.prepared $(BIN_DIR)
   $(curdir)/compile: $(curdir)/system/opkg/host/compile
 endif
 
@@ -92,6 +93,10 @@ $(curdir)/index: FORCE
                        $(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
                        { echo ""; echo ""; } >> Packages;; \
                esac; \
+               echo -n '{"architecture": "$(ARCH_PACKAGES)", "packages":{' > index.json; \
+               sed -n -e 's/^Package: \(.*\)$$/"\1":/p' -e 's/^Version: \(.*\)$$/"\1",/p' Packages | tr '\n' ' ' >> index.json; \
+               echo '}}' >> index.json; \
+               sed -i 's/, }}/}}/' index.json; \
                gzip -9nc Packages > Packages.gz; \
        ); done
 ifdef CONFIG_SIGNED_PACKAGES
@@ -102,6 +107,14 @@ ifdef CONFIG_SIGNED_PACKAGES
                $(STAGING_DIR_HOST)/bin/usign -S -m Packages -s $(BUILD_KEY); \
        ); done
 endif
+ifdef CONFIG_JSON_CYCLONEDX_SBOM
+       @echo Creating CycloneDX package SBOMs...
+       @for d in $(PACKAGE_SUBDIRS); do ( \
+               [ -d $$d ] && \
+                       cd $$d || continue; \
+               $(SCRIPT_DIR)/package-metadata.pl pkgcyclonedxsbom Packages.manifest > Packages.bom.cdx.json || true; \
+       ); done
+endif
 
 $(curdir)/flags-install:= -j1