temp files should be protected; bug report 4.3BSD/usr.bin/186
[unix-history] / usr / src / usr.bin / gprof / Makefile
index 85b0b0d..d638c57 100644 (file)
@@ -1,78 +1,61 @@
-SCCSID = @(#)Makefile  1.8 (Berkeley) %G%
-
-DFLAGS = 
-CFLAGS = ${DFLAGS}
-
-GPROFHDRS =    gprof.h
-GPROFSRCS =    gprof.c arcs.c dfn.c lookup.c printgprof.c calls.c
-GPROFOBJS =    gprof.o arcs.o dfn.o lookup.o printgprof.o calls.o
-OTHERS =       gmcrt0.c gmcrt0.h gmcrt0.ex
-
-gprof: ${GPROFOBJS}
-       cc -o gprof ${CFLAGS} ${GPROFOBJS}
-
-gmcrt0.o: gmcrt0.s
-       as -o gmcrt0.o gmcrt0.s
-
-gmcrt0.s: gmcrt0.c gmcrt0.h gmcrt0.ex
-       cc -S ${DFLAGS} gmcrt0.c
-       ex - gmcrt0.s < gmcrt0.ex
-       /lib/cpp gmcrt0.s > gmcrt0.S
-       mv gmcrt0.S gmcrt0.s
-
-profit: profit.o gmcrt0.o
-       /bin/ld -X gmcrt0.o -o profit profit.o -lc_p
-
-profit.o:
-       cc -p -c profit.c
-
-gprof.o: gprof.c gprof.h
-arcs.o: arcs.c gprof.h
-lookup.o: lookup.c gprof.h
-dfn.o: dfn.c gprof.h
-printgprof.o: printgprof.c gprof.h
-calls.o: calls.c gprof.h
-
-PGPROF = p.gprof.o p.arcs.o p.dfn.o p.lookup.o p.printgprof.o p.calls.o
-
-p.gprof: ${PGPROF}
-       /bin/ld -X gmcrt0.o -o p.gprof ${PGPROF} -lc_p
-
-p.gprof.o: gprof.c gprof.h
-       cat gprof.c > p.gprof.c
-       cc -c -p ${CFLAGS} p.gprof.c
-       rm p.gprof.c
-
-p.arcs.o: arcs.c gprof.h
-       cat arcs.c > p.arcs.c
-       cc -c -p ${CFLAGS} p.arcs.c
-       rm p.arcs.c
-
-p.dfn.o: dfn.c gprof.h
-       cat dfn.c > p.dfn.c
-       cc -c -p ${CFLAGS} p.dfn.c
-       rm p.dfn.c
-
-p.lookup.o: lookup.c gprof.h
-       cat lookup.c > p.lookup.c
-       cc -c -p ${CFLAGS} p.lookup.c
-       rm p.lookup.c
-
-p.printgprof.o: printgprof.c gprof.h
-       cat printgprof.c > p.printgprof.c
-       cc -c -p ${CFLAGS} p.printgprof.c
-       rm p.printgprof.c
-
-p.calls.o: calls.c gprof.h
-       cat calls.c > p.calls.c
-       cc -c -p ${CFLAGS} p.calls.c
-       rm p.calls.c
-
-LINTFLAGS = -x -a -n
-lint:
-       lint ${CFLAGS} ${LINTFLAGS} ${GPROFSRCS}
-
-${GPROFHDRS} ${GPROFSRCS} ${OTHERS}:
-       sccs get $@
-
-sources: ${GPROFHDRS} ${GPROFSRCS} ${OTHERS}
+#
+# Copyright (c) 1987 Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms are permitted
+# provided that the above copyright notice and this paragraph are
+# duplicated in all such forms and that any documentation,
+# advertising materials, and other materials related to such
+# distribution and use acknowledge that the software was developed
+# by the University of California, Berkeley.  The name of the
+# University may not be used to endorse or promote products derived
+# from this software without specific prior written permission.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#      @(#)Makefile    5.13 (Berkeley) %G%
+#
+CFLAGS=        -O
+LIBC=  /lib/libc.a
+HDRS=  gprof.h ${MACHINE}.h
+SRCS=  gprof.c arcs.c dfn.c lookup.c ${MACHINE}.c hertz.c \
+       printgprof.c printlist.c
+OBJS=  gprof.o arcs.o dfn.o lookup.o ${MACHINE}.o hertz.o \
+       printgprof.o printlist.o
+MAN=   gprof.0
+
+all: gprof
+
+gprof: ${OBJS} ${LIBC}
+       ${CC} -o $@ ${CFLAGS} ${OBJS}
+
+gcrt0.h: FRC
+       -if [ -r gcrt0.h ] && \
+               cmp -s gcrt0.h ../../lib/libc/${MACHINE}/csu/gmon.h; then \
+               :; \
+       else \
+               rm -f gcrt0.h; \
+               cp ../../lib/libc/${MACHINE}/csu/gmon.h gcrt0.h; \
+       fi
+
+clean:
+       rm -f ${OBJS} core gprof
+
+cleandir: clean
+       rm -f ${MAN} tags .depend
+
+depend: ${SRCS}
+       mkdep ${CFLAGS} ${SRCS}
+
+install: ${MAN}
+       install -s -o bin -g bin -m 755 gprof ${DESTDIR}/usr/ucb/gprof
+       install -c -o bin -g bin -m 444 gprof.flat ${DESTDIR}/usr/lib
+       install -c -o bin -g bin -m 444 gprof.callg ${DESTDIR}/usr/lib
+       install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1
+
+lint: ${SRCS}
+       lint ${CFLAGS} ${SRCS}
+
+tags: ${SRCS}
+       ctags ${SRCS}