2 # called with parameters: 1:dir 2:ackbase 3:gnubase
14 echo "#Generated from $1/Makefile.in"
20 RECURSIVE_TARGETS
="clean depend depend-ack depend-gnu"
22 if [ -z $ACKBASE ]; then echo ACKBASE is not
set!; exit 1; fi
23 if [ -z $GNUBASE ]; then echo GNUBASE is not
set!; exit 1; fi
27 #to enable library debugging, enable the next line
35 echo "makefiles: Makefile"
36 echo "Makedepend-ack Makedepend-gnu: "
37 echo " sh $0 $OBJDIR $ACKBASE $GNUBASE"
39 echo "Makefile: Makefile.in Makedepend-ack Makedepend-gnu"
40 echo " sh $0 $OBJDIR $ACKBASE $GNUBASE"
42 echo " @echo *Attention*"
43 echo " @echo Makefile is regenerated... rerun command to see changes"
44 echo " @echo *Attention*"
47 if [ ! -z "$SUBDIRS" ]; then
48 echo "all-ack: makefiles"
51 if [ $TYPE = "both" -o $TYPE = "ack" ]; then
52 echo " mkdir -p $ACKBASE/$OBJDIR/$dir"
54 echo " cd $dir && \$(MAKE) \$@"
57 echo "all-gnu: makefiles"
60 if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
61 echo " mkdir -p $GNUBASE/$OBJDIR/$dir"
64 echo " cd $dir && \$(MAKE) \$@"
67 echo "$RECURSIVE_TARGETS:: makefiles"
70 #if [ $TYPE = "both" -o $TYPE = "ack" ]; then
71 #echo " mkdir -p $ACKBASE/$OBJDIR/$dir"
73 #if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
74 #echo " mkdir -p $GNUBASE/$OBJDIR/$dir"
77 echo " cd $dir && \$(MAKE) \$@"
82 echo "makefiles: $dir/Makefile"
87 echo "$dir/Makefile: $dir/Makefile.in"
88 echo " cd $dir && sh ../$0 $OBJDIR/$dir ../$ACKBASE ../$GNUBASE && \$(MAKE) makefiles"
92 echo "depend: depend-ack"
94 echo "depend-ack:" >&3
95 echo " rm .depend-ack" >&3
96 echo " touch .depend-ack" >&3
98 echo "depend-gnu:" >&4
99 echo " rm .depend-gnu" >&4
100 echo " touch .depend-gnu" >&4
106 dstdir
=`dirname $dstfile`
110 echo " cc $CFLAGS -c -o $dstfile $srcfile"
112 echo " mkdep 'cc $CFLAGS -E' $srcfile | sed -e 's:^\(.\):$dstdir/\1:' >> .depend-ack" >&3
115 echo " m2 $M2FLAGS -c -o $dstfile $srcfile"
117 echo " mkdep 'm2 $M2FLAGS -E' $srcfile | sed -e 's:^\(.\):$dstdir/\1:' >> .depend-ack" >&3
120 echo " sh ./FP.compile $dstfile $srcfile"
122 echo " mkdep 'cc -E' $srcfile | sed -e 's:^\(.\):$dstdir/\1:' >> .depend-ack" >&3
131 dstdir
=`dirname $dstfile`
132 sedcmd
="sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):$dstdir/\1:'"
136 echo " gcc $CFLAGS -E -x assembler-with-cpp -I. $srcfile | asmconv -mi386 ack gnu > $GNUBASE/$OBJDIR/$srcfile.gnu || true"
137 echo " gas -o $dstfile $GNUBASE/$OBJDIR/$srcfile.gnu"
139 echo " mkdep 'gcc $CFLAGS -E -x assembler-with-cpp -I.' $srcfile | $sedcmd >> .depend-gnu" >&4
142 echo " gas -o $dstfile $srcfile"
144 echo " mkdep 'gcc $CFLAGS -E -x assembler-with-cpp -I.' $srcfile | $sedcmd >> .depend-gnu" >&4
147 echo " gcc $CFLAGS -c -o $dstfile $srcfile"
149 echo " mkdep 'gcc $CFLAGS -E' $srcfile | $sedcmd >> .depend-gnu" >&4
152 # echo " \$(M2C) -o $dstfile $srcfile"
155 # echo " sh ./FP.COMPILE $srcfile"
162 for lib
in $LIBRARIES
164 if [ $TYPE = "both" -o $TYPE = "ack" ]; then
165 echo "all-ack: $ACKBASE/$lib.a"
166 eval "FILES=\$${lib}_FILES"
170 o
=`basename $f | sed -e 's/\\..\$/\.o/'`
171 echo "$ACKBASE/$lib.a: $ACKBASE/$lib.a($o)"
174 echo "$ACKBASE/$lib.a:"
175 echo " ar cr $ACKBASE/$lib.a $ACKBASE/$OBJDIR/*.o"
176 echo " rm $ACKBASE/$OBJDIR/*.o"
180 o
=`basename $f | sed -e 's/\\..\$/\.o/'`
181 echo "$ACKBASE/$lib.a($o): $f"
183 ackCommands
$ACKBASE/$OBJDIR/$o $f
188 if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
189 echo "all-gnu: $GNUBASE/$lib.a"
190 eval "FILES=\$${lib}_FILES"
194 o
=`basename $f | sed -e 's/\\..\$/\.o/'`
195 echo "$GNUBASE/$lib.a: $GNUBASE/$OBJDIR/$o"
198 echo "$GNUBASE/$lib.a:"
199 echo " gar cr $GNUBASE/$lib.a \$?"
203 o
=`basename $f | sed -e 's/\\..\$/\.o/'`
205 echo "$GNUBASE/$OBJDIR/$o: $f"
207 gnuCommands
$GNUBASE/$OBJDIR/$o $f
217 o
=`basename $f | sed -e 's/\\..\$/\.o/'`
219 if [ $TYPE = "both" -o $TYPE = "ack" ]; then
220 echo "all-ack: $ACKBASE/$o"
222 echo "$ACKBASE/$o: $f"
223 ackCommands
$ACKBASE/$o $f
226 if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
227 echo "all-gnu: $GNUBASE/$o"
229 echo "$GNUBASE/$o: $f"
230 gnuCommands
$GNUBASE/$o $f
235 fi # elif of if [ -n "$SUBDIRS" ]
238 if [ $TYPE = "both" -o $TYPE = "ack" ]; then
239 echo " rm -f $ACKBASE/$OBJDIR/*"
241 if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
242 echo " rm -f $GNUBASE/$OBJDIR/*"
245 if [ $OBJDIR = "." ]; then
247 echo "install: install-ack"
249 echo "install-ack: all-ack"
250 # $ARCH is from /etc/make.conf
251 echo " cp $ACKBASE/*.[ao] /usr/lib/$ARCH"
253 echo "install-gnu: all-gnu"
254 echo " cp $GNUBASE/*.[ao] /usr/gnu/lib"
258 echo "include Makedepend-ack"
259 echo "include .depend-ack"
261 echo "include Makedepend-gnu"
262 echo "include .depend-gnu"