Compare commits
4 Commits
ebbf92d92d
...
10bf83a21b
Author | SHA1 | Date |
---|---|---|
sloum | 10bf83a21b | |
sloum | 715268a8e8 | |
sloum | f6f6348c8d | |
sloum | e1d13dd927 |
|
@ -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}
|
20
README.md
20
README.md
|
@ -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`
|
||||
|
||||
|
|
Loading…
Reference in New Issue