2 # called with parameters: 1:dir 2:ackbase 3:gnubase
10 echo "#Generated from $1/Makefile.in"
16 RECURSIVE_TARGETS
="clean depend depend-ack depend-gnu"
18 if [ -z $ACKBASE ]; then echo ACKBASE is not
set!; exit 1; fi
19 if [ -z $GNUBASE ]; then echo GNUBASE is not
set!; exit 1; fi
23 #to enable library debugging, enable the next line
31 echo "makefiles: Makefile"
32 echo "Makedepend-ack Makedepend-gnu: "
33 echo " sh $0 $OBJDIR $ACKBASE $GNUBASE"
35 echo "Makefile: Makefile.in Makedepend-ack Makedepend-gnu"
36 echo " sh $0 $OBJDIR $ACKBASE $GNUBASE"
38 echo " @echo *Attention*"
39 echo " @echo Makefile is regenerated... rerun command to see changes"
40 echo " @echo *Attention*"
43 if [ ! -z "$SUBDIRS" ]; then
44 echo "all-ack: makefiles"
47 if [ $TYPE = "both" -o $TYPE = "ack" ]; then
48 echo " mkdir -p $ACKBASE/$OBJDIR/$dir"
50 echo " cd $dir && \$(MAKE) \$@"
53 echo "all-gnu: makefiles"
56 if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
57 echo " mkdir -p $GNUBASE/$OBJDIR/$dir"
60 echo " cd $dir && \$(MAKE) \$@"
63 echo "$RECURSIVE_TARGETS:: makefiles"
66 #if [ $TYPE = "both" -o $TYPE = "ack" ]; then
67 #echo " mkdir -p $ACKBASE/$OBJDIR/$dir"
69 #if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
70 #echo " mkdir -p $GNUBASE/$OBJDIR/$dir"
73 echo " cd $dir && \$(MAKE) \$@"
78 echo "makefiles: $dir/Makefile"
83 echo "$dir/Makefile: $dir/Makefile.in"
84 echo " cd $dir && sh ../$0 $OBJDIR/$dir ../$ACKBASE ../$GNUBASE && \$(MAKE) makefiles"
88 echo "depend: depend-ack"
90 echo "depend-ack:" >&3
91 echo " rm .depend-ack" >&3
92 echo " touch .depend-ack" >&3
94 echo "depend-gnu:" >&4
95 echo " rm .depend-gnu" >&4
96 echo " touch .depend-gnu" >&4
102 dstdir
=`dirname $dstfile`
106 echo " cc $CFLAGS -c -o $dstfile $srcfile"
108 echo " mkdep 'cc $CFLAGS -E' $srcfile | sed -e 's:^\(.\):$dstdir/\1:' >> .depend-ack" >&3
111 echo " m2 $M2FLAGS -c -o $dstfile $srcfile"
113 echo " mkdep 'm2 $M2FLAGS -E' $srcfile | sed -e 's:^\(.\):$dstdir/\1:' >> .depend-ack" >&3
116 echo " sh ./FP.compile $dstfile $srcfile"
118 echo " mkdep 'cc -E' $srcfile | sed -e 's:^\(.\):$dstdir/\1:' >> .depend-ack" >&3
127 dstdir
=`dirname $dstfile`
128 sedcmd
="sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):$dstdir/\1:'"
132 echo " gcc $CFLAGS -E -x assembler-with-cpp -I. $srcfile | asmconv -mi386 ack gnu > $GNUBASE/$OBJDIR/$srcfile.gnu || true"
133 echo " gas -o $dstfile $GNUBASE/$OBJDIR/$srcfile.gnu"
135 echo " mkdep 'gcc $CFLAGS -E -x assembler-with-cpp -I.' $srcfile | $sedcmd >> .depend-gnu" >&4
138 echo " gas -o $dstfile $srcfile"
140 echo " mkdep 'gcc $CFLAGS -E -x assembler-with-cpp -I.' $srcfile | $sedcmd >> .depend-gnu" >&4
143 echo " gcc $CFLAGS -c -o $dstfile $srcfile"
145 echo " mkdep 'gcc $CFLAGS -E' $srcfile | $sedcmd >> .depend-gnu" >&4
148 # echo " \$(M2C) -o $dstfile $srcfile"
151 # echo " sh ./FP.COMPILE $srcfile"
158 for lib
in $LIBRARIES
160 if [ $TYPE = "both" -o $TYPE = "ack" ]; then
161 echo "all-ack: $ACKBASE/$lib.a"
162 eval "FILES=\$${lib}_FILES"
166 o
=`echo $f | sed -e 's/\\..*\$/\.o/'`
167 echo "$ACKBASE/$lib.a: $ACKBASE/$lib.a($o)"
170 echo "$ACKBASE/$lib.a:"
171 echo " ar cr $ACKBASE/$lib.a $ACKBASE/$OBJDIR/*.o"
172 echo " rm $ACKBASE/$OBJDIR/*.o"
176 o
=`echo $f | sed -e 's/\\..*\$/\.o/'`
177 echo "$ACKBASE/$lib.a($o): $f"
179 ackCommands
$ACKBASE/$OBJDIR/$o $f
184 if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
185 echo "all-gnu: $GNUBASE/$lib.a"
186 eval "FILES=\$${lib}_FILES"
190 o
=`echo $f | sed -e 's/\\..*\$/\.o/'`
191 echo "$GNUBASE/$lib.a: $GNUBASE/$OBJDIR/$o"
194 echo "$GNUBASE/$lib.a:"
195 echo " gar cr $GNUBASE/$lib.a \$?"
199 o
=`echo $f | sed -e 's/\\..*\$/\.o/'`
201 echo "$GNUBASE/$OBJDIR/$o: $f"
203 gnuCommands
$GNUBASE/$OBJDIR/$o $f
213 o
=`echo $f | sed -e 's/\\..*\$/\.o/'`
215 if [ $TYPE = "both" -o $TYPE = "ack" ]; then
216 echo "all-ack: $ACKBASE/$o"
218 echo "$ACKBASE/$o: $f"
219 ackCommands
$ACKBASE/$o $f
222 if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
223 echo "all-gnu: $GNUBASE/$o"
225 echo "$GNUBASE/$o: $f"
226 gnuCommands
$GNUBASE/$o $f
231 fi # elif of if [ -n "$SUBDIRS" ]
234 if [ $TYPE = "both" -o $TYPE = "ack" ]; then
235 echo " rm -f $ACKBASE/$OBJDIR/*"
237 if [ $TYPE = "both" -o $TYPE = "gnu" ]; then
238 echo " rm -f $GNUBASE/$OBJDIR/*"
241 if [ $OBJDIR = "." ]; then
243 echo "install: install-ack"
245 echo "install-ack: all-ack"
246 echo " cp $ACKBASE/*.[ao] /usr/lib/i386"
248 echo "install-gnu: all-gnu"
249 echo " cp $GNUBASE/*.[ao] /usr/gnu/lib"
253 echo "include Makedepend-ack"
254 echo "include .depend-ack"
256 echo "include Makedepend-gnu"
257 echo "include .depend-gnu"