stormfetch/Makefile
CapCreeperGR 2984a7da5f Fixed chroot bugs and reduced executable size
Stormfetch will now only list CPU and memory information if available
Added 'ldflag "-w"' to go build which reduces file size
Added 'run' goal to Makefile
2024-05-15 13:25:11 +03:00

36 lines
865 B
Makefile

ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
ifeq ($(BINDIR),)
BINDIR := $(PREFIX)/bin
endif
ifeq ($(SYSCONFDIR),)
SYSCONFDIR := $(PREFIX)/etc
endif
ifeq ($(GO),)
GO := /usr/bin/go
endif
build:
mkdir -p build
$(GO) build -ldflags "-w" -o build/stormfetch stormfetch
install: build/stormfetch config/
mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(SYSCONFDIR)/stormfetch/
cp build/stormfetch $(DESTDIR)$(BINDIR)/stormfetch
cp -r config/. $(DESTDIR)$(SYSCONFDIR)/stormfetch/
compress: build/stormfetch config/
mkdir -p stormfetch/$(BINDIR)
mkdir -p stormfetch/$(SYSCONFDIR)/stormfetch/
cp build/stormfetch stormfetch/$(BINDIR)/stormfetch
cp -r config/. stormfetch/$(SYSCONFDIR)/stormfetch/
tar --owner=root --group=root -czf stormfetch.tar.gz stormfetch
rm -r stormfetch
run: build/stormfetch
build/stormfetch
clean:
rm -r build/