Fixed issue with Makefile creating Windows executable

Also update the readme to reflect the new changes
stable
Justin Reichardt 2022-06-12 22:37:46 -05:00
parent dab9a932a2
commit 765614c903
2 changed files with 17 additions and 9 deletions

View File

@ -13,22 +13,21 @@ TARBALLNAME=$(TARBALLPREFIX).tar.gz
GOBUILDFLAGS=
GITOFF=0
.PHONY: version
version:
echo "package main\nvar version string=\"$(VERSION)\"" > $(PROJROOT)src/version.go
.PHONY: build
build:
build: version
if [ ! -d $(PROJROOT)/build ]; then \
mkdir -p $(PROJROOT)build/share/rhosts/systemd $(PROJROOT)build/bin \
;fi
echo "package main\nvar version string=\"$(VERSION)\"" > $(PROJROOT)src/version.go
cd $(PROJROOT)src && go build -o $(PROJROOT)build/bin/ $(GOBUILDFLAGS) ./
cp -r $(PROJROOT)src/systemd $(PROJROOT)/build/share/rhosts/
.PHONY: build-win
build-win:
if [ ! -d $(PROJROOT)/build ]; then \
mkdir -p $(PROJROOT)build \
;fi
cd $(PROJROOT)src && GOOS=windows go build -o $(PROJROOT)build/ $(GOBUILDFLAGS) ./
build-win: version
cd $(PROJROOT)src && GOOS=windows go build -o $(PROJROOT) $(GOBUILDFLAGS) ./
.PHONY: install
install: build
install -D $(PROJROOT)build/bin/rhosts $(BINDIR)/
@ -64,6 +63,9 @@ clean:
if [ -d $(PROJROOT)build ]; then \
rm -r $(PROJROOT)build \
;fi
if [ -f $(PROJROOT)rhosts.exe ]; then \
rm -r $(PROJROOT)rhosts.exe \
;fi
if [ -f $(PROJROOT)src/version.go ]; then \
rm -r $(PROJROOT)src/version.go \
;fi

View File

@ -37,6 +37,7 @@ Runs in daemon mode, refreshing every 24hrs (1440 minutes**
Changes the daemon refresh time
## How to Install
### Linux
Build Dependencies:
@ -47,12 +48,17 @@ Linux/Systemd:
make install
For Windows on Linux:
Build for Windows on Linux:
make build-win
### Windows
Build Dependencies:
- Requires go https://go.dev/doc/install#windows
Windows:
Requires go https://go.dev/doc/install#windows
cd src
go build .