Skip to content

Commit

Permalink
Makefile works on Mac and Linux.
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Mouat <adrian@chainguard.dev>
  • Loading branch information
amouat committed May 16, 2023
1 parent 07548a8 commit 1ae1b4c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Some nice defines for the "make install" target
PREFIX ?= /usr

OS := $(shell uname -s)
ifeq ($(OS), Darwin)
PREFIX ?= /usr/local
else
PREFIX ?= /usr
endif
BINDIR ?= ${PREFIX}/bin


# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
Expand Down Expand Up @@ -86,9 +93,10 @@ melange: $(SRCS) ## Builds melange

.PHONY: install
install: $(SRCS) ## Installs melange into BINDIR (default /usr/bin)
install -Dm755 melange ${DESTDIR}${BINDIR}/melange
install -dm755 ${DESTDIR}/usr/share/melange/pipelines
tar c -C pkg/build/pipelines . | tar x -C "${DESTDIR}/usr/share/melange/pipelines"
mkdir -p ${DESTDIR}${BINDIR}
cp melange ${DESTDIR}${BINDIR}/melange
chmod 755 ${DESTDIR}${BINDIR}/melange


#####################
# lint / test section
Expand Down

0 comments on commit 1ae1b4c

Please sign in to comment.