Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip
Browse files Browse the repository at this point in the history
Signed-off-by: francois  samin <francois.samin@corp.ovh.com>
fsamin committed Aug 18, 2022
1 parent e97ccde commit 90542ea
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 4 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean doc modclean mod goinstall build dist deb package_contrib
.PHONY: clean doc modclean mod goinstall build dist deb

TARGET_OS = $(if ${OS},${OS},windows darwin linux freebsd)
TARGET_ARCH = $(if ${ARCH},${ARCH},amd64 arm 386 arm64)
@@ -40,20 +40,14 @@ ALL_DIST := $(ALL_DIST) $(UI_DIST)
ALL_DIST := $(ALL_DIST) $(CONTRIB_DIST)
ALL_TARGETS := $(foreach DIST,$(ALL_DIST),$(addprefix $(TARGET_DIR),$(notdir $(DIST))))

CONTRIB_ALL_FILES := $(wildcard contrib/dist/*)

build:
$(info Building CDS Components for $(TARGET_OS) - $(TARGET_ARCH))
$(MAKE) build_ui -j1
$(MAKE) build_engine -j4
$(MAKE) build_worker -j4
$(MAKE) build_cli -j4
$(MAKE) build_contrib -j4
$(MAKE) package_contrib

package_contrib: $(TARGET_DIR)
$(info copying $(CONTRIB_ALL_FILES))
@for f in ${CONTRIB_ALL_FILES} ; do echo "copying $$f to ${TARGET_DIR}`basename $$f`"; cp $$f ${TARGET_DIR}`basename $$f`; done
$(MAKE) package -C contrib TARGET_DIST="$(abspath $(TARGET_DIR))"

build_ui:
$(MAKE) build -C ui
@@ -74,10 +68,8 @@ define get_dist_from_target
$(filter %/$(notdir $(1)), $(ALL_DIST))
endef

$(TARGET_DIR):
$(ALL_TARGETS):
@mkdir -p $(TARGET_DIR)

$(ALL_TARGETS): $(TARGET_DIR)
$(info copying $(call get_dist_from_target, $@) to $@)
@cp -f $(call get_dist_from_target, $@) $@

@@ -124,4 +116,4 @@ tidy:
@echo "Running tidy on tests/fixtures/04SCWorkflowRunSimplePlugin"
@(cd tests/fixtures/04SCWorkflowRunSimplePlugin && go mod tidy)
@(cd sdk/interpolate && go mod tidy)
@(cd tools/smtpmock && go mod tidy)
@(cd tools/smtpmock && go mod tidy)
10 changes: 9 additions & 1 deletion contrib/Makefile
Original file line number Diff line number Diff line change
@@ -10,9 +10,17 @@ clean:
ALL_DISTS := $(shell find . -type d -name "dist")
ALL_FILES := $(foreach d, $(ALL_DISTS), $(wildcard $(d)/*))

build:
build:
$(MAKE) build -C grpcplugins/action OS="$(OS)" ARCH="$(ARCH)"
$(MAKE) build -C integrations OS="$(OS)" ARCH="$(ARCH)"

$(TARGET_DIST):
@mkdir -p $(TARGET_DIST)

ALL_TARGETS := $(foreach f, $(ALL_FILES), $(TARGET_DIST)/$(notdir $(f)))

$(ALL_TARGETS): $(TARGET_DIST)
$(info moving $(filter %/$(notdir $@), $(ALL_FILES)) to $@)
@mv -f $(filter %/$(notdir $@), $(ALL_FILES)) $@

package: $(ALL_TARGETS) $(TARGET_DIST)

0 comments on commit 90542ea

Please sign in to comment.