3
# mktargets -- configure top-level library targets -*- sh -*-
5
# Copyright (C) 1996-2004 by Ian Piumarta and other authors/contributors
6
# listed elsewhere in this file.
9
# This file is part of Unix Squeak.
11
# Permission is hereby granted, free of charge, to any person obtaining a copy
12
# of this software and associated documentation files (the "Software"), to deal
13
# in the Software without restriction, including without limitation the rights
14
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
# copies of the Software, and to permit persons to whom the Software is
16
# furnished to do so, subject to the following conditions:
18
# The above copyright notice and this permission notice shall be included in
19
# all copies or substantial portions of the Software.
21
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
# Author: ian.piumarta@inria.fr
31
# Last edited: 2006-10-18 10:12:29 by piumarta on emilia.local
36
no_exports="disabledPlugins"
37
make_targets="make.targets"
44
if test "${ext_modules}${ext_plugins}" != ""; then
45
for p in ${ext_modules} ${ext_plugins}; do
46
plugins="${plugins} ${p}${la}"
50
echo "" > ${make_targets}
55
if test "${int_modules}${int_plugins}" != ""; then
56
for p in ${int_modules} ${int_plugins}; do
57
targets="${targets} ${p}/${p}$a"
58
echo >> ${make_targets}
59
echo "${p}/${p}$a : .force" >> ${make_targets}
60
echo ' @$(SHELL) -ec '"'cd ${p}; "'$(MAKE) '"${p}$a'" >> ${make_targets}
61
test -f ${p}.lib && plibs="${plibs} `cat ${p}.lib`"
65
if test "${ext_modules}${ext_plugins}" != ""; then
66
for p in ${ext_modules} ${ext_plugins}; do
67
echo >> ${make_targets}
68
echo "${p}${la} :" >> ${make_targets}
69
echo ' @$(SHELL) -ec '"'cd ${p}; "'$(MAKE) '"${p}${la}'" >> ${make_targets}
73
if test "${exc_plugins}" != ""; then
74
targets="${targets} ${no_exports}$o"
75
cat > ${no_exports}.c <<EOF
76
/* this should be in a header file, but it isn't. ho hum. */
80
void *primitiveAddress;
82
`for p in ${exc_plugins}; do echo "sqExport ${p}_exports[] = { 0, 0, 0 };"; done | sed 's/-/_/g'`
84
cat >> ${make_targets} <<EOF
86
${no_exports}$o : ${no_exports}.c
87
\$(COMPILE) ${no_exports}$o ${no_exports}.c
91
mv Makefile Makefile.tmp
93
sed "s%\[targets\]%${targets}%g
94
s%\[plugins\]%${plugins}%g
95
s%\[plibs\]%${plibs}%g
96
/\[make_targets\]/r ${make_targets}
97
s%\[make_targets\]%%g" < Makefile.tmp > Makefile