another update from CVS HEAD, for QA
[alioth/jupp.git] / Makefile.bsd-wrapper
1 # $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.16 2017/12/07 01:00:30 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 -Wno-cast-qual
34 .  if exists(/usr/include/jupp.tmp.h) && !defined(wnostrict)
35 CPPFLAGS+=      -DGCC_Wstrict_prototypes
36 .  else
37 COPTS+=         -Wno-strict-prototypes
38 .  endif
39 .endif
40
41 joe.1: config.status
42         cd ${FSFOBJDIR} && ${FSFMAKE} $@
43
44 all: jupplink
45 jupplink: config.status
46         @ln -sf joe jupp
47
48 winman: joe.1
49         nrcon -mandoc joe.1 | col -bx >joe.txt~
50         print '$$-3,$$d\n,g/^MirOS BSD/.-3,.+10d\nwq' | ed -s joe.txt~
51         cat -s joe.txt~ | sed \
52             -e 's/\(jupp\)\( .global-options\)/\132\2/' \
53             -e '1d' -e '$$d' -e $$'s/$$/\r/' >joe.txt
54
55
56 .ifmake cats
57 V_GROFF!=       pkg_info -e 'groff-*'
58 V_GHOSTSCRIPT!= pkg_info -e 'ghostscript-*'
59 .  if empty(V_GROFF) || empty(V_GHOSTSCRIPT)
60 .    error empty V_GROFF=${V_GROFF} or V_GHOSTSCRIPT=${V_GHOSTSCRIPT}
61 .  endif
62 .endif
63
64 CLEANFILES+=    joe.htm joe.ps1 joe.pdf
65 CATS_KW=        jmacs, joe, jpico, jstar, jupp, rjoe
66 CATS_TITLE_joe_1=joe - Joe's Own Editor
67 cats: joe.cat1 joe.ps1
68         set -e; . ${BSDSRCDIR:Q}/scripts/roff2htm; set_target_absolute; \
69             do_conversion_verbose joe 1 joe.cat1 joe.htm
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>