home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
c
/
cfortune.zip
/
MAKEFILE
< prev
next >
Wrap
Text File
|
1989-05-25
|
4KB
|
163 lines
OWNER = daemon
CC = cc
DEFS =
CFLAGS = ${DEFS} -O
FFLAGS = ${DEFS}
PFLAGS = ${DEFS}
LFLAGS =
YFLAGS =
LDFLAGS=
LIBS =
SFLAGS= -r
TDEV= -Pver
TROFF= ditroff $(TDEV)
DESTBIN= /usr/games
DESTETC= /etc
DESTLIB= /usr/games/lib
MS = l
MANDIR = /usr/man/man${MS}
CATDIR = /usr/man/cat${MS}
HDRS = strfile.h
SRCS = fortune.c strfile.c unstr.c yow.c
OBJS = fortune.o strfile.o unstr.o yow.o
FORTUNES= cooday.src coojar.src cookmm.src coomit.src coonyt.src \
coosma.src croll.src mayyou.src zippy.src obscene \
rules.src scene
OTHERS = ${FORTUNES} Makefile fortune.6
VERS =
.DEFAULT:
co $<
all: fortune strfile unstr fortunes.dat zippy.dat yow
fortune: fortune.o rnd.o
$(CC) $(CFLAGS) -o fortune fortune.o rnd.o
yow: yow.o rnd.o
$(CC) $(CFLAGS) -o yow yow.o rnd.o
strfile: strfile.o rnd.o
$(CC) $(CFLAGS) -o strfile strfile.o rnd.o
unstr: unstr.o
$(CC) $(CFLAGS) -o unstr unstr.o
fortune.o strfile.o unstr.o: strfile.h
fortunes.dat: fortunes strfile
./strfile $(SFLAGS) fortunes
zippy.dat: zippy.src strfile
./strfile $(SFLAGS) zippy.src zippy.dat
fortunes: ${FORTUNES}
cat cooday.src coojar.src cookmm.src coomit.src coonyt.src \
coosma.src croll.src mayyou.src zippy.src rules.src \
scene > fortunes
echo "%-" >> fortunes
cat obscene >> fortunes
echo "%%" >> fortunes
install: all
install -m 600 -o ${OWNER} fortunes.dat ${DESTLIB}
install -s -m 4511 -o ${OWNER} fortune ${DESTBIN}
install -m 600 -o ${OWNER} zippy.dat ${DESTLIB}
install -s -m 4511 -o ${OWNER} yow ${DESTBIN}
# cp fortune.6 ${MANDIR}/fortune.${MS}
cp yow.6 ${MANDIR}/yow.${MS}
uninstall: /tmp
rm -f ${DESTBIN}/fortune ${DESTLIB}/fortunes.dat \
${MANDIR}/fortune.${MS} ${CATDIR}/fortune.${MS} \
${DESTBIN}/yow ${DESTLIB}/zippy.dat \
${MANDIR}/yow.${MS} ${CATDIR}/yow.${MS}
lint: ${HDRS} ${SRCS}
lint -habx ${DEFS} ${SRCS}
shar: ${HDRS} ${SRCS} ${OTHERS}
shar ${HDRS} ${SRCS} ${OTHERS} > fortune.shar
tags: ${HDRS} ${SRCS}
ctags ${HDRS} ${SRCS}
clean:
@echo "Removing object and junk files."
rm -f fortune fortunes fortunes.dat fortunes.tar strfile unstr \
*.o core a.out make.log lint.out Makefile.bak fortune.shar
clobber:
@echo "Removing read-only source files that have RCS parents."
@echo "Error code 1 indicates last file in SRCS list was not removed."
@echo "(Which is OK)"
make clean
-if [ `whoami` != root ]; then \
for i in ${HDRS} ${SRCS}; do \
if [ ! -w $$i ]; then \
( if [ -f $$i,v ]; then rm -f $$i; \
elif [ -f RCS/$$i,v ]; then rm -f $$i; \
fi ); \
else echo $$i "writeable, not removed"; \
fi; \
done; \
else echo "Running \"make clobber\" as root will zap ALL SRCS,\
RCS'ed or not (not done)."; \
fi
compress:
make clean
@echo "Compressing source and RCS files."
find . -size +2 \( -name \*.h -o -name \*.c -o -name \*.f \
-o -name \*.p -o -name \*.l -o -name \*.y -o -name \*,v \
-o -name \*.src \) \
-exec compress {} \;
uncompress:
uncompressdir .
# RCS stuff
ci: ${HDRS} ${SRCS}
-ci $?
@touch ci
coall:
co -l ${HDRS} ${SRCS}
update:
ci -sDist -u -f${VERS} ${HDRS} ${SRCS}
@touch ci
depend:
grep '^#[ ]*include' /dev/null ${SRCS} \
| sed -e '/"/s/:[^"]*"\([^"]*\)".*/: \1/' \
-e '/</s/:[^<]*<\([^>]*\)>.*/: \/usr\/include\/\1/' \
| sed 's/\.c/.o/' >makedep
echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
echo '$$r makedep' >>eddep
echo 'w' >>eddep
cp Makefile Makefile.bak
ed - Makefile < eddep
rm eddep makedep
echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
echo '# see make depend above' >> Makefile
# DO NOT DELETE THIS LINE -- make depend uses it
fortune.o: /usr/include/sys/types.h
fortune.o: /usr/include/stdio.h
fortune.o: strfile.h
strfile.o: /usr/include/stdio.h
strfile.o: strfile.h
unstr.o: /usr/include/stdio.h
unstr.o: strfile.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above