* gdbint.texinfo (Host Definition): Remove description of R_OK.
[deliverable/binutils-gdb.git] / gprof / Makefile.am
index da94204c3bb44b7ab0b6fc2d6dee98a59e0a6cef..24acf1c8ebfe9aac9627f4a539d672f343551599 100644 (file)
@@ -33,11 +33,10 @@ noinst_HEADERS = \
        corefile.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
        search_list.h source.h sym_ids.h symtab.h utils.h
 
-EXTRA_DIST = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c bbconv.pl
-
 BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
+EXTRA_DIST    = $(BUILT_SOURCES) bbconv.pl $(man_MANS)
 
-diststuff: $(BUILT_SOURCES) info
+diststuff: $(BUILT_SOURCES) info $(man_MANS)
 
 .m.c:
        awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
@@ -49,16 +48,39 @@ po/POTFILES.in: @MAINT@ Makefile
        for file in $(POTFILES); do echo $$file; done | sort > tmp \
          && mv tmp $(srcdir)/po/POTFILES.in
 
+MANCONF  = -Dman
+
+TEXI2POD = perl $(srcdir)/../etc/texi2pod.pl
+
+POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1
+
 info_TEXINFOS = gprof.texi
 man_MANS = gprof.1
 
+# Build the man page from the texinfo file
+# The sed command removes the no-adjust Nroff command so that
+# the man output looks standard.
+gprof.1: $(srcdir)/gprof.texi
+       touch $@
+       -$(TEXI2POD) $(MANCONF) -Dgprof < $(srcdir)/gprof.texi > gprof.pod
+       -($(POD2MAN) gprof.pod | \
+              sed -e '/^.if n .na/d' > $@.T$$$$ && \
+              mv -f $@.T$$$$ $@) || \
+              (rm -f $@.T$$$$ && exit 1)
+       rm -f gprof.pod
+
 # Targets to rebuild dependencies in this Makefile.
 # Have to get rid of DEP1 here so that "$?" later includes all sources.
 DEP: dep.sed $(gprof_SOURCES) $(noinst_HEADERS) gconfig.h
        rm -f DEP1
        $(MAKE) MKDEP="$(MKDEP)" DEP1
-       sed -f dep.sed < DEP1 > $@
-       echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@
+       sed -f dep.sed < DEP1 > DEPA
+       echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA
+       if grep ' /' DEPA > /dev/null 2> /dev/null; then \
+         echo 'make DEP failed!'; exit 1; \
+       else \
+         mv -f DEPA $@; \
+       fi
 
 DEP1: $(gprof_SOURCES)
        echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2
@@ -91,7 +113,7 @@ dep-am: DEP
 
 .PHONY: dep dep-in dep-am
 
-CLEANFILES = dep.sed DEP DEP1 DEP2
+CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
 
 # DO NOT DELETE THIS LINE -- mkdep uses it.
 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
@@ -136,7 +158,8 @@ gprof.o: gprof.c $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \
   $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h gconfig.h \
   $(INCDIR)/bin-bugs.h basic_blocks.h source.h search_list.h \
   symtab.h ../bfd/bfd.h call_graph.h cg_arcs.h cg_print.h \
-  corefile.h gmon_io.h gmon.h hertz.h hist.h sym_ids.h
+  corefile.h gmon_io.h gmon.h hertz.h hist.h sym_ids.h \
+  $(INCDIR)/demangle.h
 hertz.o: hertz.c hertz.h gprof.h $(INCDIR)/ansidecl.h \
   $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \
   $(INCDIR)/filenames.h gconfig.h $(INCDIR)/bin-bugs.h
This page took 0.024719 seconds and 4 git commands to generate.