media/patreon-dl/gui/makefile

46 lines
1.6 KiB
Makefile

# Copyright 2024 Brian Newman. All rights reserved.
# ################################################################################
# GOARCH=amd64 GOOS=windows go build -o ${BINNAME}-linux-${VERSION}.exe -ldflags "-X main.appname=${BINNAME} -X main.version=${VERSION}" *.go
# rm ${BINNAME}-linux-${VERSION}.exe
# ################################################################################
APPNAME := patreon-dl
BINNAME := io.cdmnky.net.${APPNAME}-gui
VERSION := $(shell cat VERSION)
BUILD := $(shell date +"%Y.%m.%d")
LINKNAME := ${HOME}/.bin/${APPNAME}/${APPNAME}-gui
PUBDIR := ${HOME}/Public/io.cdmnky/v1/media/${APPNAME}
build:
GOARCH=amd64 GOOS=linux go build -o ./bin/${BINNAME}-linux-${VERSION}.bin -ldflags "-X main.appname=${APPNAME} -X main.version=${VERSION} -X main.build=${BUILD}" ./src/*.go
run:
GOARCH=amd64 GOOS=linux go build -o ./bin/${BINNAME} ./src/*.go
clear; ./bin/${BINNAME}
install:
ifneq ("$(wildcard $(LINKNAME))","")
rm ${LINKNAME}
endif
mkdir -p ${HOME}/.bin/${APPNAME}/
cp ./bin/${BINNAME}-linux-${VERSION}.bin ${HOME}/.bin/${APPNAME}/
ln -s ${HOME}/.bin/${APPNAME}/${BINNAME}-linux-${VERSION}.bin ${LINKNAME}
publish:
ifneq ("$(wildcard ./bin/${BINNAME}-linux-${VERSION}.bin)","")
mkdir -p ${PUBDIR}
tar -cf ${PUBDIR}/${BINNAME}-linux-${VERSION}.tar -C ./bin/ ${BINNAME}-linux-${VERSION}.bin config.json install.sh patreon-dl-gui.desktop patreon-dl.png
endif
clean:
go clean
ifneq ("$(wildcard assets.go)","")
rm assets.go*
endif
ifneq ("$(wildcard ./bin/${BINNAME}-linux-${VERSION}.bin)","")
rm ./bin/${BINNAME}-linux-${VERSION}.bin
endif
ifneq ("$(wildcard ./bin/${BINNAME})","")
rm ./bin/${BINNAME}
endif
all: build