💾 Archived View for anachronauts.club › cgi-bin › repos › cgi › gmikit.git › tree › trunk › Makefile captured on 2022-01-08 at 13:44:51. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-05)

-=-=-=-=-=-=-

gmikit.git

git @ anachronauts.club

summary

tree

log

refs

gmikit.git/Makefile | 2 KB

view raw

 1 .PHONY: all check install clean FORCE
 2 
 3 PREFIX := /usr/local
 4 SYSCONFDIR := $(PREFIX)/etc
 5 DATADIR := $(PREFIX)/share
 6 GMIKITCONFDIR := $(SYSCONFDIR)/gmikit
 7 GMIKITDATADIR := $(DATADIR)/gmikit
 8 BINDIR := $(PREFIX)/bin
 9 SBINDIR := $(PREFIX)/sbin
10 BINPREFIX := gmikit-
11 INSTALLFLAGS :=
12 EXTRAGOLDFLAGS :=
13 STAGE := stage
14 PKGDIR := out
15 
16 all: convert gateway get
17 
18 clean:
19 	-rm convert gateway get
20 
21 check:
22 	go test
23 
24 FORCE:
25 
26 convert: FORCE
27 	go build -ldflags="$(EXTRAGOLDFLAGS)" -o $@ anachronauts.club/repos/gmikit/cmd/convert
28 
29 gateway: FORCE
30 	go build -ldflags="$(EXTRAGOLDFLAGS) -X main.confDir=$(GMIKITCONFDIR) -X main.dataDir=$(GMIKITDATADIR)" -o $@ anachronauts.club/repos/gmikit/cmd/gateway
31 
32 get: FORCE
33 	go build -ldflags="$(EXTRAGOLDFLAGS)" -o $@ anachronauts.club/repos/gmikit/cmd/get
34 
35 install: all
36 	install $(INSTALLFLAGS) -d $(BINDIR) $(SBINDIR) $(GMIKITCONFDIR) $(GMIKITDATADIR)/templates
37 	install $(INSTALLFLAGS) -m 755 convert $(BINDIR)/$(BINPREFIX)convert
38 	install $(INSTALLFLAGS) -m 755 gateway $(SBINDIR)/$(BINPREFIX)gateway
39 	install $(INSTALLFLAGS) -m 755 get $(BINDIR)/$(BINPREFIX)get
40 	install $(INSTALLFLAGS) -m 644 example/gateway.conf $(GMIKITCONFDIR)/gateway.conf.sample
41 	install $(INSTALLFLAGS) -m 644 example/templates/1x.html $(GMIKITDATADIR)/templates
42 	install $(INSTALLFLAGS) -m 644 example/templates/2x.html $(GMIKITDATADIR)/templates
43 	install $(INSTALLFLAGS) -m 644 example/templates/3x.html $(GMIKITDATADIR)/templates
44 	install $(INSTALLFLAGS) -m 644 example/templates/4x.html $(GMIKITDATADIR)/templates
45 	install $(INSTALLFLAGS) -m 644 example/templates/5x.html $(GMIKITDATADIR)/templates
46 	install $(INSTALLFLAGS) -m 644 example/templates/error.html $(GMIKITDATADIR)/templates
47 	install $(INSTALLFLAGS) -m 644 example/templates/response.html $(GMIKITDATADIR)/templates
48 	install $(INSTALLFLAGS) -m 644 example/templates/style.css $(GMIKITDATADIR)/templates
49 	install $(INSTALLFLAGS) -m 644 example/templates/unknown.html $(GMIKITDATADIR)/templates
50 
51 package:
52 	-rm install.log
53 	$(MAKE) PREFIX=$(STAGE)$(PREFIX) INSTALLFLAGS=-Minstall.log install
54 	cat MANIFEST > $(STAGE)/+MANIFEST
55 	echo prefix $(PREFIX) >> $(STAGE)/+MANIFEST
56 	awk '/type=file/ { print substr($1, index($1, "$(PREFIX)")) }' install.log > $(STAGE)/plist
57 	mkdir -p $(PKGDIR)
58 	pkg create -o "$(PKGDIR)" -r "$(STAGE)" -M "$(STAGE)/+MANIFEST" -p "$(STAGE)/plist"
59 	pkg repo "$(PKGDIR)"
60