Print this page
OS-2552 add node-lockfd (v0.0.2) to platform
OS-2558 smartos-live should run tools from proto.strap, not proto
Split |
Close |
Expand all |
Collapse all |
--- old/./Makefile
+++ new/./Makefile
1 1 #
2 2 # Copyright (c) 2013, Joyent, Inc. All rights reserved.
3 3 #
4 4
5 5 ROOT = $(PWD)
6 6 PROTO = $(ROOT)/proto
7 7 STRAP_PROTO = $(ROOT)/proto.strap
8 8 MPROTO = $(ROOT)/manifest.d
9 9 BOOT_MPROTO = $(ROOT)/boot.manifest.d
10 10 BOOT_PROTO = $(ROOT)/proto.boot
11 11
12 12 # On Darwin/OS X we support running 'make check'
13 13 ifeq ($(shell uname -s),Darwin)
14 14 PATH = /bin:/usr/bin:/usr/sbin:/sbin:/opt/local/bin
15 15 else
16 16 PATH = /usr/bin:/usr/sbin:/sbin:/opt/local/bin
17 17 endif
18 18
19 19 LOCAL_SUBDIRS := $(shell ls projects/local)
20 20 OVERLAYS := $(shell cat overlay/order)
21 21 PKGSRC = $(ROOT)/pkgsrc
22 22 MANIFEST = manifest.gen
23 23 BOOT_MANIFEST = boot.manifest.gen
24 24 JSSTYLE = $(ROOT)/tools/jsstyle/jsstyle
25 25 JSLINT = $(ROOT)/tools/javascriptlint/build/install/jsl
26 26 CSTYLE = $(ROOT)/tools/cstyle
27 27
28 28 ADJUNCT_TARBALL := $(shell ls `pwd`/illumos-adjunct*.tgz 2>/dev/null \
29 29 | tail -n1 && echo $?)
30 30
31 31 STAMPFILE := $(ROOT)/proto/buildstamp
32 32
33 33 WORLD_MANIFESTS := \
34 34 $(MPROTO)/illumos.manifest \
35 35 $(MPROTO)/live.manifest \
36 36 $(MPROTO)/illumos-extra.manifest
37 37
38 38 BOOT_MANIFESTS := \
39 39 $(BOOT_MPROTO)/illumos.manifest
40 40
41 41 SUBDIR_MANIFESTS := $(LOCAL_SUBDIRS:%=$(MPROTO)/%.sd.manifest)
42 42 OVERLAY_MANIFESTS := $(OVERLAYS:$(ROOT)/overlay/%=$(MPROTO)/%.ov.manifest)
43 43
44 44 BOOT_VERSION := boot-$(shell [[ -f $(ROOT)/configure-buildver ]] && \
45 45 echo $$(head -n1 $(ROOT)/configure-buildver)-)$(shell head -n1 $(STAMPFILE))
46 46 BOOT_TARBALL := output/$(BOOT_VERSION).tgz
47 47
48 48 world: 0-extra-stamp 0-illumos-stamp 1-extra-stamp 0-livesrc-stamp \
49 49 0-local-stamp 0-tools-stamp 0-man-stamp 0-devpro-stamp
50 50
51 51 live: world manifest boot
52 52 @echo $(OVERLAY_MANIFESTS)
53 53 @echo $(SUBDIR_MANIFESTS)
54 54 mkdir -p ${ROOT}/log
55 55 (cd $(ROOT) && \
56 56 pfexec ./tools/build_live $(ROOT)/$(MANIFEST) $(ROOT)/output \
57 57 $(OVERLAYS) $(ROOT)/proto $(ROOT)/man/man)
58 58
59 59 boot: $(BOOT_TARBALL)
60 60
61 61 .PHONY: pkgsrc
62 62 pkgsrc:
63 63 cd $(PKGSRC) && gmake install
64 64
65 65 $(BOOT_TARBALL): world manifest
66 66 pfexec rm -rf $(BOOT_PROTO)
67 67 mkdir -p $(BOOT_PROTO)
68 68 mkdir -p $(ROOT)/output
69 69 pfexec ./tools/builder/builder $(ROOT)/$(BOOT_MANIFEST) \
70 70 $(BOOT_PROTO) $(ROOT)/proto
71 71 (cd $(BOOT_PROTO) && pfexec gtar czf $(ROOT)/$@ .)
72 72
73 73 #
74 74 # Manifest construction. There are 5 sources for manifests we need to collect
75 75 # in $(MPROTO) before running the manifest tool. One each comes from
76 76 # illumos, illumos-extra, and the root of live (covering mainly what's in src).
77 77 # Additional manifests come from each of $(LOCAL_SUBDIRS), which may choose
78 78 # to construct them programmatically, and $(OVERLAYS), which must be static.
79 79 # These all end up in $(MPROTO), where we tell tools/build_manifest to look;
80 80 # it will pick up every file in that directory and treat it as a manifest.
81 81 #
82 82 # In addition, a separate manifest is generated in similar manner for the
83 83 # boot tarball.
84 84 #
85 85 # Look ma, no for loops in these shell fragments!
86 86 #
87 87 manifest: $(MANIFEST) $(BOOT_MANIFEST)
88 88
89 89 $(MPROTO) $(BOOT_MPROTO):
90 90 mkdir -p $@
91 91
92 92 $(MPROTO)/live.manifest: src/manifest | $(MPROTO)
93 93 gmake DESTDIR=$(MPROTO) DESTNAME=live.manifest \
94 94 -C src manifest
95 95
96 96 $(MPROTO)/illumos.manifest: projects/illumos/manifest | $(MPROTO)
97 97 cp projects/illumos/manifest $(MPROTO)/illumos.manifest
98 98
99 99 $(BOOT_MPROTO)/illumos.manifest: projects/illumos/manifest | $(BOOT_MPROTO)
100 100 cp projects/illumos/boot.manifest $(BOOT_MPROTO)/illumos.manifest
101 101
102 102 $(MPROTO)/illumos-extra.manifest: 1-extra-stamp | $(MPROTO)
103 103 gmake DESTDIR=$(MPROTO) DESTNAME=illumos-extra.manifest \
104 104 -C projects/illumos-extra manifest; \
105 105
106 106 .PHONY: $(MPROTO)/%.sd.manifest
107 107 $(MPROTO)/%.sd.manifest:
108 108 cd $(ROOT)/projects/local/$* && \
109 109 if [[ -f Makefile.joyent ]]; then \
110 110 gmake DESTDIR=$(MPROTO) DESTNAME=$*.sd.manifest \
111 111 -f Makefile.joyent manifest; \
112 112 else \
113 113 gmake DESTDIR=$(MPROTO) DESTNAME=$*.sd.manifest \
114 114 manifest; \
115 115 fi
116 116
117 117 $(MPROTO)/%.ov.manifest: $(MPROTO) $(ROOT)/overlay/%/manifest
118 118 cp $(ROOT)/overlay/$*/manifest $@
119 119
120 120 $(MANIFEST): $(WORLD_MANIFESTS) $(SUBDIR_MANIFESTS) $(OVERLAY_MANIFESTS)
121 121 -rm -f $@
122 122 ./tools/build_manifest $(MPROTO) | ./tools/sorter > $@
123 123
124 124 $(BOOT_MANIFEST): $(BOOT_MANIFESTS)
125 125 -rm -f $@
126 126 ./tools/build_manifest $(BOOT_MPROTO) | ./tools/sorter > $@
127 127
128 128 #
129 129 # Update source code from parent repositories. We do this for each local
130 130 # project as well as for illumos, illumos-extra, and illumos-live via the
131 131 # update_base tool.
132 132 #
133 133 update: update-base $(LOCAL_SUBDIRS:%=%.update)
134 134 -rm -f 0-local-stamp
135 135
136 136 .PHONY: update-base
137 137 update-base:
138 138 ./tools/update_base
139 139
140 140 .PHONY: %.update
141 141 %.update:
142 142 cd $(ROOT)/projects/local/$* && \
143 143 if [[ -f Makefile.joyent ]]; then \
144 144 gmake -f Makefile.joyent update; \
145 145 else \
146 146 gmake update; \
147 147 fi
148 148 -rm -f 0-subdir-$*-stamp
149 149
150 150 0-local-stamp: $(LOCAL_SUBDIRS:%=0-subdir-%-stamp)
151 151 touch $@
152 152
153 153 0-subdir-%-stamp:
154 154 cd "$(ROOT)/projects/local/$*" && \
155 155 if [[ -f Makefile.joyent ]]; then \
156 156 gmake -f Makefile.joyent DESTDIR=$(PROTO) world install; \
157 157 else \
158 158 gmake DESTDIR=$(PROTO) world install; \
159 159 fi
160 160 touch $@
161 161
162 162 0-devpro-stamp:
163 163 [ ! -d projects/devpro ] || \
164 164 (cd projects/devpro && gmake DESTDIR=$(PROTO) install)
165 165 touch $@
166 166
167 167 0-illumos-stamp: 0-extra-stamp
168 168 (cd $(ROOT) && ./tools/build_illumos)
169 169 touch $@
170 170
171 171 0-extra-stamp:
↓ open down ↓ |
171 lines elided |
↑ open up ↑ |
172 172 (cd $(ROOT)/projects/illumos-extra && \
173 173 gmake STRAP=strap DESTDIR=$(STRAP_PROTO) install_strap)
174 174 (cd $(STRAP_PROTO) && gtar xzf $(ADJUNCT_TARBALL))
175 175 touch $@
176 176
177 177 1-extra-stamp: 0-illumos-stamp
178 178 (cd $(ROOT)/projects/illumos-extra && \
179 179 gmake DESTDIR=$(PROTO) install)
180 180 touch $@
181 181
182 -0-livesrc-stamp: src/bootparams.c
182 +0-livesrc-stamp: src/bootparams.c 0-illumos-stamp 0-extra-stamp
183 183 (cd $(ROOT)/src && \
184 - gmake DESTDIR=$(PROTO) && \
185 - gmake DESTDIR=$(PROTO) install)
184 + gmake NATIVEDIR=$(STRAP_PROTO) DESTDIR=$(PROTO) && \
185 + gmake NATIVEDIR=$(STRAP_PROTO) DESTDIR=$(PROTO) install)
186 186 touch $@
187 187
188 188 0-man-stamp:
189 189 (cd $(ROOT)/man/src && gmake clean && gmake)
190 190 touch $@
191 191
192 192 0-tools-stamp: 0-builder-stamp 0-pwgen-stamp tools/cryptpass
193 193 (cp ${ROOT}/tools/cryptpass $(PROTO)/usr/lib)
194 194 touch $@
195 195
196 196 0-builder-stamp:
197 197 (cd $(ROOT)/tools/builder && gmake builder)
198 198 touch $@
199 199
200 200 0-pwgen-stamp:
201 201 (cd ${ROOT}/tools/pwgen-* && autoconf && ./configure && \
202 202 make && cp pwgen ${ROOT}/tools)
203 203 touch $@
204 204
205 205 tools/cryptpass: tools/cryptpass.c
206 206 (cd ${ROOT}/tools && gcc -Wall -W -O2 -o cryptpass cryptpass.c)
207 207
208 208 jsl: $(JSLINT)
209 209
210 210 $(JSLINT):
211 211 @(cd $(ROOT)/tools/javascriptlint; make CC=gcc install)
212 212
213 213 check: $(JSLINT)
214 214 @(cd $(ROOT)/src && make check)
215 215
216 216 clean:
217 217 rm -f $(MANIFEST)
218 218 rm -rf $(ROOT)/$(MPROTO)/*
219 219 (cd $(ROOT)/src && gmake clean)
220 220 [ ! -d $(ROOT)/projects/illumos-extra ] || \
221 221 (cd $(ROOT)/projects/illumos-extra && gmake clean)
222 222 [ ! -d projects/local ] || for dir in $(LOCAL_SUBDIRS); do \
223 223 cd $(ROOT)/projects/local/$${dir} && \
224 224 if [[ -f Makefile.joyent ]]; then \
225 225 gmake -f Makefile.joyent clean; \
226 226 else \
227 227 gmake clean; \
228 228 fi; \
229 229 done
230 230 (cd $(PKGSRC) && gmake clean)
231 231 (cd $(ROOT) && rm -rf $(PROTO))
232 232 (cd $(ROOT) && rm -rf $(STRAP_PROTO))
233 233 (cd $(ROOT) && rm -rf $(BOOT_PROTO))
234 234 (cd $(ROOT) && mkdir -p $(PROTO) $(STRAP_PROTO) $(BOOT_PROTO))
235 235 rm -f 0-*-stamp 1-*-stamp
236 236
237 237 .PHONY: manifest check jsl
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX