1
2#
3# Copyright (c) 1983 Regents of the University of California.
4# All rights reserved.  The Berkeley software License Agreement
5# specifies the terms and conditions for redistribution.
6#
7#	@(#)Makefile	5.4 (Berkeley) 09/05/85
8#
9
10OBJS=	gethostnamadr.o gethostent.o
11SRCS=	gethostnamadr.c gethostent.c
12CFLAGS=	-O ${DEFS}
13
14.c.o:
15	${CC} -p -c ${CFLAGS} $*.c
16	-ld -X -r $*.o
17	mv a.out profiled/$*.o
18	${CC} ${CFLAGS} -c $*.c
19	-ld -x -r $*.o
20	mv a.out $*.o
21
22hostlib hostlib_p: ${OBJS}
23	@echo "building profiled hostlib"
24	@cd profiled; ar cru ../hostlib_p ${OBJS}
25	@echo "building normal netlib"
26	@ar cru hostlib ${OBJS}
27
28tags:
29	cwd=`pwd`; \
30	for i in ${SRCS}; do \
31		ctags -a -f ${TAGSFILE} $$cwd/$$i; \
32	done
33
34clean:
35	rm -f *.o errs a.out core hostlib hostlib_p profiled/*.o \
36		tags Makefile.bak
37
38depend:
39	for i in ${SRCS}; do \
40	    cc -M ${CFLAGS} $$i | awk ' { if ($$1 != prev) \
41		{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
42		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
43		else rec = rec " " $$2 } } \
44		END { print rec } ' >> makedep; done
45	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
46	echo '$$r makedep' >>eddep
47	echo 'w' >>eddep
48	cp Makefile Makefile.bak
49	ed - Makefile < eddep
50	rm eddep makedep
51	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
52	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
53	echo '# see make depend above' >> Makefile
54
55# DO NOT DELETE THIS LINE -- make depend uses it
56
57gethostnamadr.o: gethostnamadr.c /usr/include/stdio.h /usr/include/netdb.h
58gethostnamadr.o: /usr/include/sys/file.h /usr/include/ndbm.h
59gethostent.o: gethostent.c /usr/include/stdio.h /usr/include/sys/types.h
60gethostent.o: /usr/include/sys/socket.h /usr/include/netdb.h
61gethostent.o: /usr/include/ctype.h /usr/include/ndbm.h
62# DEPENDENCIES MUST END AT END OF FILE
63# IF YOU PUT STUFF HERE IT WILL GO AWAY
64# see make depend above
65