-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmkfile
134 lines (115 loc) · 3.94 KB
/
mkfile
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
# ======================================================================== v1.0/0a157
#
# This software is part of the AT&T Ningaui distribution
#
# Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved
# AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.
#
# Ningaui software is licensed under the Common Public
# License, Version 1.0 by AT&T Intellectual Property.
#
# A copy of the License is available at
# http://www.opensource.org/licenses/cpl1.0.txt
#
# Information and Software Systems Research
# AT&T Labs
# Florham Park, NJ
#
# Send questions, comments via email to [email protected].
#
#
# ======================================================================== 0a229
#
# Top level mkfile for ningaui. To build on a virgin system (no
# ningaui software installed) best to execute ng_build.ksh with
# the -a and -v options (create development environment and build
# everything).
#
# If you want to mk things by hand then run ng_build.ksh without the
# -a option to set up the build environment. Then follow the directions
# that ng_build.ksh writes to stderr when it has finished.
#
#
# Mod: 02 Dec 2004 (sd) : First cut.
# 07 Jul 2005 (sd) : Converted to mkfile
# 14 Nov 1005 (sd) : we no longer hit the apps directory as Tiger cannot
# handle nmake and most of the apps stuff is still not converted to mk
# 28 Dec 2005 (sd0 : Removed mlink/ebub from main stream.
# 16 Dec 2006 (sd) : Added Install directive for building on non-potoroo node
# 26 Dec 2006 (sd) : Inlcuded the .im files in include/ for nuking.
# 22 Aug 2006 (sd) : Added export stuff for sofware release
#
# must be set in EVERY mkfile AND in panoptic.mk
MKSHELL = `echo ${GLMK_SHELL:-ksh}`
< $NG_SRC/panoptic.mk
# contrib should be early as things in feeds (at least) need to build binaries at precompile time
# and those seem to need the sfstdio stuff. This is mandated with the shift to windows compatability.
dirs = contrib potoroo
dist_dirs = contrib potoroo
# some contrib things are manditory for building everyting, this avoids a complete precompile
# and can be used as a '-p target' on an ng_sm_autobuild command
contrib:V:
(
cd contrib
mk precompile
)
precompile:V:
cp potoroo/srcmgt/ng_make.ksh .bin/ng_make # must have these in order to do anything
chmod 775 .bin/ng_make
export TASK=precompile
mk do_task
cd stlib
for x in *.a
do
ranlib $x 2>/dev/null ||true
done
all:V:
export TASK=all
mk do_task
# for initial build on a node where we do not have potoroo yet
Install:V:
export TASK=install
mk do_task
cp $NG_ROOT/lib/cartulary.min $NG_ROOT/cartulary
nuke:V:
( cd stlib; rm -f *.a )
( cd include; rm -f *.h *.im copybooks/*.h )
export TASK=nuke
mk do_task
(cd .bin; rm -f * )
install:V: package
manpages:V:
(cd manuals; mk precompile)
export TASK=manpages
mk do_task
(cd manuals; mk index)
package: precompile all
ng_sm_mkpkg -v $dist_dirs
README:V:
#XFM_IMBED=$XFM_IMBED
tfm README.xfm README
XFM_IMBED=$XFM_IMBED hfm README.xfm README.html
(ksh bootstrap_build.ksh --man >README.ng_build||true)
# logic for doing the subdirectories is the same regardless of the task; this reduces the duplication of code
do_task:VQ:
for d in $dirs
do
if [[ -d $d ]] # the release does not contain all dirs; do just what we have
then
(
if cd $d
then
echo "===== making $TASK in $d ========="
ng_make $TASK
x=$?
printf "mk_status: "
case $x in
0) printf "$TASK dir=$d [OK]\n";;
*) printf "$TASK dir=$d rc=$x [FAIL]\n";
exit 1;
;;
esac
fi
)
fi
done