af8644c085926604edf756bf8cc11bcefe6f79b7
[alioth/jupp.git] / Makefile.bsd-wrapper
1 # $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.11 2017/12/02 04:33:47 tg Exp $
2 #-
3 # make -f Makefile.bsd-wrapper CFPREFIX=/usr/mpkg sysconfjoesubdir=/joe
4
5 MAN=            joe.1
6 INST_TARGET=    INSTALL_MAN= install
7 CLEANFILES+=    .deps charmap charmaps i18n syntax joe.1 joe.txt{,~} jupp
8
9 CFPREFIX?=      /usr/local
10 .if ${CFPREFIX} == "/usr"
11 CFMANDIR?=      /usr/share/man
12 .endif
13 CFMANDIR?=      ${CFPREFIX}/man
14 CFETC?=         /etc
15
16 sysconfjoesubdir?=/jupp
17
18 CFARGS+=        --prefix=${CFPREFIX:Q} \
19                 --bindir=${CFPREFIX:Q}/bin \
20                 --mandir=${CFMANDIR:Q} \
21                 --sysconfdir=${CFETC:Q} \
22                 ${GCFARGS} \
23                 --enable-sysconfjoesubdir=${sysconfjoesubdir:Q}
24
25 .ifmake winman
26 CFARGS+=        --enable-win32reloc
27 .endif
28
29 .include <bsd.own.mk>
30 FSFISLIB=       No
31
32 .ifdef __CRAZY
33 COPTS+=         -Wno-unused-parameter \
34                 -Wno-missing-field-initializers \
35                 -Wno-old-style-definition -Wno-strict-prototypes \
36                 -Wno-cast-qual \
37                 -Wno-missing-prototypes -Wno-missing-declarations
38 .endif
39
40 joe.1: config.status
41         cd ${FSFOBJDIR} && ${FSFMAKE} $@
42
43 all: jupplink
44 jupplink: config.status
45         @ln -sf joe jupp
46
47 winman: joe.1
48         nrcon -mandoc joe.1 | col -bx >joe.txt~
49         print '$$-3,$$d\n,g/^MirOS BSD/.-3,.+10d\nwq' | ed -s joe.txt~
50         cat -s joe.txt~ | sed \
51             -e 's/\(jupp\)\( .global-options\)/\132\2/' \
52             -e '1d' -e '$$d' -e $$'s/$$/\r/' >joe.txt
53
54
55 .ifmake joe.pdf
56 V_GROFF!=       pkg_info -e 'groff-*'
57 V_GHOSTSCRIPT!= pkg_info -e 'ghostscript-*'
58 .  if empty(V_GROFF) || empty(V_GHOSTSCRIPT)
59 .    error empty V_GROFF=${V_GROFF} or V_GHOSTSCRIPT=${V_GHOSTSCRIPT}
60 .  endif
61 .endif
62
63 CLEANFILES+=    joe.htm joe.ps1 joe.pdf
64 CATS_KW=        jmacs, joe, jpico, jstar, jupp, rjoe
65 CATS_TITLE_joe_1=joe - Joe's Own Editor
66 joe.htm: joe.cat1
67         set -e; . ${BSDSRCDIR:Q}/scripts/roff2htm; set_target_absolute; \
68             do_conversion_verbose joe 1 joe.cat1 joe.htm
69 joe.pdf: joe.ps1
70         x=$$(ident joe.1 | \
71             awk '/Mir''OS:/ { print $$4$$5; }' | \
72             tr -dc 0-9); (( $${#x} == 14 )) || exit 1; exec \
73             ${MKSH} ${BSDSRCDIR:Q}/contrib/hosted/tg/ps2pdfmir -p pa4 -c \
74             -o joe.pdf '[' /Author '(The MirOS Project)' \
75             /Title '('${CATS_TITLE_joe_1:Q}')' \
76             /Subject '(BSD Reference Manual)' /ModDate "(D:$$x)" \
77             /Creator '(GNU groff version ${V_GROFF:S/groff-//} \(MirPorts\))' \
78             /Producer '(Artifex Ghostscript ${V_GHOSTSCRIPT:S/ghostscript-//:S/-artifex//} \(MirPorts\))' \
79             /Keywords '('${CATS_KW:Q}')' /DOCINFO pdfmark \
80             -f joe.ps1
81
82 .include <bsd.cfwrap.mk>