-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
146 lines (123 loc) · 3.82 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#
# Synopsis:
# Root makefile for setspace clients and spider environment.
# See:
# local-linux.mk.example
# local-darwin.mk.example
# Note:
# DASH_DNS_VHOST_SUFFIX need to be replaced with MAKE_WWW.
#
include local.mk
include setspace.mk
# Note: need to set UNAME elsewhere, as blobio does.
ifeq "$(shell uname)" "Linux"
RT_LINK=-lrt
endif
_MAKE=$(MAKE) $(MFLAGS)
MKMK=setspace.mkmk
SBINs := $(shell (. ./$(MKMK) && echo $$SBINs))
LIBs := $(shell (. ./$(MKMK) && echo $$LIBs))
LIBEXECs := $(shell (. ./$(MKMK) && echo $$LIBEXECs))
SRCs := $(shell (. ./$(MKMK) && echo $$SRCs))
BINs := $(shell (. ./$(MKMK) && echo $$BINs))
COMPILEs := $(shell (. ./$(MKMK) && echo $$COMPILEs))
all: check-local $(COMPILEs) $(CGI)
cd schema && $(_MAKE) all
check-local:
@test -n "$(PDFBOX_APP2_JAR)" || \
(echo "make var not defined: PDFBOX_APP2_JAR"; false)
@test -n "$(PGHOME)" || \
(echo "make var not defined: PGHOME"; false)
@test -n "$(GODIST)" || \
(echo "make var not defined: GODIST"; false)
@test -r $(PDFBOX_APP2_JAR) || \
(echo "can not read pdfbox app jar: $(PDFBOX_APP2_JAR)"; false)
@test -d $(PGHOME) || \
(echo "can not find PGHOME dir: $(PGHOME)"; false)
@test -d $(GODIST) || \
(echo "can not find GODIST dir: $(GODIST)"; false)
ifdef DASH_DNS_VHOST_SUFFIX
cd www && $(_MAKE) all
endif
clean:
rm -f $(COMPILEs) $(CGI) spin-wait-blob.c
cd schema && $(_MAKE) clean
ifdef DASH_DNS_VHOST_SUFFIX
cd www && $(_MAKE) clean
endif
install-dirs:
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
-d $(SETSPACE_PREFIX)/bin
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
-d $(SETSPACE_PREFIX)/sbin
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
-d $(SETSPACE_PREFIX)/schema
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
-d $(SETSPACE_PREFIX)/lib
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
-d $(SETSPACE_PREFIX)/libexec
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
-d $(SETSPACE_PREFIX)/etc
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
-d $(SETSPACE_PREFIX)/src
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
-d $(SETSPACE_PREFIX)/tmp
ln -fs $(JMSCOTT_ROOT) $(SETSPACE_PREFIX)
install: all
$(_MAKE) install-dirs
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
$(SBINs) \
$(SETSPACE_PREFIX)/sbin
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
$(BINs) \
$(SETSPACE_PREFIX)/bin
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
$(LIBs) \
$(SETSPACE_PREFIX)/lib
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
$(LIBEXECs) \
$(SETSPACE_PREFIX)/libexec
install -g $(SETSPACE_GROUP) -o $(SETSPACE_USER) \
$(SRCs) \
$(SETSPACE_PREFIX)/src
cd schema && $(_MAKE) install
ifdef DASH_DNS_VHOST_SUFFIX
cd www && $(_MAKE) install
endif
append-brr: append-brr.c common.c
cc $(CFLAGS) -o append-brr append-brr.c
flip-tail: flip-tail.c common.c
cc -o flip-tail $(CFLAGS) flip-tail.c
file-stat-size: file-stat-size.c common.c
cc -o file-stat-size $(CFLAGS) file-stat-size.c
dec2pgbit: dec2pgbit.c
cc -o dec2pgbit $(CFLAGS) dec2pgbit.c
escape-json-utf8: escape-json-utf8.c
cc -o escape-json-utf8 $(CFLAGS) escape-json-utf8.c
spin-wait-blob: \
spin-wait-blob.pgc \
common.c \
common-ecpg.c
ecpg spin-wait-blob.pgc
$(CC) $(CFLAGS) -I$(PGINC) spin-wait-blob.c \
-o spin-wait-blob -L$(PGLIB) -lecpg
rm spin-wait-blob.c
distclean:
cd schema && $(_MAKE) distclean
ifdef DASH_DNS_VHOST_SUFFIX
cd www && $(_MAKE) distclean
endif
rm -rf $(SETSPACE_PREFIX)/bin
rm -rf $(SETSPACE_PREFIX)/sbin
rm -rf $(SETSPACE_PREFIX)/lib
rm -rf $(SETSPACE_PREFIX)/libexec
rm -rf $(SETSPACE_PREFIX)/src
rm -rf $(SETSPACE_PREFIX)/sbin
rm -f $(SETSPACE_PREFIX)/jmscott
world:
$(_MAKE) clean
$(_MAKE) all
$(_MAKE) distclean
$(_MAKE) install
tar:
make-make tar $(MKMK)