Skip to content

Commit

Permalink
fix(driverkit/makefile): pass right archs to generate targets
Browse files Browse the repository at this point in the history
Signed-off-by: Massimiliano Giovagnoli <me@maxgio.it>
  • Loading branch information
maxgio92 authored and poiana committed Jun 27, 2022
1 parent ad7a1f3 commit 86b9375
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions driverkit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ ifeq ($(DRIVERKIT),)
DRIVERKIT := "/bin/driverkit"
endif

ALL_ARCHS := x86_64 aarch64

# Recursive wildcard
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))

# Equals function
eq = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))

CONFIGS := $(call rwildcard,config/*,*.yaml)
VERSIONS := $(patsubst config/%,%,$(sort $(dir $(wildcard config/*/))))
VERSIONS := $(VERSIONS:/=)
TARGET_VERSION ?= *
TARGET_DISTRO ?= *
TARGET_KERNEL ?= *
TARGET_ARCH ?= *
TARGET_ARCHS := $(if $(call eq,$(TARGET_ARCH),*),$(ALL_ARCHS),$(TARGET_ARCH))
TARGET_HEADERS ?=
S3_DRIVERS_BUCKET ?= "falco-distribution"
S3_DRIVERS_KEY_PREFIX ?= "driver"
Expand Down Expand Up @@ -45,13 +51,16 @@ publish: $(addprefix publish_,$(VERSIONS))
publish_s3: $(addprefix publish_s3_,$(VERSIONS))

generate:
$(foreach VERSION,$(VERSIONS),\
utils/generate -a $(TARGET_ARCH) -k ${TARGET_KERNEL} -d ${TARGET_DISTRO} -h ${TARGET_HEADERS} -v ${VERSION}; \
$(foreach ARCH,$(TARGET_ARCHS),\
$(foreach VERSION,$(VERSIONS),\
utils/generate -a '$(ARCH)' -k '${TARGET_KERNEL}' -d '${TARGET_DISTRO}' -h '${TARGET_HEADERS}' -v '${VERSION}'; \
)\
)

generate/auto:
utils/scrape_and_generate "x86_64"
utils/scrape_and_generate "aarch64"
$(foreach ARCH,$(TARGET_ARCHS),\
utils/scrape_and_generate $(ARCH); \
)

cleanup:
utils/cleanup -p ${BINTRAY_SECRET} $(addprefix -v ,$(VERSIONS))
Expand Down

0 comments on commit 86b9375

Please sign in to comment.