add a CVS snapshot, to thoroughly test on the Debian side
[alioth/jupp.git] / Makefile.bsd-wrapper
1 # $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.9 2016/10/30 00:04:18 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 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                 --enable-sysconfjoesubdir=${sysconfjoesubdir:Q}
23
24 .ifmake winman
25 CFARGS+=        --enable-win32reloc
26 .endif
27
28 .include <bsd.own.mk>
29 FSFISLIB=       No
30
31 .ifdef __CRAZY
32 COPTS+=         -Wno-unused-parameter \
33                 -Wno-missing-field-initializers \
34                 -Wno-old-style-definition -Wno-strict-prototypes \
35                 -Wno-cast-qual \
36                 -Wno-missing-prototypes -Wno-missing-declarations
37 .endif
38
39 joe.1: config.status
40         cd ${FSFOBJDIR} && ${FSFMAKE} $@
41
42 all: jupplink
43 jupplink: config.status
44         @ln -sf joe jupp
45
46 winman: joe.1
47         nrcon -mandoc joe.1 | col -bx >joe.txt~
48         print '$$-3,$$d\n,g/^MirOS BSD/.-3,.+10d\nwq' | ed -s joe.txt~
49         cat -s joe.txt~ | sed \
50             -e 's/\(jupp\)\( .global-options\)/\132\2/' \
51             -e '1d' -e '$$d' -e $$'s/$$/\r/' >joe.txt
52
53
54 .ifmake joe.pdf
55 V_GROFF!=       pkg_info -e 'groff-*'
56 V_GHOSTSCRIPT!= pkg_info -e 'ghostscript-*'
57 .  if empty(V_GROFF) || empty(V_GHOSTSCRIPT)
58 .    error empty V_GROFF=${V_GROFF} or V_GHOSTSCRIPT=${V_GHOSTSCRIPT}
59 .  endif
60 .endif
61
62 CLEANFILES+=    joe.htm joe.ps1 joe.pdf
63 CATS_KW=        jmacs, joe, jpico, jstar, jupp, rjoe
64 CATS_TITLE_joe_1=joe - Joe's Own Editor
65 joe.htm: joe.cat1
66         set -e; . ${BSDSRCDIR:Q}/scripts/roff2htm; set_target_absolute; \
67             do_conversion_verbose joe 1 joe.cat1 joe.htm
68 joe.pdf: joe.ps1
69         x=$$(ident joe.1 | \
70             awk '/Mir''OS:/ { print $$4$$5; }' | \
71             tr -dc 0-9); (( $${#x} == 14 )) || exit 1; exec \
72             ${MKSH} ${BSDSRCDIR:Q}/contrib/hosted/tg/ps2pdfmir -p pa4 -c \
73             -o joe.pdf '[' /Author '(The MirOS Project)' \
74             /Title '('${CATS_TITLE_joe_1:Q}')' \
75             /Subject '(BSD Reference Manual)' /ModDate "(D:$$x)" \
76             /Creator '(GNU groff version ${V_GROFF:S/groff-//} \(MirPorts\))' \
77             /Producer '(Artifex Ghostscript ${V_GHOSTSCRIPT:S/ghostscript-//:S/-artifex//} \(MirPorts\))' \
78             /Keywords '('${CATS_KW:Q}')' /DOCINFO pdfmark \
79             -f joe.ps1
80
81 .include <bsd.cfwrap.mk>