Revision 413a52d0eed8582e4c1511e210d7e3f36fe2fe3a authored by Jorropo on 14 December 2023, 14:31:42 UTC, committed by GitHub on 14 December 2023, 14:31:42 UTC
2 parent s e70db65 + 87069b5
Raw File
Rules.mk
include mk/header.mk

$(d)_plugins:=
$(d)_plugins_so:=$(addsuffix .so,$($(d)_plugins))
$(d)_plugins_main:=$(addsuffix /main/main.go,$($(d)_plugins))


$($(d)_plugins_main): d:=$(d)
$($(d)_plugins_main):
	$(d)/gen_main.sh "$(dir $@).." "$(call go-pkg-name,$(dir $@)/..)"
	$(GOCC) fmt $@ >/dev/null

$($(d)_plugins_so): %.so : %/main/main.go
$($(d)_plugins_so): $$(DEPS_GO) ALWAYS
	$(GOCC) build -buildmode=plugin -pkgdir "$(GOPATH)/pkg/linux_amd64_dynlink" $(go-flags-with-tags) -o "$@" "$(call go-pkg-name,$(basename $@))/main"
	chmod +x "$@"

CLEAN += $($(d)_plugins_so)
CLEAN += $(foreach main_dir,$($(d)_plugins_main),$(dir $(main_dir)))

build_plugins: $($(d)_plugins_so)


include mk/footer.mk
back to top