This repository has been archived by the owner on Jun 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (43 loc) · 1.98 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export
LDFLAGS := -static
OBJTYPE := x86_64
PREFIX := $(realpath $(dir $(firstword $(MAKEFILE_LIST))))
MANPREFIX := $(PREFIX)/man
PLAN9 := $(PREFIX)/vendor/9base
YACC := $(PREFIX)/vendor/9base/yacc/yacc -S
EDIT := null
GO111MODULE := off
.PHONY: all deps permissions 9base es mawk kryptgo bluemonday-cli cgd clean
all: permissions deps
deps: 9base es mawk kryptgo bluemonday-cli cgd
9base:
$(MAKE) -C vendor/9base LDFLAGS=$(LDFLAGS) OBJTYPE=$(OBJTYPE) PREFIX=$(PREFIX) MANPREFIX=$(MANPREFIX) install
es: 9base
cd vendor/es && ./configure --bindir=$(PREFIX)/bin --mandir=$(MANPREFIX)
$(MAKE) -C vendor/es install
mawk:
touch vendor/mawk/array.c vendor/mawk/array.h vendor/mawk/parse.c vendor/mawk/parse.h
cd vendor/mawk && ./configure --prefix=$(PREFIX) --mandir=$(MANPREFIX) --program-transform-name='s/mawk/awk/'
$(MAKE) -C vendor/mawk install
kryptgo:
go get -u golang.org/x/crypto/bcrypt
cd vendor/kryptgo && go build -ldflags "-extldflags -static"
mkdir -p $(PREFIX)/bin && cp vendor/kryptgo/kryptgo $(PREFIX)/bin/
bluemonday-cli:
go get -u github.com/microcosm-cc/bluemonday
cd vendor/bluemonday-cli && go build -ldflags "-extldflags -static"
mkdir -p $(PREFIX)/bin && cp vendor/bluemonday-cli/bluemonday-cli $(PREFIX)/bin/bluemonday
cgd:
cd vendor/cgd && go build -ldflags "-linkmode external -extldflags -static"
mkdir -p $(PREFIX)/bin && cp vendor/cgd/cgd $(PREFIX)/bin/
permissions:
find . $(PREFIX) -type d -exec chmod 2750 {} ';'
find . $(PREFIX) -type f -exec chmod 640 {} ';'
chmod 750 vendor/es/configure vendor/mawk/configure $(PREFIX)/app/es/kwerc.es
clean:
$(MAKE) -C vendor/9base PREFIX=$(PREFIX) MANPREFIX=$(MANPREFIX) uninstall clean
rm $(PREFIX)/bin/es $(PREFIX)/bin/esdebug $(MANPREFIX)/man1/es.1; $(MAKE) -C vendor/es clean
$(MAKE) -C vendor/mawk uninstall clean
rm $(PREFIX)/bin/kryptgo; cd vendor/kryptgo && go clean
rm $(PREFIX)/bin/bluemonday; cd vendor/bluemonday-cli && go clean
rm $(PREFIX)/bin/cgd; cd vendor/cgd && go clean