mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			887 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			887 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
| PREFIX ?= /usr
 | |
| DESTDIR ?=
 | |
| BINDIR ?= $(PREFIX)/bin
 | |
| LIBDIR ?= $(PREFIX)/share/hilbish
 | |
| 
 | |
| build:
 | |
| 	@go build -ldflags "-s -w"
 | |
| 
 | |
| dev:
 | |
| 	@go build -ldflags "-s -w -X main.version=$(shell git describe --tags)"
 | |
| 
 | |
| hilbiline:
 | |
| 	@go build -ldflags "-s -w -X main.version=$(shell git describe --tags)+hilbiline" -tags hilbiline
 | |
| 
 | |
| install:
 | |
| 	@install -v -d "$(DESTDIR)$(BINDIR)/" && install -m 0755 -v hilbish "$(DESTDIR)$(BINDIR)/hilbish"
 | |
| 	@mkdir -p "$(DESTDIR)$(LIBDIR)"
 | |
| 	@cp libs preload.lua .hilbishrc.lua "$(DESTDIR)$(LIBDIR)" -r
 | |
| 	@grep "$(DESTDIR)$(BINDIR)/hilbish" -qxF /etc/shells || echo "$(DESTDIR)$(BINDIR)/hilbish" >> /etc/shells
 | |
| 	@echo "Hilbish Installed"
 | |
| 
 | |
| uninstall:
 | |
| 	@rm -vrf \
 | |
| 			"$(DESTDIR)$(BINDIR)/hilbish" \
 | |
| 			"$(DESTDIR)$(LIBDIR)"
 | |
| 	@sed -i '/hilbish/d' /etc/shells
 | |
| 	@echo "Hilbish Uninstalled"
 | |
| 
 | |
| clean:
 | |
| 	@go clean
 | |
| 
 | |
| all: build install
 | |
| 
 | |
| .PHONY: install uninstall build dev hilbiline clean
 |