/
Makefile
179 lines (150 loc) · 3.67 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright (c) 2017, Joyent, Inc.
#
#
# To build everything just run 'gmake' in this directory.
#
BASE = $(PWD)
DESTDIR = $(BASE)/proto
ifeq ($(STRAP),strap)
STRAPPROTO = $(DESTDIR)
SUBDIRS = \
cpp \
bzip2 \
libexpat \
libidn \
libxml \
libz \
make \
node.js \
nss-nspr \
openssl1x \
perl
else
STRAPPROTO = $(DESTDIR:proto=proto.strap)
SUBDIRS = \
bash \
bind \
bzip2 \
coreutils \
cpp \
curl \
dialog \
g11n \
gnupg \
gtar \
gzip \
ipmitool \
less \
libexpat \
libidn \
libidn2 \
libxml \
libz \
make \
mdb_v8 \
ncurses \
node.js \
nss-nspr \
ntp \
openldap \
openlldp \
openssl \
openssl1x \
openssh \
pbzip2 \
perl \
rsync \
rsyslog \
screen \
socat \
tun \
uuid \
vim \
wget \
xz
endif
PATH = $(STRAPPROTO)/usr/bin:/usr/bin:/usr/sbin:/sbin:/opt/local/bin
NAME = illumos-extra
AWK = $(shell (which gawk 2>/dev/null | grep -v "^no ") || which awk)
BRANCH = $(shell git symbolic-ref HEAD | $(AWK) -F/ '{print $$3}')
ifeq ($(TIMESTAMP),)
TIMESTAMP = $(shell date -u "+%Y%m%dT%H%M%SZ")
endif
GITDESCRIBE = \
g$(shell git describe --all --long | $(AWK) -F'-g' '{print $$NF}')
TARBALL = $(NAME)-$(BRANCH)-$(TIMESTAMP)-$(GITDESCRIBE).tgz
#
# Some software (e.g., OpenSSL 0.9.8) is very particular about the Perl
# interpreter used during the build. This is the full path to the version
# built during the strap build, which is safe to use on the build machine.
#
# This definition would perhaps more appropriately appear in "Makefile.defs",
# but that file is not used in the OpenSSL 0.9.8 build and is also not included
# by this file; absent deeper refactoring, we shall pass it via the environment
# in the $(SUBDIRS) target below.
#
NATIVE_PERL = $(STRAPPROTO)/usr/perl5/5.12/bin/perl
all: $(SUBDIRS)
strap: $(SUBDIRS)
curl: libz openssl1x libidn2
gzip: libz
node.js: openssl1x
dialog: ncurses
socat: openssl1x
wget: openssl1x libidn
openldap: openssl1x
g11n: make
ntp: perl openssl1x
openssh: openssl1x
#
# pkg-config may be installed. This will actually only hurt us rather than help
# us. pkg-config is based as a part of the pkgsrc packages and will pull in
# versions of libraries that we have in /opt/local rather than using the ones in
# /usr that we want. PKG_CONFIG_LIBDIR controls the actual path. This
# environment variable nulls out the search path. Other vars just control what
# gets appended.
#
$(DESTDIR)/usr/gnu/bin/gas: FRC
(cd binutils && \
PKG_CONFIG_LIBDIR="" \
STRAP=$(STRAP) \
$(MAKE) DESTDIR=$(DESTDIR) install)
$(DESTDIR)/usr/bin/gcc: $(DESTDIR)/usr/gnu/bin/gas
(cd gcc4 && \
PKG_CONFIG_LIBDIR="" \
STRAP=$(STRAP) \
$(MAKE) DESTDIR=$(DESTDIR) install strapfix)
$(SUBDIRS): $(DESTDIR)/usr/bin/gcc
(cd $@ && \
PKG_CONFIG_LIBDIR="" \
STRAP=$(STRAP) \
CTFMERGE=$(CTFMERGE) \
CTFCONVERT=$(CTFCONVERT) \
ALTCTFCONVERT=$(ALTCTFCONVERT) \
NATIVE_PERL=$(NATIVE_PERL) \
$(MAKE) DESTDIR=$(DESTDIR) install)
install: $(SUBDIRS) gcc4 binutils
install_strap: $(SUBDIRS) gcc4 binutils
clean:
-for dir in $(SUBDIRS) gcc4 binutils; \
do (cd $$dir; $(MAKE) DESTDIR=$(DESTDIR) clean); done
-rm -rf proto
manifest:
cp manifest $(DESTDIR)/$(DESTNAME)
mancheck_conf:
cp mancheck.conf $(DESTDIR)/$(DESTNAME)
tarball:
tar -zcf $(TARBALL) manifest proto
FRC:
.PHONY: manifest mancheck_conf