Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix makefiles #222

Merged
merged 1 commit into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
VERSION := $(shell cat $(REPO_ROOT)/VERSION)
EFFECTIVE_VERSION := $(VERSION)+$(shell git rev-parse HEAD)
GIT_TREE_STATE := $(shell [ -z "$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)
GIT_TREE_STATE := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)
COMMIT := $(shell git rev-parse --verify HEAD)

REGISTRY := ghcr.io/mandelsoft/ocm
Expand Down
4 changes: 2 additions & 2 deletions components/demoplugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ PLATFORMS = linux/amd64 linux/arm64
REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../..
VERSION = $(shell git describe --tags --exact-match 2>/dev/null|| echo "$$(cat $(REPO_ROOT)/VERSION)-dev")
COMMIT = $(shell git rev-parse HEAD)
EFFECTIVE_VERSION = $(VERSION)-$(COMMIT)
GIT_TREE_STATE := $(shell [ -z "$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)
EFFECTIVE_VERSION = $(VERSION)+$(COMMIT)
GIT_TREE_STATE := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)

CMDSRCS=$(shell find $(REPO_ROOT)/cmds/$(NAME) -type f)
OCMSRCS=$(shell find $(REPO_ROOT)/pkg -type f) $(REPO_ROOT)/go.*
Expand Down
2 changes: 1 addition & 1 deletion components/helminstaller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ REPO_ROOT := $(shell dirname $(realpath $(l
VERSION := $(shell git describe --tags --exact-match 2>/dev/null|| echo "$$(cat $(REPO_ROOT)/VERSION)")
COMMIT := $(shell git rev-parse --verify HEAD)
EFFECTIVE_VERSION := $(VERSION)-$(COMMIT)
GIT_TREE_STATE := $(shell [ -z "$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)
GIT_TREE_STATE := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)


GEN = $(REPO_ROOT)/gen/$(NAME)
Expand Down
14 changes: 8 additions & 6 deletions components/ocmcli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ PROVIDER ?= ocm.software
GITHUBORG ?= open-component-model
COMPONENT = $(PROVIDER)/$(NAME)
OCMREPO ?= ghcr.io/$(GITHUBORG)/ocm
PLATFORMS = linux/amd64 linux/arm64 darwin/arm64 darwin/amd64
PLATFORMS = linux/amd64 linux/arm64 darwin/arm64 darwin/amd64 windows/amd64

REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../..
REPO_ROOT := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))../..
GIT_TREE_STATE = $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)
VERSION = $(shell git describe --tags --exact-match 2>/dev/null|| echo "$$(cat $(REPO_ROOT)/VERSION)")
COMMIT = $(shell git rev-parse HEAD)
EFFECTIVE_VERSION = $(VERSION)-$(COMMIT)
EFFECTIVE_VERSION = $(VERSION)+$(COMMIT)

CMDSRCS=$(shell find $(REPO_ROOT)/cmds/$(CMD) -type f)
CMDSRCS=$(shell find $(REPO_ROOT)/cmds/$(CMD) -type f) Makefile
OCMSRCS=$(shell find $(REPO_ROOT)/pkg -type f) $(REPO_ROOT)/go.*

GEN = $(REPO_ROOT)/gen/$(shell basename $(realpath .))
Expand Down Expand Up @@ -52,7 +53,7 @@ version:
.PHONY: ca
ca: $(GEN)/ca.done

$(GEN)/ca.done: $(GEN)/.exists $(GEN)/build resources.yaml $(CHARTSRCS)
$(GEN)/ca.done: $(GEN)/.exists $(GEN)/build resources.yaml $(CHARTSRCS) Makefile
$(OCM) create ca -f $(COMPONENT) "$(VERSION)" --provider $(PROVIDER) --file $(GEN)/ca
$(OCM) add resources --templater=spiff --file $(GEN)/ca VERSION="$(VERSION)" NAME="$(NAME)" COMMIT="$(COMMIT)" GEN="$(GEN)" PLATFORMS="$(PLATFORMS)" resources.yaml
@touch $(GEN)/ca.done
Expand Down Expand Up @@ -83,7 +84,8 @@ $(GEN)/.exists:
info:
@echo "ROOT: $(REPO_ROOT)"
@echo "VERSION: $(VERSION)"
@echo "COMMIT; $(COMMIT)"
@echo "COMMIT: $(COMMIT)"
@echo "GIT_TREE: $(GIT_TREE_STATE)"

.PHONY: describe
describe: $(GEN)/ctf
Expand Down
4 changes: 2 additions & 2 deletions hack/cross-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ fi

mkdir -p dist

build_matrix=("linux,amd64" "darwin,amd64" "darwin,arm64" "windows,amd64")
build_matrix=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "windows/amd64")

for i in "${build_matrix[@]}"; do
IFS=',' read os arch <<< "${i}"
IFS='/' read os arch <<< "${i}"

echo "Build $os/$arch"
bin_path="dist/ocm-$os-$arch"
Expand Down