Bug 222252

Summary: `make clean' does not cleanup *.ps files
Product: Documentation Reporter: Wolfram Schneider <wosch>
Component: Books & ArticlesAssignee: Wolfram Schneider <wosch>
Status: Closed FIXED    
Severity: Affects Only Me CC: wosch
Priority: --- Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch none

Description Wolfram Schneider freebsd_committer freebsd_triage 2017-09-12 10:15:28 UTC
Created attachment 186291 [details]
patch

After running `'make' and `make clean' I expect that no generated file is left. But I get a lot of *.ps files.

Apparently, the clean target in doc/share/mk/doc.images.mk is incomplete. See the attached patch.

$ make; make clean
$ git status
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        fr_FR.ISO8859-1/books/handbook/advanced-networking/net-routing.ps
        hu_HU.ISO8859-2/books/handbook/advanced-networking/net-routing.ps
        hu_HU.ISO8859-2/books/handbook/advanced-networking/static-routes.ps
        hu_HU.ISO8859-2/books/handbook/geom/striping.ps
        hu_HU.ISO8859-2/books/handbook/security/ipsec-crypt-pkt.ps
        hu_HU.ISO8859-2/books/handbook/security/ipsec-encap-pkt.ps
        hu_HU.ISO8859-2/books/handbook/security/ipsec-network.ps
        hu_HU.ISO8859-2/books/handbook/security/ipsec-out-pkt.ps
        hu_HU.ISO8859-2/books/handbook/vinum/vinum-concat.ps
        hu_HU.ISO8859-2/books/handbook/vinum/vinum-mirrored-vol.ps
        hu_HU.ISO8859-2/books/handbook/vinum/vinum-raid10-vol.ps
        hu_HU.ISO8859-2/books/handbook/vinum/vinum-raid5-org.ps
        hu_HU.ISO8859-2/books/handbook/vinum/vinum-simple-vol.ps
        hu_HU.ISO8859-2/books/handbook/vinum/vinum-striped-vol.ps
        hu_HU.ISO8859-2/books/handbook/vinum/vinum-striped.ps
        share/images/articles/building-products/freebsd-branches.ps
        share/images/articles/building-products/freebsd-organization.ps
        share/images/articles/releng/branches-head.ps
        share/images/articles/releng/branches-releng3.ps
        share/images/articles/releng/branches-releng4.ps
        share/images/articles/releng/branches-releng5.ps
        share/images/articles/releng/branches-releng6.ps
        share/images/articles/releng/branches-releng7.ps
        share/images/articles/releng/branches-releng8.ps
        share/images/articles/releng/branches-releng9.ps
        share/images/articles/vinum/vinum-concat.ps
        share/images/articles/vinum/vinum-mirrored-vol.ps
        share/images/articles/vinum/vinum-raid10-vol.ps
        share/images/articles/vinum/vinum-raid5-org.ps
        share/images/articles/vinum/vinum-simple-vol.ps
        share/images/articles/vinum/vinum-striped-vol.ps
        share/images/articles/vinum/vinum-striped.ps
        share/images/books/handbook/advanced-networking/net-routing.ps
        share/images/books/handbook/advanced-networking/static-routes.ps
        share/images/books/handbook/geom/striping.ps
        share/images/books/handbook/security/ipsec-crypt-pkt.ps
        share/images/books/handbook/security/ipsec-encap-pkt.ps
        share/images/books/handbook/security/ipsec-network.ps
        share/images/books/handbook/security/ipsec-out-pkt.ps
        share/images/books/handbook/vinum/vinum-concat.ps
        share/images/books/handbook/vinum/vinum-mirrored-vol.ps
        share/images/books/handbook/vinum/vinum-raid10-vol.ps
        share/images/books/handbook/vinum/vinum-raid5-org.ps
        share/images/books/handbook/vinum/vinum-simple-vol.ps
        share/images/books/handbook/vinum/vinum-striped-vol.ps
        share/images/books/handbook/vinum/vinum-striped.ps
Comment 1 Glen Barber freebsd_committer freebsd_triage 2017-09-12 15:27:12 UTC
I looked into this a bit a few weeks ago, and I think the solution is non-trivial.

The problem is that share/images/* is generated from en_EN*/Makefile, and does not seem to have an explicit Makefile to generate the *.ps files (and as such, lacks a mechanism to add a beforeclean target or append CLEANFILES).
Comment 2 Wolfram Schneider freebsd_committer freebsd_triage 2017-09-13 09:23:53 UTC
Actually, it is more complicated. The french makefile will generate
*.ps files in share/images as well.

Any Makefile which contains the variable IMAGES_EN will activate the implicit
rules in share/mk/doc.images.mk, and generate .eps,.png,.ps files if they
are not exists or outdated.

PostScript files are generated from *.pic files

.pic.ps:
        ${PIC2PS} ${.ALLSRC} > ${.TARGET}
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-09-19 09:54:28 UTC
A commit references this bug:

Author: wosch
Date: Tue Sep 19 09:54:22 UTC 2017
New revision: 50878
URL: https://svnweb.freebsd.org/changeset/doc/50878

Log:
  cleanup *.ps files

  PR: 222252

Changes:
  head/share/mk/doc.images.mk