1
0
Fork 0

Compare commits

...

4 Commits

Author SHA1 Message Date
sloum 10bf83a21b Updates readme 2021-06-23 22:54:32 -07:00
sloum 715268a8e8 Adds Makefile, doesnt support bsd make 2021-06-23 22:51:41 -07:00
sloum f6f6348c8d Adds more usage instructions 2021-06-23 20:50:17 -07:00
sloum e1d13dd927 Updates build instructions 2021-06-23 20:46:29 -07:00
3 changed files with 52 additions and 8 deletions

37
Makefile Normal file
View File

@ -0,0 +1,37 @@
GOCMD := go
BINARY := gnums
PREFIX := /usr/local
EXEC_PREFIX := ${PREFIX}
BINDIR := ${EXEC_PREFIX}/bin
DATAROOTDIR := ${PREFIX}/share
MANDIR := ${DATAROOTDIR}/man
MAN1DIR := ${MANDIR}/man1
UPX := $(shell upx -V 2> /dev/null)
.PHONY: build
build:
${GOCMD} build -ldflags "-w -s" -o ${BINARY}
.PHONY: compress
compress: ${BINARY}
ifdef UPX
@echo Compressing the binary with UPX
@upx ${BINARY}
else
@echo Skipping upx compression
endif
.PHONY: install
install: build compress
install -d ${DESTDIR}${BINDIR}
install -m 0755 ./${BINARY} ${DESTDIR}${BINDIR}
.PHONY: clean
${GOCMD} clean
.PHONY: uninstall
uninstall: clean
rm -f ${DESTDIR}${BINDIR}/${BINARY}

View File

@ -10,6 +10,8 @@ On initial load some sensible defaults will be set up. Other options are avialab
At present there is no keyboard input. This is on the TODO list and should get added in the near future (after all, who really wants to use a mouse for anything?).
Most of the keys can be figured out if you don't know what they are already. I will mention that the enter key will add the currently typed in number to the top of the stack. If you have a number typed in, but have not hit enter, and you use a non-numeric/non-enter key (+, swap, sqrt, etc) the number will automatically be added to the top of the stack before the function is run.
## Dependencies
- Go >= 1.16
@ -23,17 +25,21 @@ At present there is no keyboard input. This is on the TODO list and should get a
## Building
Minor build variations can be found for each system. Using `upx` will reduce binary size by a good bit for any of these systems. After running the build command, and optionally running upx, move the resulting binary onto your path and you are good to go. Makefile coming soon<sup>TM</sup>.
Minor build variations can be found for each system. Using upx (`apt install upx` or `brew install upx`) will reduce binary size by a good bit for any of these systems. After running the build command, and optionally running upx, move the resulting binary onto your path and you are good to go. Makefile coming soon<sup>TM</sup>.
### OSX
### OSX / Linux
`go build -ldflags "-s -w" .`
You should be able to just run `sudo make install`. If you just want to build locally you can run: `make && make compress`
Alternatively, you can just run a few things yourself and avoid make altogether:
`go build -ldflags "-s -w" -o gnums && upx gnums`
You would then need to move the executable to where you want it.
### Windows
`go build -ldflags "-s -w -H=windowsgui -extldflags=-static" .`
Windows functionality and build steps are unconfirmed. As is the Makefile for windows usage. The following _should_ work. The makefile instructions provided for OSX/Linux _might_ work.
### Linux
`go build`
`go build -ldflags "-s -w -H=windowsgui -extldflags=-static" -o gnums.exe`

View File

@ -167,8 +167,9 @@ func loop() {
g.Row(
g.Label("gnums v" + Version),
),
g.Dummy(0, 5),
g.Dummy(0, 8),
ComboView.Size(-1).Flags(1 << 14),
g.Dummy(0, 8),
g.Row(
g.Condition(ShowStack, g.Layout{
g.Row(