Added needed .PHONY to Makefile

Was having issues with it saying it was already built after a change
stable
Justin Reichardt 2022-06-12 20:48:31 -05:00
parent 1c2888ab9f
commit 3859714729
1 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,7 @@ TARBALLNAME=$(TARBALLPREFIX).tar.gz
GOBUILDFLAGS= GOBUILDFLAGS=
GITOFF=0 GITOFF=0
.PHONY: build
build: build:
if [ ! -d $(PROJROOT)/build ]; then \ if [ ! -d $(PROJROOT)/build ]; then \
mkdir -p $(PROJROOT)build/share/rhosts/systemd $(PROJROOT)build/bin \ mkdir -p $(PROJROOT)build/share/rhosts/systemd $(PROJROOT)build/bin \
@ -22,11 +23,13 @@ build:
cd $(PROJROOT)src && go build -o $(PROJROOT)build/bin/ $(GOBUILDFLAGS) ./ cd $(PROJROOT)src && go build -o $(PROJROOT)build/bin/ $(GOBUILDFLAGS) ./
cp -r $(PROJROOT)src/systemd $(PROJROOT)/build/share/rhosts/ cp -r $(PROJROOT)src/systemd $(PROJROOT)/build/share/rhosts/
.PHONY: build-win
build-win: build-win:
if [ ! -d $(PROJROOT)/build ]; then \ if [ ! -d $(PROJROOT)/build ]; then \
mkdir -p $(PROJROOT)build \ mkdir -p $(PROJROOT)build \
;fi ;fi
cd $(PROJROOT)src && GOOS=windows go build -o $(PROJROOT)build/ $(GOBUILDFLAGS) ./ cd $(PROJROOT)src && GOOS=windows go build -o $(PROJROOT)build/ $(GOBUILDFLAGS) ./
.PHONY: install
install: build install: build
install -D $(PROJROOT)build/bin/rhosts $(BINDIR)/ install -D $(PROJROOT)build/bin/rhosts $(BINDIR)/
cp -r $(PROJROOT)build/share/rhosts $(DATADIR) cp -r $(PROJROOT)build/share/rhosts $(DATADIR)
@ -39,6 +42,7 @@ install: build
if [ ! -h /usr/lib/systemd/system/rhosts.timer ]; then \ if [ ! -h /usr/lib/systemd/system/rhosts.timer ]; then \
ln -s $(DATADIR)rhosts/systemd/rhosts.timer /usr/lib/systemd/system/rhosts.timer \ ln -s $(DATADIR)rhosts/systemd/rhosts.timer /usr/lib/systemd/system/rhosts.timer \
;fi ;fi
.PHONY: uninstall
uninstall: uninstall:
if [ -f $(BINDIR)/rhosts ]; then \ if [ -f $(BINDIR)/rhosts ]; then \
rm $(BINDIR)/rhosts \ rm $(BINDIR)/rhosts \
@ -55,6 +59,7 @@ uninstall:
if [ -h /usr/lib/systemd/system/rhosts.timer ]; then \ if [ -h /usr/lib/systemd/system/rhosts.timer ]; then \
rm /usr/lib/systemd/system/rhosts.timer \ rm /usr/lib/systemd/system/rhosts.timer \
;fi ;fi
.PHONY: clean
clean: clean:
if [ -d $(PROJROOT)build ]; then \ if [ -d $(PROJROOT)build ]; then \
rm -r $(PROJROOT)build \ rm -r $(PROJROOT)build \
@ -65,6 +70,7 @@ clean:
if [ -f $(PROJROOT)$(TARBALLNAME) ]; then \ if [ -f $(PROJROOT)$(TARBALLNAME) ]; then \
rm $(PROJROOT)$(TARBALLNAME) \ rm $(PROJROOT)$(TARBALLNAME) \
;fi ;fi
.PHONY: dist
dist: clean dist: clean
if [ -d $(PROJROOT).git ] && [ $(GITOFF) = 0 ]; then \ if [ -d $(PROJROOT).git ] && [ $(GITOFF) = 0 ]; then \
git archive --format=tar.gz -o $(PROJROOT)$(TARBALLNAME) --prefix=$(TARBALLPREFIX)/ `git branch --show-current` \ git archive --format=tar.gz -o $(PROJROOT)$(TARBALLNAME) --prefix=$(TARBALLPREFIX)/ `git branch --show-current` \