add directory study
This commit is contained in:
328
study/linux-travel/minix-386/estdio21.tar/estdio21/makefile.min
Normal file
328
study/linux-travel/minix-386/estdio21.tar/estdio21/makefile.min
Normal file
@@ -0,0 +1,328 @@
|
||||
|
||||
#min _MINIX
|
||||
CPP =/usr/lib/cpp -P -D_MINIX
|
||||
FPCC =$(CC) -f
|
||||
CC =cc
|
||||
FPLD =$(LD)
|
||||
LD =$(CC) -i
|
||||
RANLIB =echo
|
||||
LORDER =lorder
|
||||
TSORT =tsort
|
||||
|
||||
|
||||
|
||||
Installdir =INSTALL/
|
||||
Testdir =TEST/
|
||||
Fptestdir =FPTEST/
|
||||
Define =-D_MINIX -D_POSIX_SOURCE
|
||||
Include =-I.
|
||||
Libraries =stdio.a
|
||||
MathLibraries =-f
|
||||
FPLib =stdiofp.a
|
||||
StdioLib =stdio.a
|
||||
|
||||
All =README *.x *.c *.g *.h \
|
||||
makefile.cpp makefile.nix makefile.min \
|
||||
$(Testdir)*.c $(Testdir)*.sh \
|
||||
$(Fptestdir)*.c \
|
||||
$(Installdir)*.c $(Installdir)*.sh \
|
||||
$(Installdir)*.txt $(Installdir)*.sit \
|
||||
$(Installdir)*.ans
|
||||
|
||||
Everyone =nix min dos
|
||||
|
||||
CFLAGS= $(Define) $(Include) -LIB -c
|
||||
|
||||
FPOBJ= \
|
||||
_f_cvt.s _f_fprintf.s _f_fscanf.s \
|
||||
_f_guard.s _f_pow10.s _f_printf.s \
|
||||
_f_scanf.s _f_sprintf.s _f_sscanf.s \
|
||||
_f_tvc.s _f_vfprintf.s _f_vprintf.s \
|
||||
_f_vsprintf.s
|
||||
|
||||
LIBOBJ= \
|
||||
_allocbuf.s _bfs.s _bread.s \
|
||||
_bwrite.s _err.s _errlist.s \
|
||||
_fgetlx.s _file.s _fopen.s \
|
||||
_freebuf.s _in.s _ioread.s \
|
||||
_iowrite.s _ipow10.s _open3.s \
|
||||
_os.s _out.s _rename.s \
|
||||
_rlbf.s _stdio.s _update.s \
|
||||
_utoa.s _vfprintf.s _vfscanf.s \
|
||||
_vscanf.s _vsscanf.s _xassert.s \
|
||||
_z_cvt.s _z_tvc.s _zatexit.s \
|
||||
_zerr.s _zout.s _zrlbf.s \
|
||||
_zwrapup.s atexit.s clearerr.s \
|
||||
ctermid.s cuserid.s exit.s \
|
||||
fclose.s fdopen.s feof.s \
|
||||
ferror.s fflush.s fgetc.s \
|
||||
fgetpos.s fgets.s fileno.s \
|
||||
fopen.s fprintf.s fputc.s \
|
||||
fputs.s fread.s freopen.s \
|
||||
fscanf.s fseek.s fsetpos.s \
|
||||
ftell.s fwrite.s getc.s \
|
||||
getchar.s gets.s getw.s \
|
||||
perror.s printf.s putc.s \
|
||||
putchar.s puts.s putw.s \
|
||||
remove.s rewind.s scanf.s \
|
||||
setbuf.s setvbuf.s sprintf.s \
|
||||
sscanf.s tmpfile.s tmpnam.s \
|
||||
ungetc.s vfprintf.s vprintf.s \
|
||||
vsprintf.s
|
||||
|
||||
.SUFFIXES: .s .c
|
||||
.c.s:
|
||||
$(CC) $(CFLAGS) $<
|
||||
|
||||
test:
|
||||
-cd $(Testdir) ; \
|
||||
for f in *.c ; do \
|
||||
n=`basename $$f .c` ; \
|
||||
$(CC) $(CFLAGS) -I.. $$n.c ; \
|
||||
$(LD) -o $$n $$n.s ../stdio.a ; \
|
||||
done
|
||||
|
||||
fptest:
|
||||
-cd $(Fptestdir) ; \
|
||||
for f in *.c ; do \
|
||||
n=`basename $$f .c` ; \
|
||||
$(FPCC) $(CFLAGS) -I.. $$n.c ; \
|
||||
$(FPLD) -o $$n $$n.s ../stdiofp.a ../stdio.a $(MathLibraries) ; \
|
||||
done
|
||||
|
||||
update:
|
||||
-if test -z "$(LIBC)" ; then \
|
||||
echo Usage: make update LIBC=library ; \
|
||||
else \
|
||||
ar t $(LIBC) | sed -e 's/ //g' | sort > libc.files ; \
|
||||
ar rv $(LIBC) `ls *.o | comm -12 - libc.files` ; \
|
||||
rm -f libc.files ; \
|
||||
$(RANLIB) $(LIBC); \
|
||||
fi
|
||||
|
||||
# Library dependencies
|
||||
|
||||
$(FPOBJ) $(LIBOBJ): stdiolib.h stdio.h
|
||||
|
||||
Hide: site.h
|
||||
rm -f Hidden
|
||||
-if grep -s "define HIDDEN" site.h ; then \
|
||||
$(CPP) stub.x >Hidden ; \
|
||||
for f in `grep '^.define [a-z]' hidden.h | \
|
||||
sed 's/^.define \([a-z]*\).*/\1/'` ; do \
|
||||
echo $${f} ; \
|
||||
sed -e "s/XYZ/$${f}/g" < Hidden > _u_$${f}.x ; \
|
||||
libpack < _u_$${f}.x > _u_$${f}.s ; \
|
||||
done ; \
|
||||
fi
|
||||
echo -n >Hide
|
||||
|
||||
# Put together a library
|
||||
|
||||
FPobjects: $(FPOBJ)
|
||||
|
||||
FPorder: $(FPOBJ) Hide
|
||||
echo -n >FPorder
|
||||
-if test -f Hidden ; then \
|
||||
ls _u_*print*.s _u_*scan*.s >> FPorder ; \
|
||||
fi
|
||||
ls $(FPOBJ) > FPorder.tmp
|
||||
$(LORDER) `cat FPorder.tmp` | $(TSORT) >> FPorder; \
|
||||
rm -f FPorder.tmp FPsort.tmp
|
||||
|
||||
FParchive: FPorder
|
||||
rm -f $(FPLib)
|
||||
ar cr $(FPLib) `cat FPorder`
|
||||
$(RANLIB) stdiofp.a
|
||||
|
||||
Liborder: $(LIBOBJ) Hide
|
||||
echo -n >Liborder
|
||||
-if test -f Hidden ; then \
|
||||
ls _u_*.s >> Liborder ; \
|
||||
fi
|
||||
ls $(LIBOBJ) > Liborder.tmp
|
||||
$(LORDER) `cat Liborder.tmp` | $(TSORT) >> Liborder; \
|
||||
rm -f Liborder.tmp
|
||||
|
||||
stdio $(StdioLib): Liborder
|
||||
rm -f $(StdioLib)
|
||||
ar cr $(StdioLib) `cat Liborder`
|
||||
$(RANLIB) stdio.a
|
||||
|
||||
stdiofp $(FPLib):
|
||||
$(MAKE) FPobjects "CC=$(FPCC)" "LD=$(FPLD)"
|
||||
$(MAKE) FParchive
|
||||
|
||||
# Pretty list of objects
|
||||
|
||||
fpfiles:
|
||||
ls _f_*.c | sed -e 's/\.c/.O/g' | \
|
||||
pr -3 -l1 -t -w60 > FPfiles
|
||||
sed -e 's/O *$$/O \\/' -e '$$s/ \\$$//' < FPfiles > FPfiles.new
|
||||
mv FPfiles.new FPfiles
|
||||
|
||||
libfiles:
|
||||
ls [_a-wz]*.c | sed -e '/^_f_/d' -e 's/\.c/.O/g' | \
|
||||
pr -3 -l1 -t -w60 > Libfiles
|
||||
sed -e 's/O *$$/O \\/' -e '$$s/ \\$$//' < Libfiles > Libfiles.new
|
||||
mv Libfiles.new Libfiles
|
||||
|
||||
# Clean
|
||||
|
||||
clean:
|
||||
rm -f $(LIBOBJ)
|
||||
rm -f $(FPOBJ)
|
||||
rm -f _u_*
|
||||
rm -f $(StdioLib) $(FPLib)
|
||||
rm -f $(Testdir)*.s $(Fptestdir)*.s $(Installdir)*.s
|
||||
for d in $(Testdir) $(Fptestdir) $(Installdir) ; do \
|
||||
cd $$d ; \
|
||||
rm -f core *.out ; \
|
||||
for f in *.c ; do \
|
||||
e=`basename $$f .c` ; \
|
||||
rm -f -o $$e ; \
|
||||
done ; \
|
||||
cd .. ; \
|
||||
done
|
||||
rm -f *~ core *.out *order Hid* test.dat
|
||||
rm -f *files *.tmp
|
||||
rm -f estdio.u* estdio.[01]?
|
||||
|
||||
# Site
|
||||
|
||||
site:
|
||||
-cdiff stdio.g stdio.h > $(Installdir)ack.sit
|
||||
-if test ! -f site.h ; then \
|
||||
echo site.h not installed ; \
|
||||
else \
|
||||
LINES=`wc -l < site.h | sed 's/ //g'` ; \
|
||||
DATE=`date` ; \
|
||||
echo "*** site.h $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "--- site.h $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "***************" >> $(Installdir)ack.sit ; \
|
||||
echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
||||
echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
||||
sed -e 's/^/+ /' < site.h >> $(Installdir)ack.sit ; \
|
||||
fi
|
||||
-if test ! -f Makefile ; then \
|
||||
echo Makefile not installed ; \
|
||||
else \
|
||||
LINES=`wc -l < Makefile | sed 's/ //g'` ; \
|
||||
DATE=`date` ; \
|
||||
echo "*** Makefile $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "--- Makefile $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "***************" >> $(Installdir)ack.sit ; \
|
||||
echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
||||
echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
||||
sed -e 's/^/+ /' < Makefile >> $(Installdir)ack.sit ; \
|
||||
fi
|
||||
-if test -s errlist.h ; then \
|
||||
LINES=`wc -l < errlist.h | sed 's/ //g'` ; \
|
||||
DATE=`date` ; \
|
||||
echo "*** errlist.h $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "--- errlist.h $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "***************" >> $(Installdir)ack.sit ; \
|
||||
echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
||||
echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
||||
sed -e 's/^/+ /' < errlist.h >> $(Installdir)ack.sit ; \
|
||||
fi
|
||||
-if test -s powers.h ; then \
|
||||
LINES=`wc -l < powers.h | sed 's/ //g'` ; \
|
||||
DATE=`date` ; \
|
||||
echo "*** powers.h $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "--- powers.h $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "***************" >> $(Installdir)ack.sit ; \
|
||||
echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
||||
echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
||||
sed -e 's/^/+ /' < powers.h >> $(Installdir)ack.sit ; \
|
||||
fi
|
||||
-if test -s lmr.h ; then \
|
||||
LINES=`wc -l < lmr.h | sed 's/ //g'` ; \
|
||||
DATE=`date` ; \
|
||||
echo "*** lmr.h $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "--- lmr.h $${DATE}" >> $(Installdir)ack.sit ; \
|
||||
echo "***************" >> $(Installdir)ack.sit ; \
|
||||
echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
||||
echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
||||
sed -e 's/^/+ /' < lmr.h >> $(Installdir)ack.sit ; \
|
||||
fi
|
||||
|
||||
# Distribution
|
||||
|
||||
distribution:
|
||||
ls $(All) | \
|
||||
sed -e '/^stdio\.h/d' \
|
||||
-e '/^site\.h/d' \
|
||||
-e '/^errlist\.h/d' \
|
||||
-e '/^powers\.h/d' \
|
||||
-e '/^lmr\.h/d' \
|
||||
-e '/^_u_/d' > files
|
||||
|
||||
# Arc
|
||||
|
||||
arc: distribution
|
||||
rm -f estdio.arc
|
||||
arc a estdio.arc @files
|
||||
|
||||
# Tar
|
||||
|
||||
tar estdio.taz: distribution
|
||||
rm -f estdio.taz
|
||||
tar cvf - `cat files` | compress -b13 > estdio.taz
|
||||
|
||||
# Distribution by tar parts
|
||||
|
||||
uu: distribution
|
||||
rm -f estdio.u*
|
||||
tar cvf - `cat files` | \
|
||||
compress -b13 | \
|
||||
uuencode estdio.taz | \
|
||||
split -300 - estdio.u
|
||||
for f in estdio.u* ; do \
|
||||
echo '------ Cut Here ------' > uu.tmp ; \
|
||||
cat $$f >> uu.tmp ; \
|
||||
echo '------ Cut Here ------' >> uu.tmp ; \
|
||||
mv uu.tmp $$f ; \
|
||||
done
|
||||
|
||||
# Shell archive
|
||||
|
||||
shar: distribution
|
||||
rm -f estdio.[0-9][0-9]*
|
||||
sed -e '/^site\.h/d' \
|
||||
-e '/^stdio\.h/d' \
|
||||
-e 's%.*\.x%& Assembler stub%' \
|
||||
-e 's%^TEST/.*%& Exercise file%' \
|
||||
-e 's%^FPTEST/.*%& Exercise file%' \
|
||||
-e 's%^INSTALL/.*\.c%& Installation file%' \
|
||||
-e 's%^INSTALL/.*\.sh%& Installation script%' \
|
||||
-e 's%^INSTALL/.*\.txt%& Documentation%' \
|
||||
-e 's%^INSTALL/.*\.sit%& Differences for preconfigured sites%' \
|
||||
-e 's%^INSTALL/.*\.ans%& Answer file for generating sites%' \
|
||||
-e 's%^makefile.cpp$$%& Cppmake file%' \
|
||||
-e 's%^makefile.[a-z]*$$%& Makefile%' \
|
||||
-e 's%^[0-9a-z_]*\.g$$%& Header file source%' \
|
||||
-e 's%^[0-9a-z_]*\.h$$%& Header file%' \
|
||||
-e 's%^_z.*\.c$$%& Stdio fake source code%' \
|
||||
-e 's%^[0-9a-z_]*\.c$$%& Stdio source code%' < files > MANIFEST
|
||||
shar -a -n estdio -C -b13 -c -o estdio -l 40 MANIFEST `cat files`
|
||||
|
||||
# Dust and dirt
|
||||
|
||||
lint:
|
||||
lint -n $(Include) $(Define) `echo $(LIBOBJ) | sed 's/\.o/.c/g'`
|
||||
|
||||
# Makefiles
|
||||
|
||||
makefiles:
|
||||
-for w in $(Everyone) ; do \
|
||||
n=`grep "^.$$w " <makefile.cpp | sed 's/^.[^ ]* //'` ; \
|
||||
echo $$n ; \
|
||||
if test _MINIX = $$n ; then \
|
||||
cppmake -o makefile.$$w ; \
|
||||
rm -f Makefile ; \
|
||||
cp makefile.$$w Makefile ; \
|
||||
else \
|
||||
cppmake -U_MINIX -D$$n -o makefile.$$w ; \
|
||||
fi ; \
|
||||
done
|
||||
Reference in New Issue
Block a user