aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-03-13 21:17:51 +0100
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-03-18 11:58:15 +0100
commitb3d0af2de29711abfe6da373786d365d9a6de198 (patch)
tree6b8c59999b323e426a1b64781f0b02fc70f229df /Makefile
parentecabdfaf915887dbd91b6742d0fc1bf81cf336a0 (diff)
downloadjnfilter-b3d0af2de29711abfe6da373786d365d9a6de198.tar.gz
jnfilter-b3d0af2de29711abfe6da373786d365d9a6de198.tar.bz2
jnfilter-b3d0af2de29711abfe6da373786d365d9a6de198.zip
feat: Rewrite to golangv0.1.3
I have found a nice lib in go to handle XML so I migrate to it. Go is ages easier to deploy then python.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 20 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 7922953..69b82d9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,25 +1,26 @@
+BIN?=jnfilter
+PREFIX?=/usr/local
+BINDIR?=$(PREFIX)/bin
-rpm: rpm_dist
- rpmbuild -bb \
- ./build/bdist.linux-x86_64/rpm/SPECS/jnfilter.spec \
- --define "_topdir $(PWD)/build/bdist.linux-x86_64/rpm/"
+OUT=./bin/$(BIN)
+SERVER=./main.go
-rpm_dist:
- python setup.py bdist_rpm
+GO_BUILD=go build -v -ldflags '-w -s'
+GO_RUN=go run -v
+all: build
-clean:
- python setup.py clean --all
- rm -rf dist jnfilter.egg-info
+install: build
+ install -Dm755 $(OUT) $(BINDIR)/$(BIN)
-docs:
- pandoc -s \
- --include-in-header=docs/bamboo.min.css \
- --metadata title="Filtro para Nerdcast" \
- --template docs/template.html \
- -s README.md \
- -o index.html
+build:
+ $(GO_BUILD) -o $(OUT) $(SERVER)
-install_deps:
- dnf install -y rpmdevtools rpmlint python
+compress: build
+ upx -1 $(OUT)
+
+compress_into_oblivion: build
+ upx --best --ultra-brute $(OUT)
+
+run: sass tmpl
+ $(GO_RUN) $(SERVER)
-.PHONY: docs