Skip to content

Commit

Permalink
Prepare to be brew-installable
Browse files Browse the repository at this point in the history
  • Loading branch information
gdanko authored and gdanko committed Dec 17, 2024
1 parent d744a45 commit ad133e1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,21 @@ build: guard-DFIMAGE_VERSION mod-tidy clean
@echo "Building dfimage"
@echo "=================================================\n"

@if [ ! -d "${GOOS}" ]; then \
mkdir "${GOOS}"; \
@if [ ! -d "bin" ]; then \
mkdir "bin"; \
fi
GOOS=${GOOS} GOARCH=${GOARCH} go build -o "${GOOS}/dfimage"
GOOS=${GOOS} GOARCH=${GOARCH} go build -o "bin/dfimage"
sleep 2
tar -C "${GOOS}" -czvf "dfimage_${DFIMAGE_VERSION}_${GOOS}_${GOARCH}.tgz" dfimage; \
tar -czvf "dfimage_${DFIMAGE_VERSION}_${GOOS}_${GOARCH}.tgz" bin; \

.PHONY: clean
clean:
@echo "================================================="
@echo "Cleaning dfimage"
@echo "=================================================\n"
@for OS in darwin linux; do \
if [ -f $${OS}/dfimage ]; then \
rm -f $${OS}/dfimage; \
fi; \
done
@if [ -f bin/dfimage ]; then \
rm -f bin/dfimage; \
fi; \

.PHONY: clean-all
clean-all: clean
Expand Down

0 comments on commit ad133e1

Please sign in to comment.