-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
148 lines (135 loc) · 4.06 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
147
148
#
# Synopsis:
# Root makefile for blobio clients and servers.
# Depends:
# local.mk, derived from local-<os>.mk.example
# Usage:
# GITHUB=$HOME/src/github.com/jmscott
# mkdir -p $GITHUB
# cd $GITHUB
# svn https://github.com/jmscott/blobio
# cd blobio/trunk
# cp local-darwin.mk.example local.mk
# nano local.mk
# make clean all distclean install
# Note:
# How safe is an group executable $BLOBIO_ROOT/etc/ ?
# Currently $BLOBIO_ROOT/etc/profile is read by group members.
#
include local.mk
include blobio.mk
_MAKE=$(MAKE) $(MFLAGS)
MKMK=blobio.mkmk
SBINs := $(shell (. ./$(MKMK) && echo $$SBINs))
BINs := $(shell (. ./$(MKMK) && echo $$BINs))
LIBs := $(shell (. ./$(MKMK) && echo $$LIBs))
all:
cd bio4d && $(_MAKE) all
cd cli && $(_MAKE) all
cd flowd && $(_MAKE) all
cd sync && $(_MAKE) all
ifdef DASH_DNS_VHOST_SUFFIX
cd www && $(_MAKE) all
endif
clean:
ifdef DASH_DNS_VHOST_SUFFIX
cd www && $(_MAKE) clean
endif
cd bio4d && $(_MAKE) clean
cd cli && $(_MAKE) clean
cd flowd && $(_MAKE) clean
cd sync && $(_MAKE) clean
distclean:
cd sync && $(_MAKE) distclean
ifdef DASH_DNS_VHOST_SUFFIX
cd www && $(_MAKE) distclean
endif
cd bio4d && $(_MAKE) distclean
ifeq "$(DIST_ROOT)" "/usr"
@echo 'refuse to distclean /usr'
exit 1
endif
ifeq "$(DIST_ROOT)" "/usr/local"
@echo 'refuse to distclean /usr/local'
exit 1
endif
cd flowd && $(_MAKE) distclean
rm -rf $(DIST_ROOT)/bin
rm -rf $(DIST_ROOT)/lib
rm -rf $(DIST_ROOT)/sbin
rm -rf $(DIST_ROOT)/src
install-dirs:
# setup the directories
install -g $(DIST_GROUP) -o $(DIST_USER) \
-d $(DIST_ROOT)
install -g $(DIST_GROUP) -o $(DIST_USER) \
-d $(DIST_ROOT)/bin
install -g $(DIST_GROUP) -o $(DIST_USER) \
-d $(DIST_ROOT)/src
install -g $(DIST_GROUP) -o $(DIST_USER) \
-d $(DIST_ROOT)/src/sync/pgsql
install -g $(DIST_GROUP) -o $(DIST_USER) \
-d $(DIST_ROOT)/src/bio4d
install -g $(DIST_GROUP) -o $(DIST_USER) \
-d $(DIST_ROOT)/src/blobio
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,go= -d $(DIST_ROOT)/sbin
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,go= -d $(DIST_ROOT)/attic
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,g=x,o= -d $(DIST_ROOT)/etc
# need group read for possible other services
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,g=rx,o= -d $(DIST_ROOT)/spool
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,go= -d $(DIST_ROOT)/spool/wrap
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,g=rx,o= -d $(DIST_ROOT)/log
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,go= -d $(DIST_ROOT)/run
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,go= -d $(DIST_ROOT)/tmp
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,g=x,o= -d $(DIST_ROOT)/data
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,g=x,o= -d $(DIST_ROOT)/data/fs_sha
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,go= -d $(DIST_ROOT)/data/fs_sha/tmp
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,g=x,o= -d $(DIST_ROOT)/data/fs_bc160
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,go= -d $(DIST_ROOT)/data/fs_bc160/tmp
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,g=x,o= -d $(DIST_ROOT)/data/fs_btc20
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,go= -d $(DIST_ROOT)/data/fs_btc20/tmp
install -g $(DIST_GROUP) -o $(DIST_USER) \
-m u=rwx,g=rx,o= -d $(DIST_ROOT)/sync
install -g $(DIST_GROUP) -o $(DIST_USER) \
-d $(DIST_ROOT)/lib
install: all
$(_MAKE) install-dirs
install -g $(DIST_GROUP) -o $(DIST_USER) -m u=rx,go= \
$(SBINs) \
$(DIST_ROOT)/sbin
install -g $(DIST_GROUP) -o $(DIST_USER) -m ug=r,o= \
$(LIBs) \
$(DIST_ROOT)/lib
cd bio4d; $(MAKE) $(MFLAGS) install
cd cli; $(MAKE) $(MFLAGS) install
cd flowd; $(MAKE) $(MFLAGS) install
cd sync; $(MAKE) $(MFLAGS) install
ifdef NOC_DNS_VHOST_SUFFIX
cd www && $(MAKE) $(MFLAGS) install
endif
dev-links:
test -e cgi-bin || ln -s . cgi-bin
test -e htdocs || ln -s . htdocs
test -e lib || ln -s . lib
test -e log || ln -s . log
test -e run || ln -s . run
world:
$(_MAKE) clean
$(_MAKE) all
$(_MAKE) distclean
$(_MAKE) install