~m-grant-prg/wutconv/jammy-trunk

« back to all changes in this revision

Viewing changes to src/man/1/Makefile.am

  • Committer: Mark Grant
  • Date: 2018-02-10 16:07:49 UTC
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: m.grant.prg@gmail.com-20180210160749-8vfrsb94g2i8ns5s
Tags: upstream-1.0.9-4-gc3ad37f
ImportĀ upstreamĀ versionĀ 1.0.9-4-gc3ad37f

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env bash
 
2
#########################################################################
 
3
#                                                                       #
 
4
# Script ID: src/man/1/Makefile.am                                      #
 
5
# Author: Copyright (C) 2014-2018  Mark Grant                           #
 
6
#                                                                       #
 
7
# Released under the GPLv3 only.                                        #
 
8
# SPDX-License-Identifier: GPL-3.0                                      #
 
9
#                                                                       #
 
10
# Purpose:                                                              #
 
11
# AutoMake script file to generate wutconv manual pages from source.    #
 
12
#                                                                       #
 
13
#########################################################################
 
14
 
 
15
#########################################################################
 
16
#                                                                       #
 
17
# Changelog                                                             #
 
18
#                                                                       #
 
19
# Date          Author  Version Description                             #
 
20
#                                                                       #
 
21
# 04/09/2014    MG      1.0.1   First release.                          #
 
22
# 23/10/2015    MG      1.0.2   Restructure to conform to AutoTools     #
 
23
#                               General Template v1.0.6.                #
 
24
# 02/05/2017    MG      1.0.3   Output from $(edit) was being ignored.  #
 
25
#                               Rename source file extension .man.in    #
 
26
# 02/12/2017    MG      1.0.4   Determine the manual section from the   #
 
27
#                               target suffix. If the suffix is blank   #
 
28
#                               (foo.) or if there is no suffix (foo)   #
 
29
#                               then error out.                         #
 
30
#                               Add SPDX license tags to source files.  #
 
31
# 10/02/2018    MG      1.0.5   Change file's header for new directory  #
 
32
#                               names.                                  #
 
33
#                                                                       #
 
34
#########################################################################
 
35
 
 
36
 
 
37
wutconv.1: Makefile
 
38
        mkdir -p $(@D)
 
39
        rm -f $@ $@.tmp
 
40
        $(edit) $(srcdir)/$(@F).man.in > $@.tmp
 
41
        targfile=$(@F); \
 
42
        if [[ $$targfile == *"."* ]]; then \
 
43
                if [[ $${targfile##*.} == "" ]]; then \
 
44
                        echo "Source file suffix used as section but empty."; \
 
45
                        exit 1; \
 
46
                else \
 
47
                        section=$${targfile##*.}; \
 
48
                fi; \
 
49
        else \
 
50
                echo "Source file suffix used as section but no dot & empty."; \
 
51
                exit 1; \
 
52
        fi; \
 
53
        txt2manwrap $(@F) $$section "Windows / Unix Text File Converter" \
 
54
                $@.tmp $@
 
55
        rm -f $@.tmp
 
56
 
 
57
wutconv.1: $(srcdir)/wutconv.1.man.in
 
58
 
 
59
man_MANS = wutconv.1
 
60
 
 
61
EXTRA_DIST = $(srcdir)/wutconv.1.man.in
 
62
 
 
63
CLEANFILES = *.tmp wutconv.1