# http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix2.mk # !!CAUTION EDITING!! FILE CONTAINS EVIL 8 BIT HIGH BYTES I SHOULD PURGE JJLATER # by using delimited escape sequences. # Take caution if using a tool such as commiting to a source code repository # etc, that might only allow ASCII & amputate the top 8th bit. # http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix2.mk # Called from near all ~jhs Makefiles by .include # Copied to: /site/usr/share/mk/berklix2.mk # by (cd /site/usr/share/mk; xs make) # Copied to other sites by /site/Makefile & cd ~jhs/public_html;make int2remo # Copied to /usr/share/mk/ by cd /usr/src/share/mk ; make install # Author & Copyright "Julian H. Stacey" 1995-2022 # Releasable as per BSD. Additions & fixes welcome, preferably diff -c # See Also: berklix.mk # What It Is: Macros for BSD Makefiles, to make extra file types, # pretty much of any type I''ve ever needed. # Took me till 2018 to state what it is. # Maybe it wasnt on the Internet way back? # so didnt need to be stated. # I develop this on FreeBSD with a BSD standard make, # https://man.freebsd.org/cgi/man.cgi?query=make&apropos=0&sektion=1&manpath=FreeBSD+14.0-RELEASE+and+Ports&arch=default&format=html # which make as somewhat different to linux make. .if defined (BERKLIX2_DEFINED) #{ # Note a different form of name used in /usr/share/mk/bsd.init.mk # Do nothing, avoid many complaints of # warning: duplicate script for target # when a Makefile accidentally has 2 of # .include .else #}{ # BERKLIX2_DEFINED=YES # Makefile macros for text data, to specify default dependencies & rules for: # Formats: Tex Groff, Html, Postscript, Fax, etc # Tools: Latex, Groff, Le, tbl, soelim, etc # WYSIWYG Combination Tools: {vi + ghostview}, {vi + chimera}, # {vi + xfig} # JJLATER Experiment to shrink PDFs ongoing in ~jhs/tech/rescan # JJLATER CONSIDER spliting this 5000 line file into several: # - macro names # - suffixes # - special single label "all:" & "_all:" etc # - normal single labels such as "pdf:" & "ps:" # - converter rules such as: ".rof.ps:" # JJLATER Add something to keep all the null for loops quiet # when doing a make clean. #------------------------------------------------------------------------------ # Where a Makefile uses both # .include # .include # they should be in the above order, bsd.prog.mk before berklix.mk so that the # clean: dependency works, for instance # ~jhs/public_html/src/bsd/jhs/bin/public/satelite/ # will not clean the satelite.o if it''s the other way round. #------------------------------------------------------------------------------ # Analysis of make operators. # Definition Command Issued Result # XX := ls *.ps ls *.ps ls *.ps # XX := `ls *.ps` `ls *.ps` aa.ps bb.ps date.ps # XX := echo *.ps echo *.ps echo *.ps # XX := `echo *.ps` `echo *.ps` aa.ps bb.ps date.ps # XX != ls *.ps aa.ps bb.ps aa.ps bb.ps # XX != `ls *.ps` null null # XX != echo *.ps aa.ps bb.ps aa.ps bb.ps # XX != `echo *.ps` null null # zz: # brackets.c balancer < # date > date.ps # echo x${XX}x # It''s better to use `ls *.l_rof` than `echo *.l_rof` # for the case where there is no *.l_rof #------------------------------------------------------------------------------ # PDF_TO_TIFF_FORCE="YES" # Normaly leave undefined for normal .SUFFIXES direction, converting # .tiff scan images to .pdf. Only define if occasionaly you # want the reverse direction, extracting a .tiff from a .pdf, # if eg a PDF is received by email or a pdf manual downloaded, # where you want to extract text from a TIFF using OCR # (optical character recognition). # (Some manufacturers provide nice PDF manuals with text strings # copyable by mouse, # but some only provide bit map PDFs one can''t mouse copy notes from ). # -- # We can not have both rules .tiff.pdf & .pdf.tiff present at the same # time, else if xx.pdf exists, 'make xx.tiff' freaks with error: # "Graph cycles through xx.tiff" #------------------------------------------------------------------------------ # PDF_TO_HTML_FORCE="YES" # Normaly leave undefined for normal .SUFFIXES direction # Only uncomment or assert in Makefile invocation if # going in the unusual direction .pdf to .html, # eg if reversing a PDF doc to HTML for a Tolino or Kindle or # ~jhs/public_html/brexit/russia/ #------------------------------------------------------------------------------ # 2020-01-16 experiment with scanner half of multi function printer scanner # Epson Stylus DX3850, using software: XSANE # CONCLUSION 1: Do Not set output format PDF ! Instead select xsane output # format .tiff, then use berklix2.mk to convert to .pdf # Saves space by a factor of 2, & I dont notice any reduction in quality # ( JJLATER look at commands run by berklix2.mk to see if losing quality.) # CONCLUSION 2: Changing The option mode "Lineart / Gray / Color" from Gray # to Lineart achieves a massive factor of 15 saving!: # Lineart is ideal for letters, particularly double sided, as it discards # the shadow image from other side of printed paper, so must be resolving # each pixel to white or black, no gray. # Gray scale probably more appropriate if eg scanning a single # side printed sheet that includes a picture, such as eg a CV/Resume # or equipment manual. # Detail, Using xsane to create scans with settings: # Output names xsane_output_format_(jpg_|pdf_|pnm_|tiff).(jpg|pdf|pnm|tiff) # Type by ext # Gray, Full color range. # DPI 300 # --- # 6115277 xsane_output_format_pdf__mode_gray.pdf From Xsane only # --- # 8924658 xsane_output_format_pnm__mode_gray.pnm From Xsane only # 1124226 xsane_output_format_pnm__mode_gray.pdf From Xsane + Berklix2.mk # --- # 1460218 xsane_output_format_tiff_mode_gray.tiff From Xsane only # 682926 xsane_output_format_tiff_mode_gray.pdf From Xsane + Berklix2.mk # --- # 1452965 xsane_output_format_jpg_mode_gray.jpg From Xsane only # 683209 xsane_output_format_jpg_mode_gray.pdf From Xsane + Berklix2.mk # --- # 90766 xsane_output_format_tiff_mode_lineart.tiff From Xsane only # 48503 xsane_output_format_tiff_mode_lineart.pdf From Xsane + Berklix2.mk #------------------------------------------------------------------------------ # Suffix precedence order for default rules. # Ref. 4.9-RELEASE/usr/share/doc/psd/12.make/paper.ascii.gz. # - A precursor line containing just ".SUFFIXES:" would flush all suffixes # before defining my own, but I''m not that draconian. # - The more to the left a suffix is, the higher priority it has to be source # rather than some other source, when choosing a source to make a dependency. # Whether the dependency is to left or right of source make no difference # I believe. If both Thing.high & Thing.low exist, with either of these # .SUFFIXES: .high .low .out # .SUFFIXES: .out .high .low # Thing.out will be built from Thing.high. # I think it''s also nice (though not necessary) to list in this order: # .SUFFIXES: .high .low .out # - I have not checked the next SUFFIX line complies with the above requirement. # - On the precedence order of .pnm & .png: # - .pnm was added 2019-01-17 # - Xv emits .pnm # - .pnm 30 x bulkier compared to telling xsane to save jpg # - These both exist in /usr/local/bin: # brackets.c balancer < # link pngtopnm -> pngtopam # file pnmtopng # - man pnmtopng: with grayscale, @low max vals distortion happens. # - man pngtopnm: obsoleted by pngtopam, part of Netpbm, # - http://netpbm.sourceforge.net/doc/index.html # All of the programs work with a set of graphics formats # called the "netpbm" formats. Specifically, these formats # are pbm, pgm, ppm, and pam. The first three of these are # sometimes known generically as "pnm". # - https://en.wikipedia.org/wiki/Portable_Network_Graphics # Was developed as an improved, non-patented replacement for .gif # For transferring images on the Internet, not for # professional-quality print graphics # - https://en.wikipedia.org/wiki/Netpbm_format # - I assume .pnm is master raw source data, so .pnm precedes derivative .png # - /usr/ports/graphics/netpbm .if ( !defined(.SUFFIXES) ) #{ .if ( defined(PDF_TO_HTML_FORCE) ) #{{ .SUFFIXES: .pdf .html .elif ( defined(PDF_TO_TIFF_FORCE) ) #}{ .SUFFIXES: .pdf .tiff .elif ( defined(TIFF_TO_JPG_FORCE) ) #}{ .SUFFIXES: .tiff .jpg .else # }{ Normal Suffix Order # Do NOT sort this list alphabeticaly !! # I moved .jpg above .tiff to convert scans received in .jpg from # jes@ as .tiff are half the size, can be OCR''d or converted to .pdf. .SUFFIXES: \ .m4 \ .l_rof \ .e_rof \ .rof \ .l_lmth \ .e_lmth \ .lmth \ .l_html \ .e_html \ .html \ .vhtml \ .l_tex \ .e_tex \ .tex \ .fig \ .vfig \ .fax \ .JPG \ .jpg \ .TIF \ .TIFF \ .tif \ .tiff \ .pnm \ .PNG \ .png \ .dvi \ .eps \ .ps \ .epsi \ .PDF \ .pdf \ .pdfwriter \ .epub \ .vps \ .Vps \ .txt \ .txt_e \ .txt_g \ .epub \ .lst \ .dos \ .latin1 \ .pcl_ps \ .pcl_rof \ .ljet4 \ .ppm \ .wav \ .epson \ .bjccolor \ .bjc600 \ .vbjccolor \ .vbjc600 \ .cdj670 \ .vcdj670 \ .gif \ .gif_transparent \ .gif_rotl \ .gif_rotr \ .m4a \ .mpeg4 \ .mp2 \ .mp3 \ # .epub was added 2020-08-22 a bit below .pdf, # it will probably have to move lower JJLATER. .endif # }} .endif # } .SUFFIXES # EXTRACTION: # First we create 2 (or more) sym links, one per language to extract, # so each language has a visible rebuild dependency when the master changes. # Then we make language extracted files. # .l_rof: A dual language master file, to be extracted in le format, # to 2 or more seperate .rof language files, # (le extracts 1 language from several, including common chunks). # .e_rof: Symbolic links (one per language) pointing to a common # multiple language .l_rof file in ``le'' format. Example: # brackets.c balancer < # document_e.e_rof@ -> document.l_rof # brackets.c balancer < # document_g.e_rof@ -> document.l_rof # .rof A file to be text formatted by groff to output eg postscript. # .l_lmth: A dual language .lmth to be extracted with ``le'' to produce 2 # .lmth files # .e_lmth Symbolic links (one per language) to a common .l_lmth file. # used by ``le'' to produce 2 or more .lmth files. # .lmth: Needs something prepending & appending before producing .html. # .bjc600 is bjc monochrome, # .bjccolor is bjc colour # A .bjccolor seems to print black, even if the black tank # is removed, making the black from a combination of colours, # so unless the electronics is detecting tank absence & # compensating, it may regularly be doing that, in whih case, # best to put in the other black only tank. # .pdf & .ps # I raised priority of PDF above PS, as eg a downloaded PDF (GEA Prog, # with a few pictures in colour) of 150K became 3.8M of .ps & shrank # again to 111K of .pcl. # .gif # Only places that manipulate gifs are ~/public_html/gifs/ # http://www.berklix.com/vsl/Makefile # http://www.berklix.com/vsl/card.gif.comment # Fax order is problematic: there are both fax2ps & ps2fax commands. #------------------------------------------------------------------------------ T_BERKLIX = berklix2.mk: T_PRE_EXIST = "Symbolic linking to pre-existing" # Tag in typescript log to assist searching. T_END_RULE = "${T_BERKLIX} ENDING RULE" T_START_RULE = "${T_BERKLIX} STARTING RULE" T_START_TARGET = "TARGET" # DEBUG_BERKLIX_MK = yes # DEBUG_BERKLIX_MK: Uncomment to debug this macro file, # Or better, as this .mk file is exported to web & may be use by others, # & dont want them upset, eg: make DEBUG_BERKLIX_MK=yes pdf # (Plain DEBUG not used as other FreeBSD (non jhs@) Makefiles use that name.) # Never let a file name use an equal symbol in it: # EQUAL1 etc are to ensure no = character is in file name, # else it is seen by make as a macro assertion, & make sees no name # of anything to make, & with no argument, goes recursive, calling make all. # JJLATER I should extend usage of EQUAL1 etc to check before ${GS} is invoked. # as ${GS} also does not like = in file names. .if ! defined (DEBUG_BERKLIX_MK) #{{ ECHO_BUILD = true ECHO_END = true ECHO_START = true # CMD_FOR_BUILD: 2019-02-27 I reverted from "-for" to "for" # to allow EQUAL1 etc to fail CMD_FOR_BUILD = @for CMD_FOR_CLEAN = for CMD_FOR_INSTALL = for ECHO_DOING = true T_END_RULE = "" T_START_RULE = "" T_START_TARGET = "" EQUAL1 = true EQUAL2 = ; echo EQUAL3 = | grep -v = MAKE_JHS = make # With "cd ~/private; make clean" The MAKE above causes Warning: # "/usr/share/mk/bsd.subdir.mk", line 66: warning: duplicate script # for target "html" ignored so I changed all MAKE to MAKE_JHS .else #}{ ECHO_BUILD = echo ECHO_END = echo ECHO_START = echo # CMD_FOR_BUILD: 2019-02-27 I reverted from "-for" to "for" # to allow EQUAL1 etc to fail CMD_FOR_BUILD = for CMD_FOR_CLEAN = for CMD_FOR_INSTALL = for ECHO_DOING = echo T_END_RULE = "${T_BERKLIX} in ${.CURDIR} ENDING RULE" T_START_RULE = "${T_BERKLIX} in ${.CURDIR} STARTING RULE" T_START_TARGET = "TARGET" EQUAL1 = echo -n "Checking no equal symbol = in file name " ; echo EQUAL2 = ; echo EQUAL3 = | grep -v = MAKE_JHS = make DEBUG_BERKLIX_MK=YES .endif #}} EQUAL4 = || ( echo -n "Fatal: Equal symbol = not allowed in file name " ; echo EQUAL5 = ; false ) #------------------------------------------------------------------------------ BERKLIX_MK = /usr/share/mk/berklix.mk PATH_MK = http://www.berklix.com/src/share/mk PATH_CMPD = http://www.berklix.com/~jhs/src/bsd/jhs/bin/public/cmpd/ PATH_LE = http://www.berklix.com/~jhs/src/bsd/jhs/bin/public/le/ # PATH_LE = http://www.berklix.com/src/bin/le # Till 2014-09-10 i had the above abbreviated PATH_LE, which worked cos for # some reason I cant recall, I also had: # /site/usr/local/www/Data/virtual/berklix.com/src/bin # brackets.c balancer < # le@ -> ../../jhs/src/bsd/jhs/bin/public/le PATH_NOTAIL = http://www.berklix.com/~jhs/src/bsd/jhs/bin/public/notail/ BERKLIX_SRC = ${PATH_MK}/berklix.mk BERKLIX2_SRC = ${PATH_MK}/berklix2.mk # https://en.wikipedia.org/wiki/ISO_216#A_series # Width 210 mm # Height 297 mm # Width 8.27 in # Height 11.7 in # dc: inches from wiki x 300 dpi = # Width 2481 pixels # Height 3510 pixels # Xsane some places shows somewhat lower pixel dimensions, # as it skips border where Preview detects all white. # Xsane # A4 Portrait shows in Xsane window: # 2344 * 3239 * 1 (926.8 KB) # 19.88 cm x 27.52 cm # To scan a landscape page: in page Preview, do Not select "DIN A4 Landscape" # instead leave it on "DIN A4 Portrait" & click the angle from 0 to 90 # output .tiff , File then shows both have orientation=upper-left, & differing # portrait.tiff: height=3239, width=2344 # landscape.tiff: height=2344, width=3239 A4_WIDTH_I = 8.26389 # from man gs, if vertical portrait A4_HEIGHT_I = 11.6944 # from man gs, if vertical portrait # Converting this from inches to centimetres # echo "826389 254 * p" | dc # 20.9902806 # echo "116944 254 * p" | dc # 29.703776 # This loses precision, as A0 is defined as height/width = root of two. # & A0 A1 A2 A3 A4 series halve each size. # So one could be infinitely precise in [milli]metres etc, not imperial. # xsane full defaults to 21.59 x 29.72 # I would assume one wants 20.99 x 29.70 # but xsane a4 portrait sets to 21.00 x 21.00 for some unknown reason # Samples of `file` command run on xsane A4 portrait output: # pnm: size = 02344 x 02432 # pnm: size = 02470 x 01840 # portrait.pnm: size = 02480 x 03398 # tiff: width= 2480 height= 3496 ACROREAD = /usr/local/bin/acroread CALIBRE = /usr/local/bin/calibre CMPD = /usr/local/bin/cmpd DJPEG = /usr/local/bin/djpeg DVIPS = /usr/local/bin/dvips DVIPS2ASCII = /usr/local/bin/dvips2ascii FAX2PS = /usr/local/bin/fax2ps FFMPEG = /usr/local/bin/ffmpeg FIG2DEV = /usr/local/bin/fig2dev GHOSTVIEW = /usr/local/bin/ghostview GIFTOPNM = /usr/local/bin/giftopnm GS = /usr/local/bin/gs GV = /usr/local/bin/gv GV_ARGS = -media a4 -antialias INFO = /usr/local/bin/info INFOKEY = /usr/local/bin/infokey INSTALL-INFO = /usr/local/bin/install-info LAME = /usr/local/bin/lame LATEX = /usr/local/bin/latex LATEX2HTML = /usr/local/bin/latex2html LE = /usr/local/bin/le MAKEINFO = /usr/local/bin/makeinfo NOTAIL = /usr/local/bin/notail PDF2PS = /usr/local/bin/pdf2ps PDFLATEX = /usr/local/bin/pdflatex # 9.2-RELEASE : /usr/local/bin/pdftohtml v. 3.00 # 12.1-STABLE : /usr/local/bin/pdf-to-html v. 3.01 PDFTOHTML = /usr/local/bin/pdf-to-html # http://www.berklix.eu/brexit/russia/Makefile & report.pdf produces: # PDF version 1.6 -- xpdf supports version 1.5 (continuing anyway) PNMCROP = /usr/local/bin/pnmcrop PNMQUANT = /usr/local/bin/pnmquant PNMROTATE = /usr/local/bin/pnmrotate PNMSCALE = /usr/local/bin/pnmscale # See also pnmscalefixed pnmenlarge PAMTOTIFF = /usr/local/bin/pamtotiff PNGTOPNM = /usr/local/bin/pngtopnm PNMTOJPEG = /usr/local/bin/pnmtojpeg PNMTOPNG = /usr/local/bin/pnmtopng PNMTOPS = /usr/local/bin/pnmtops PNMTOTIFF = /usr/local/bin/pnmtotiff PPMTOGIF = /usr/local/bin/ppmtogif PS2EPSI = /usr/local/bin/ps2epsi PS2PDF = /usr/local/bin/ps2pdf # /usr/local/bin/ps2pdf OK on 9.2-RELEASE # /usr/local/bin/ps2pdf Fails on 12.2-RELEASE # /release/9.3-RELEASE/usr/local/bin/ps2pdf Fails on 12.2-RELEASE # /usr/local/bin/ps2pdf OK on 12.2 chroot /9.3-RELEASE # cat xxx.ps | /usr/local/bin/ps2pdf -sPAPERSIZE=a4 - 93rel.pdf # gs on 12 is damaged, on 9 it emits a prompt, on 12 it errors # brackets.c balancer < # 9.2: /usr/local/bin/gs@ -> gsc # 12.2: 7648 Apr 29 13:02 /usr/local/bin/gs* PS2PDF_PIPE = - - # -g7017x4958 come from # A4_HEIGHT_I = 11.6944 # from man gs, if vertical portrait # A4_WIDTH_I = 8.26389 # from man gs, if vertical portrait # Before 2022-08-29 I assumed a resolution of 600 dpi # dc 116944 600 * p 70166400 # 7016.64 # dc 826389 600 * p 495833400 # 4958.334 # man gs: # -r printer resolution # -gnumber1xnumber2 # Equivalent to -dDEVICEWIDTH=number1 and -dDEVICEHEIGHT=number2. # This is for the benefit of devices (such as X11 windows) that # require (or allow) width and height to be specified. # DEVICEWIDTH in 12.3-RELEASE : # /usr/local/bin/eps2eps calls gs with # -dDEVICEWIDTH=250000 -dDEVICEHEIGHT=250000 # /usr/local/share/doc/ghostscript/9.56.1/Use.htm # specifying the device width and height in pixels # for the benefit of devices such as X11 windows and # VESA displays that require (or allow) you to specify # width and height. Note that this causes documents # of other sizes to be clipped, not scaled # PS2PDF_SIZE = -r600 -g7016x4958 # before 2022-08-29 PS2PDF_SIZE = -r300 -g3508x2479 # JJLATER instead of PS2PDF_SIZE above try # PS2PDF_SIZE = -dDEVICEWIDTH=number1 and -dDEVICEHEIGHT=number2 PS2PDF_PORTRAIT_ARGS = -sPAPERSIZE=a4 PS2PDF_LANDSCAPE_ARGS = -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite ${PS2PDF_SIZE} PS2PDF_MISSING_ARGS = # JJLATER perhaps where ${PS2PDF_MISSING_ARGS} is used, # I might substitute ${PS2PDF_PORTRAIT_ARGS} PSNUP = /usr/local/bin/psnup PSSELECT = /usr/local/bin/psselect PSTOPNM = /usr/local/bin/pstopnm PSTOPS = /usr/local/bin/pstops PSTOPS_BACK =4R(0w,1.000000h)+5R(0w,0.666667h)+0R(0w,0.333333h) # PSTOPS_BACK Screws up: 2nd page upside down, & I can''t fix it. PSTOPS_FRNT =1L(1w,0.000000h)+2L(1w,0.333333h)+3L(1w,0.666667h) PSTOPS_ARGS =6:$(PSTOPS_FRNT),$(PSTOPS_BACK) # PSTOPS_ARGS Specific to the BIM3 column leaflet, for now. PSTOPNM_ARGS += `printenv PSTOPNM_ARGS` #------------------------------------------------------------------------------ #UNAME_R != uname -r # .if ( ( ${UNAME_R} == "X.12.2-STABLE" ) || \ # ( ${UNAME_R} == "X.12.2-RELEASE" ) ) # # Patch out until GS is fixed, # # so I can test & see what next breaks in the rest of "cd ~ ; make". # # next to break were other ps2* or psto* # gs was repaired by: cd /usr/local; find . -name \*.pkgsave\* -exec rm {} \; # PSTOPNM = /bin/cat # PS2PDF = /bin/cat # PS2PDF_PIPE = # PS2PDF_PORTRAIT_ARGS = # PS2PDF_LANDSCAPE_ARGS = # PSTOPNM_ARGS = # .endif CHECKLINKSAFTERVI = ${HOME}/bin/.sh/checklinks_after_vi TESSERACT = /usr/local/bin/tesseract TEXI2DVI = /usr/local/bin/texi2dvi TEXI2PDF = /usr/local/bin/texi2pdf TEXINDEX = /usr/local/bin/texindex TIDY = /usr/local/bin/tidy4 TIDYAFTERVI = ${HOME}/bin/.sh/tidy_after_vi TIFF2PS = /usr/local/bin/tiff2ps TIFF2PS_ARGS = -p -a TIFFINFO = /usr/local/bin/tiffinfo # -p added to TIFF2PS_ARGS 2014-03-24 as FreeBSD 9.2-RELEASE with # /usr/local/bin/tiff2ps -a -h11.6944 -w8.26389 file_with_3_pages.tiff \ # brackets.c balancer < # > /dev/null # Warns: "-e and -a: \ # Warning: Cannot generate Encapsulated Postscript for multiple images." # However -p is a problem in ~/job/groff/card/paper when converting # brackets.c balancer < < < < < # berklix_com_jhs.png > .jpg> > .tiff > .ps > .eps # As the .ps becomes a full page, which screws up my business card. # In that case I get round it with qrencode -t EPS TIFFSPLIT = /usr/local/bin/tiffsplit TIFFTOPNM = /usr/local/bin/tifftopnm ASPELL = /usr/local/bin/aspell SPELLAFTERVI = ${HOME}/bin/.sh/spell_after_vi ISPELL = /usr/local/bin/ispell # TIFF2PS_ARGS_LANDSCAPE = -r 180 -h${A4_WIDTH_I} -w${A4_HEIGHT_I} # -r 180 cos I put my landscapes in my scanner with top of paper on right. # I notice gv t.ps builds image from bottom of page up, so maybe other people # consider a landscape top to start on left edge ? TIFF2PS_ARGS_LANDSCAPE = -h${A4_WIDTH_I} -w${A4_HEIGHT_I} TIFF2PS_ARGS_PORTRAIT = -h${A4_HEIGHT_I} -w${A4_WIDTH_I} VLC = /usr/local/bin/vlc XDVI = /usr/local/bin/xdvi XEARTH = /usr/local/bin/xearth XPDF = /usr/local/bin/xpdf # SPELL != ${HOME}/bin/.sh/spell_which # This working shell script was previously used, instead of the .if # further below, I have not delteted it as I might want it later, # but as others adoping the berklix overlay will not have that shell # script installed, I internalise it below as a macro. # #!/bin/sh # # ~jhs/bin/.sh/spell_which # # Called by ~jhs/src/bsd/fixes/FreeBSD/src/gen/share/mk/berklix.mk # # & by ~jhs/bin/.sh/spell_after_vi # if test -e /usr/local/bin/ispell # then # # echo $0 debug sees /usr/local/bin/ispell # echo "${T_BERKLIX} /usr/local/bin/ispell" # # spell -x Don''t create a backup file. # elif test -e /usr/local/bin/aspell # then # # echo $0 debug sees /usr/local/bin/aspell # echo "${T_BERKLIX} /usr/local/bin/aspell" # # aspell -c = check. # else # echo "${T_BERKLIX} Warning: $0 \ # no /usr/local/bin/ispell or /usr/local/bin/aspell" # echo /usr/bin/true # fi # exit 0 .if exists(${ISPELL}) SPELL = ispell .elif exists(${ASPELL}) SPELL = ${ASPELL} .else SPELL = false spell_undefined_in_berklix2.mk .endif TMAC_DIR = /usr/share/tmac # JJLATER Maybe later cd /usr/share;mv tmac Tmac;ln -s Tmac tmac; # echo avoid rm by src/ObsoleteFiles.inc UMLAUTS_INC = ${TMAC_DIR}/umlauts.rof COMMON_INC = ${TMAC_DIR}/common.rof # JJLATER consider merging both umlauts.rof + common.rof to berklix.rof #------------------------------------------------------------------------------ SIG_REOPEN = SIGUSR1 # SIG_REOPEN is the signal(2) sent for a # reload by {ghostview, chimera, xfig}. #------------------------------------------------------------------------------ # Explanation of `ls *.rof` type usage: # If a directory just has just 2 files photo.ps & photo.pcl # then the command # for i # in `ls *.rof` ; rm `basename $i .rof`.ps ; done # will unwantedly # remove photo.ps, as *.rof gets passed to $i as un unevaluated # literal, this also happens with for i in `echo *.rof`, # however # with for i in `ls *.rof` it is safe. # brackets.c balancer < # The 2> /dev/null was # added to stop too many noisy for loops emitting eg: # ls: # *.l_html: No such file or directory #------------------------------------------------------------------------------ # The above gives a full rooted path name of source which when I am generating # .html for web I might not wish to publicise, as it might give insight # for crackers. DONT_EDIT = "DO NOT EDIT ${.TARGET} Built from `basename ${.IMPSRC}`" #------------------------------------------------------------------------------ # Only define FOR* eg FOR_L_ROF in individual Makefiles # in the # unlikely event you dont want the for loops to run # on all *.l_rof # or to generate output files such as .ps files # Example: I do define # FOR_L_ROF in my cv directory # as I have special rules there. .if !defined(FOR_TXT) #{ # brackets.c balancer < FOR_TXT := `ls *.txt 2> /dev/null` .endif #} .if !defined(FOR_CDJ670) #{ # brackets.c balancer < FOR_CDJ670 := `ls *.cdj670 2> /dev/null` .endif #} .if !defined(FOR_BJC600) #{ # brackets.c balancer < FOR_BJC600 := `ls *.bjc600 2> /dev/null` .endif #} .if !defined(FOR_BJCCOLOR) #{ # brackets.c balancer < FOR_BJCCOLOR := `ls *.bjccolor 2> /dev/null` .endif #} .if !defined(FOR_DVI) #{ # brackets.c balancer < FOR_DVI := `ls *.dvi 2> /dev/null` .endif #} .if !defined(FOR_EPSI) #{ # brackets.c balancer < FOR_EPSI := `ls *.epsi 2> /dev/null` .endif #} .if !defined(FOR_EPSON) #{ # brackets.c balancer < FOR_EPSON := `ls *.epson1 2> /dev/null` .endif #} .if !defined(FOR_E_HTML) #{ # brackets.c balancer < FOR_E_HTML := `ls *.e_html 2> /dev/null` .endif #} .if !defined(FOR_E_LMTH) #{ # brackets.c balancer < FOR_E_LMTH := `ls *.e_lmth 2> /dev/null` .endif #} .if !defined(FOR_E_ROF) #{ # brackets.c balancer < FOR_E_ROF := `ls *.e_rof 2> /dev/null` .endif #} .if !defined(FOR_E_TEX) #{ # brackets.c balancer < FOR_E_TEX := `ls *.e_tex 2> /dev/null` .endif #} .if !defined(FOR_FAX) #{ # brackets.c balancer < FOR_FAX := `ls *.fax 2> /dev/null` .endif #} # fax comes as a tiff format # tiff can also contain a jpeg https://en.wikipedia.org/wiki/TIFF # scanjet outputs .tiff using scanimage in # http://www.berklix.com/scanjet/ .if !defined(FOR_TIF_UCASE) #{ # brackets.c balancer < FOR_TIF_UCASE := `ls *.TIF 2> /dev/null` .endif #} .if !defined(FOR_TIFF_UCASE) #{ # brackets.c balancer < FOR_TIFF_UCASE := `ls *.TIFF 2> /dev/null` .endif #} .if !defined(FOR_TIF) #{ # brackets.c balancer < FOR_TIF := `ls *.tif 2> /dev/null` .endif #} .if !defined(FOR_TIFF) #{ # brackets.c balancer < FOR_TIFF := `ls *.tiff 2> /dev/null` .endif #} # ${TIFFSPLIT} outputs .tif .if !defined(FOR_FIG) #{ # brackets.c balancer < FOR_FIG := `ls *.fig 2> /dev/null` .endif #} .if !defined(FOR_HTML) #{ # brackets.c balancer < FOR_HTML := `ls *.html 2> /dev/null` .endif #} .if !defined(FOR_LATIN1) #{ # brackets.c balancer < FOR_LATIN1 := `ls *.latin1 2> /dev/null` .endif #} .if !defined(FOR_LMTH) #{ # brackets.c balancer < FOR_LMTH := `ls *.lmth 2> /dev/null` .endif #} .if !defined(FOR_L_HTML) #{ # brackets.c balancer < FOR_L_HTML := `ls *.l_html 2> /dev/null` .endif #} .if !defined(FOR_L_LMTH) #{ # brackets.c balancer < FOR_L_LMTH := `ls *.l_lmth 2> /dev/null` .endif #} .if !defined(FOR_L_ROF) #{ # brackets.c balancer < FOR_L_ROF := `ls *.l_rof 2> /dev/null` .endif #} .if !defined(FOR_L_TEX) #{ # brackets.c balancer < FOR_L_TEX := `ls *.l_tex 2> /dev/null` .endif #} .if !defined(FOR_M4) #{ # brackets.c balancer < FOR_M4 := `ls *.m4 2> /dev/null` .endif #} .if !defined(FOR_PCL_ROF) #{ # brackets.c balancer < FOR_PCL_ROF := `ls *.pcl_rof 2> /dev/null` .endif #} .if !defined(FOR_PCL_PS) #{ # brackets.c balancer < FOR_PCL_PS := `ls *.pcl_ps 2> /dev/null` .endif #} .if !defined(FOR_PS) #{ # brackets.c balancer < FOR_PS := `ls *.ps 2> /dev/null` .endif #} .if !defined(FOR_PNG) #{ # brackets.c balancer < FOR_PNG := `ls *.png 2> /dev/null` .endif #} .if !defined(FOR_PNG_UCASE) #{ # brackets.c balancer < FOR_PNG_UCASE := `ls *.PNG 2> /dev/null` .endif #} .if !defined(FOR_PNM) #{ # brackets.c balancer < FOR_PNM := `ls *.pnm 2> /dev/null` .endif #} .if !defined(FOR_JPG) #{ # brackets.c balancer < FOR_JPG := `ls *.jpg 2> /dev/null` .endif #} .if !defined(FOR_JPEG) #{ # brackets.c balancer < FOR_JPEG := `ls *.jpeg 2> /dev/null` .endif #} .if !defined(FOR_JPG_UCASE) #{ # brackets.c balancer < FOR_JPG_UCASE := `ls *.JPG 2> /dev/null` .endif #} .if !defined(FOR_PNG_UCASE) #{ # brackets.c balancer < FOR_PNG_UCASE := `ls *.PNG 2> /dev/null` .endif #} .if !defined(FOR_PDF) #{ # brackets.c balancer < FOR_PDF := `ls *.pdf 2> /dev/null` .endif #} .if !defined(FOR_PDF_UCASE) #{ # brackets.c balancer < FOR_PDF_UCASE := `ls *.PDF 2> /dev/null` .endif #} .if !defined(FOR_ROF) #{ # brackets.c balancer < FOR_ROF := `ls *.rof 2> /dev/null` .endif #} .if !defined(FOR_TEX) #{ # brackets.c balancer < FOR_TEX := `ls *.tex 2> /dev/null` .endif #} .if !defined(FOR_TIFF2PS) #{ # brackets.c balancer < FOR_TIFF2PS := `ls *.tiff 2> /dev/null` .endif #} .if !defined(FOR_TIF2PS) #{ # brackets.c balancer < FOR_TIF2PS := `ls *.tif 2> /dev/null` .endif #} .if !defined(FOR_GROFF_HTML_JUNK) #{ # brackets.c balancer < FOR_GROFF_HTML_JUNK := `ls groff-html-[0-9]*-[0-9]*.png 2> /dev/null` .endif #} LANGS ?= e g # LANGS e g for english & german, used by le -e & le -g, & also used in # filename_e.tex file_g.ps etc. # Sometimes the le program is not used to filter languages, but other things, # eg ~/job/groff/card/paper/Makefile uses it for different people``s # business cards. .if !defined(FOR_WAV) #{ # brackets.c balancer < FOR_WAV := `ls *.wav 2> /dev/null` .endif #} .if !defined(FOR_PS) #{ # brackets.c balancer < FOR_MP3 := `ls *.mp3 2> /dev/null` .endif #} #------------------------------------------------------------------------------ # SINGLE TARGETS LE EXTRACTORS # Example: label rof generates all *.rof files. #------------------------------------------------------------------------------ TMP_BERKLIX=berklix_mk_tmp TMP_BERKLIX_GENERIC=${TMP_BERKLIX}_generic TMP_BERKLIX_GENERIC_1=${TMP_BERKLIX_GENERIC}_1 TMP_BERKLIX_GENERIC_2=${TMP_BERKLIX_GENERIC}_2 #------------------------------------------------------------------------------ # I assume bsd.subdir.mk gets included after berklix.mk, TXT_BERKLIX=txt_berklix # TXT_BERKLIX also used by: # ~/job/groff/cv/common/Makefile # ~/job/groff/cv/paper/Makefile # ~/job/groff/cv/web/Makefile # ~/job/groff/handout/Makefile # ~/job/groff/letter/clark/web/Makefile # ~/job/groff/letter/queen/letter/web/Makefile # ~/public_html/ski/event/kitzbuhel/Makefile # ~/public_html/ski/event/mayrhofen/Makefile #------------------------------------------------------------------------------ sighup=SIGHUP #------------------------------------------------------------------------------ GROFF_ARGS += `printenv GROFF_ARGS` GROFF_ARGS_QUOTED=${GROFF_ARGS} GROFF_ARGS_UNQUOTED=${GROFF_ARGS} # Also used by: @ 2021-05-09 # job/groff/badge.rof # job/groff/card/common/Makefile_card_web # job/groff/card/common/Makefile_def_common # job/groff/card/common/Makefile_web_inc # job/groff/card/paper/Makefile # job/groff/card/web1/Makefile # job/groff/card/web2/Makefile # job/groff/card/web3/Makefile # job/groff/card/web4/Makefile # job/groff/cv/common/Makefile # txt/health/living_will_vollmacht_power_of_attorney/julian/roff/Makefile # txt/health/living_will_vollmacht_power_of_attorney/melanie/Makefile .if defined(phone) #{ # Older: GROFF_ARGS_QUOTED # GROFF_ARGS_QUOTED += -dphone="${phone}" # GROFF_ARGS_UNQUOTED += -dphone=${phone} # Newer: GROFF_ARGS_UNQUOTED To Avoid make breaking on double quotes then # unprotected space chars in ~/job/project/cd/labels/4.4-RELEASE GROFF_ARGS_PHONE = -dphone=${phone} .endif #} .if defined(phone_web) #{ GROFF_ARGS_QUOTED += -dphone_web="${phone_web}" GROFF_ARGS_UNQUOTED += -dphone_web=${phone_web} .endif #} .if defined(mobile) #{ GROFF_ARGS_QUOTED += -dmobile="${mobile}" GROFF_ARGS_UNQUOTED += -dmobile=${mobile} .endif #} .if defined(mobile_de) #{ # GROFF_ARGS_QUOTED += -dmobile_de="${mobile_de}" # GROFF_ARGS_UNQUOTED += -dmobile_de=${mobile_de} # job/groff/letter/clark/paper needs quotes to avoid # -dmobile_de=+49 111 1111111 GROFF_ARGS_MOBILE_DE += -dmobile_de="${mobile_de}" .endif #} .if defined(mobile_uk) #{ # GROFF_ARGS_QUOTED += -dmobile_uk="${mobile_uk}" # GROFF_ARGS_UNQUOTED += -dmobile_uk=${mobile_uk} # job/groff/letter/clark/paper needs quotes to avoid # -dmobile_uk=+44 1111 111111 GROFF_ARGS_MOBILE_UK += -dmobile_uk="${mobile_uk}" .endif #} .if defined(fax) #{ # GROFF_ARGS_QUOTED += -dfax="${fax}" # GROFF_ARGS_UNQUOTED += -dfax=${fax} GROFF_ARGS_FAX = -dfax=${fax} # JJLATER 2022-11-09 I saw: # ~//job/groff/invoice/motorola # echo PID $$ ; groff -U -b -s -t # `printenv GROFF_ARGS` -dphone="+49 11 11111111" # -dfax=""+49 11 11111111"" # & \\(a~\\s-4\\v'-0.7m'\\h'+0.1m'jhs/cv/"" # brackets.c: \\) # brackets.c balancer < # ......... > 2003-08-18_e.lmth # /bin/sh: Syntax error: "(" unexpected # brackets.c: ")" # So it seems I have too many "" # & now abandoning all GROFF_ARGS_QUOTED & # using instead GROFF_ARGS_UNQUOTED # but keeping all the text here in case that # change breaks something in ~jhs/ .endif #} .if defined(email_b) #{ GROFF_ARGS_QUOTED += -demail_b="${email_b}" GROFF_ARGS_UNQUOTED += -demail_b=${email_b} .endif #} .if defined(email_p) #{ GROFF_ARGS_QUOTED += -demail_p="${email_p}" GROFF_ARGS_UNQUOTED += -demail_p=${email_p} .endif #} .if defined(email_pc) #{ GROFF_ARGS_QUOTED += -demail_pc="${email_pc}" GROFF_ARGS_UNQUOTED += -demail_pc=${email_pc} .endif #} .if defined(email_bc) #{ GROFF_ARGS_QUOTED += -demail_bc="${email_bc}" GROFF_ARGS_UNQUOTED += -demail_bc=${email_bc} .endif #} .if defined(email) #{ GROFF_ARGS_QUOTED += -demail="${email}" GROFF_ARGS_UNQUOTED += -demail=${email} .endif #} .if defined(web_b) #{ GROFF_ARGS_QUOTED += -dweb_b="${web_b}" GROFF_ARGS_UNQUOTED += -dweb_b=${web_b} .endif #} .if defined(web_p) #{ # GROFF_ARGS_QUOTED += -dweb_p="${web_p}" # GROFF_ARGS_UNQUOTED += -dweb_p=${web_p} # 2022-11-09 job/groff/card/web1 breaks with GROFF_ARGS_UNQUOTED GROFF_ARGS_WEB_P = -dweb_p="${web_p}" .endif #} .if defined(web) #{ # GROFF_ARGS_QUOTED += -dweb="${web}" # GROFF_ARGS_UNQUOTED += -dweb=${web} # ~/job/project/multinet # -dweb=\\s-1http://\\s+1www.berklix.com/\\h'+0.1m'\\v'+0.7m'\\s+4\\(a~\\s-4\\v'-0.7m'\\h'+0.1m'jhs/ # brackets.c: \\) GROFF_ARGS_WEB = -dweb="${web}" .endif #} .if defined(bank_name) #{ # GROFF_ARGS_QUOTED += -dbank_name="${bank_name}" # GROFF_ARGS_UNQUOTED += -dbank_name=${bank_name} GROFF_ARGS_BANK_NAME = -dbank_name="${bank_name}" .endif #} .if defined(bank_head) #{ GROFF_ARGS_QUOTED += -dbank_head="${bank_head}" GROFF_ARGS_UNQUOTED += -dbank_head=${bank_head} .endif #} .if defined(bank_branch) #{ GROFF_ARGS_QUOTED += -dbank_branch="${bank_branch}" GROFF_ARGS_UNQUOTED += -dbank_branch=${bank_branch} .endif #} .if defined(bank_sort) #{ GROFF_ARGS_QUOTED += -dbank_sort="${bank_sort}" GROFF_ARGS_UNQUOTED += -dbank_sort=${bank_sort} .endif #} .if defined(bank_account_number) #{ GROFF_ARGS_QUOTED += -dbank_account_number="${bank_account_number}" GROFF_ARGS_UNQUOTED += -dbank_account_number=${bank_account_number} .endif #} .if defined(bank_account_name) #{ # GROFF_ARGS_QUOTED += -dbank_account_name="${bank_account_name}" # GROFF_ARGS_UNQUOTED += -dbank_account_name=${bank_account_name} GROFF_ARGS_BANK_ACCOUNT_NAME = -dbank_account_name="${bank_account_name}" .endif #} .if defined(bank_iban) #{ # GROFF_ARGS_QUOTED += -dbank_iban="${bank_iban}" # GROFF_ARGS_UNQUOTED += -dbank_iban=${bank_iban} # ~/job/project/multinet # -dbank_iban="DE11 1111 1111 1111 1111 11" GROFF_ARGS_BANK_IBAN += -dbank_iban="${bank_iban}" .endif #} .if defined(bank_bic) #{ GROFF_ARGS_QUOTED += -dbank_bic="${bank_bic}" GROFF_ARGS_UNQUOTED += -dbank_bic=${bank_bic} .endif #} .if defined(address) #{ GROFF_ARGS_QUOTED += -daddress="${address}" GROFF_ARGS_UNQUOTED += -daddress=${address} .endif #} .if defined(street) #{ # GROFF_ARGS_QUOTED += -dstreet="${street}" # GROFF_ARGS_UNQUOTED += -dstreet=${street} # job/groff/letter/clark/paper # -dstreet=AAAA Strasse 123 GROFF_ARGS_STREET += -dstreet="${street}" .endif #} .if defined(str) #{ # GROFF_ARGS_QUOTED += -dstr="${str}" # GROFF_ARGS_UNQUOTED += -dstr=${str} # ~/job/groff/cv/paper blew with soelim: can''t open ''..number..of..my..adr..'' GROFF_ARGS_STR += -dstr="${str}" .endif #} .if defined(postcode) #{ GROFF_ARGS_QUOTED += -dpostcode="${postcode}" GROFF_ARGS_UNQUOTED += -dpostcode=${postcode} .endif #} .if defined(city_postcode) #{ GROFF_ARGS_QUOTED += -dcity_postcode="${city_postcode}" GROFF_ARGS_UNQUOTED += -dcity_postcode=${city_postcode} .endif #} .if defined(city_short_nat) #{ GROFF_ARGS_QUOTED += -dcity_short_nat="${city_short_nat}" GROFF_ARGS_UNQUOTED += -dcity_short_nat=${city_short_nat} .endif #} .if defined(city_short_int) #{ GROFF_ARGS_QUOTED += -dcity_short_int="${city_short_int}" GROFF_ARGS_UNQUOTED += -dcity_short_int=${city_short_int} .endif #} .if defined(city_short) #{ GROFF_ARGS_QUOTED += -dcity_short="${city_short}" GROFF_ARGS_UNQUOTED += -dcity_short=${city_short} .endif #} .if defined(city_long_nat) #{ # GROFF_ARGS_QUOTED += -dcity_long_nat="${city_long_nat}" # GROFF_ARGS_UNQUOTED += -dcity_long_nat=${city_long_nat} GROFF_ARGS_CITY_LONG_NAT = -dcity_long_nat="${city_long_nat}" .endif #} .if defined(city_long_int) #{ # GROFF_ARGS_QUOTED += -dcity_long_int="${city_long_int}" # GROFF_ARGS_UNQUOTED += -dcity_long_int=${city_long_int} # job/groff/letter/clark/paper -dcity_long_int=Munich (Muenchen) GROFF_ARGS_CITY_LONG_INT += -dcity_long_int="${city_long_int}" .endif #} .if defined(city_long) #{ # GROFF_ARGS_QUOTED += -dcity_long="${city_long}" # GROFF_ARGS_UNQUOTED += -dcity_long=${city_long} # job/groff/letter/clark/paper # -dcity_long=Muenchen (Munich) # -dcity_long_nat=Muenchen (Munich) GROFF_ARGS_CITY_LONG += -dcity_long="${city_long}" .endif #} .if defined(city) #{ GROFF_ARGS_QUOTED += -dcity="${city}" GROFF_ARGS_UNQUOTED += -dcity=${city} .endif #} .if defined(county_short_nat) #{ GROFF_ARGS_QUOTED += -dcounty_short_nat="${county_short_nat}" GROFF_ARGS_UNQUOTED += -dcounty_short_nat=${county_short_nat} .endif #} .if defined(county_short_int) #{ GROFF_ARGS_QUOTED += -dcounty_short_int="${county_short_int}" GROFF_ARGS_UNQUOTED += -dcounty_short_int=${county_short_int} .endif #} .if defined(county_short) #{ GROFF_ARGS_QUOTED += -dcounty_short="${county_short}" GROFF_ARGS_UNQUOTED += -dcounty_short=${county_short} .endif #} .if defined(county_long_nat) #{ # GROFF_ARGS_QUOTED += -dcounty_long_nat="${county_long_nat}" # GROFF_ARGS_UNQUOTED += -dcounty_long_nat=${county_long_nat} # job/groff/letter/clark/paper # -dcounty_long_nat=Bayern (Bavaria) GROFF_ARGS_COUNTY_LONG_NAT = -dcounty_long_nat="${county_long_nat}" .endif #} .if defined(county_long_int) #{ # GROFF_ARGS_QUOTED += -dcounty_long_int="${county_long_int}" # GROFF_ARGS_UNQUOTED += -dcounty_long_int=${county_long_int} # job/groff/letter/clark/paper # -dcounty_long_int="Bavaria (Bayern)" GROFF_ARGS_COUNTY_LONG_INT = -dcounty_long_int="${county_long_int}" .endif #} .if defined(county_long) #{ # GROFF_ARGS_QUOTED += -dcounty_long="${county_long}" # GROFF_ARGS_UNQUOTED += -dcounty_long=${county_long} GROFF_ARGS_COUNTY_LONG = -dcounty_long="${county_long}" .endif #} .if defined(county) #{ GROFF_ARGS_QUOTED += -dcounty="${county}" GROFF_ARGS_UNQUOTED += -dcounty=${county} .endif #} .if defined(country_short_nat) #{ GROFF_ARGS_QUOTED += -dcountry_short_nat="${country_short_nat}" GROFF_ARGS_UNQUOTED += -dcountry_short_nat=${country_short_nat} .endif #} .if defined(country_short_int) #{ GROFF_ARGS_QUOTED += -dcountry_short_int="${country_short_int}" GROFF_ARGS_UNQUOTED += -dcountry_short_int=${country_short_int} .endif #} .if defined(country_short) #{ GROFF_ARGS_QUOTED += -dcountry_short="${country_short}" GROFF_ARGS_UNQUOTED += -dcountry_short=${country_short} .endif #} .if defined(country_long_nat) #{ # GROFF_ARGS_QUOTED += -dcountry_long_nat="${country_long_nat}" # GROFF_ARGS_UNQUOTED += -dcountry_long_nat=${country_long_nat} # job/groff/letter/clark/paper # -dcountry_long_nat=Deutschland (Germany) GROFF_ARGS_COUNTRY_LONG_NAT = -dcountry_long_nat="${country_long_nat}" .endif #} .if defined(country_long_int) #{ # GROFF_ARGS_QUOTED += -dcountry_long_int="${country_long_int}" # GROFF_ARGS_UNQUOTED += -dcountry_long_int=${country_long_int} # job/groff/letter/clark/paper # -dcountry_long_int=Germany (Deutschland) GROFF_ARGS_COUNTRY_LONG_INT += -dcountry_long_int="${country_long_int}" .endif #} .if defined(country_long) #{ # GROFF_ARGS_QUOTED += -dcountry_long="${country_long}" # GROFF_ARGS_UNQUOTED += -dcountry_long=${country_long} GROFF_ARGS_COUNTRY_LONG += -dcountry_long="${country_long}" # job/groff/letter/clark/paper # -dcountry_long=Deutschland (Germany) .endif #} .if defined(country) #{ GROFF_ARGS_QUOTED += -dcountry="${country}" GROFF_ARGS_UNQUOTED += -dcountry=${country} .endif #} .if defined(language) #{ GROFF_ARGS_QUOTED += -dlanguage="${language}" GROFF_ARGS_UNQUOTED += -dlanguage=${language} .endif #} # place: "munich"|"aachen"|"twells" # set by .ds in a .rof letter, used as switch for other macros .if defined(place) #{ GROFF_ARGS_QUOTED += -dplace="${place}" GROFF_ARGS_UNQUOTED += -dplace=${place} .endif #} GROFF_ARGS2=\ ${GROFF_ARGS_BANK_ACCOUNT_NAME} \ ${GROFF_ARGS_BANK_IBAN} \ ${GROFF_ARGS_BANK_NAME} \ ${GROFF_ARGS_CITY_LONG_INT} \ ${GROFF_ARGS_CITY_LONG_NAT} \ ${GROFF_ARGS_CITY_LONG} \ ${GROFF_ARGS_COUNTRY_LONG_INT} \ ${GROFF_ARGS_COUNTRY_LONG_NAT} \ ${GROFF_ARGS_COUNTRY_LONG} \ ${GROFF_ARGS_COUNTY_LONG_INT} \ ${GROFF_ARGS_COUNTY_LONG_NAT} \ ${GROFF_ARGS_COUNTY_LONG} \ ${GROFF_ARGS_FAX} \ ${GROFF_ARGS_MOBILE_DE} \ ${GROFF_ARGS_MOBILE_UK} \ ${GROFF_ARGS_PHONE} \ ${GROFF_ARGS_STREET} \ ${GROFF_ARGS_STR} \ ${GROFF_ARGS_WEB_P} \ ${GROFF_ARGS_WEB} \ # GROFF_ARGS2 += ${GROFF_ARGS_QUOTED} GROFF_ARGS2 += ${GROFF_ARGS_UNQUOTED} GROFF_EXE = groff # Depending on version of FreeBSD # /usr/bin/groff # /usr/local/bin/groff # Also used in job/groff/cv/common/Makefile GROFF_MORE = ${GROFF_EXE} -U -b -s -t ${GROFF_ARGS2} # GROFF is also used in ~/job/cover/cv/Makefile, # dont change or remove it. # -b gives a backtrace ie more debug info if errors occur # -t in GROFF is for if I''m including tbl boxes in cv_complete.l_rof # -U for "unsafe mode" # Version from groff -v # FreeBSD-8.2-RELEASE 1.19.2 # FreeBSD-8.3-RELEASE 1.19.2 # FreeBSD-8.3-RELEASE /usr/ports/textproc/groff 1.21 # # http://www.gnu.org/software/groff/ #------------------------------------------------------------------------------ # man gs: # The "-sDEVICE=" switch must precede the first mention of a file to # print. # gs5.10/use.txt line 169: # Individual documents also can (and often do) specify a paper size, # which will take precedence over the default one. If you want to force # a specific paper size, ignoring the paper size specified in the # document, make that paper size the default (as just described), # and also include -dFIXEDMEDIA. .if ! defined(GS_ARGS) #{ GS_ARGS = -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -q .endif #} # For a basic HP3P with no extension ram (beyond 1M basic) you need to use # 150 dpi instead of default 300 dpi. # GS_ARGS += -r150x150 # -dSAFER: Disables deletefile and renamefile operators #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .if !defined(GS_OUT) #{ GS_OUT = -sOutputFile=${.TARGET} # -sOutputFile=page.%02d.${.TARGET} .endif #} #------------------------------------------------------------------------------ warn_crop: # JJLATER @echo -n "Caution some .tiff from xsane that go through .ps, " @echo "the margin is cropped," @echo -n "no problem with pdf on screen, " @echo "but a problem when printed on paper." #------------------------------------------------------------------------------ .if !defined(COPY_IT) #{ # Note below $< & ${.IMPSRC} dont work. # Used for copying pre built .ps .pcl etc from private directory to public web. # --- # With a rule in a public_html/ sub directory Makefile this: # stadtmuenchen.g.bjc: ${WEB}/stadtmuenchen.g.bjc # @# ${COPY_IT} # The variables expand as follows: # ${.ALLSRC} /.amd_mnt/user/home/jhs/public_html/stadtmuenchen/../../\ # job/groff/letter/stadtmuenchen/web/stadtmuenchen.g.bjc \ # stadtmuenchen.g.ps # ${.IMPSRC} stadtmuenchen.g.ps # ${.OODATE} /.amd_mnt/user/home/jhs/public_html/stadtmuenchen/../..\ # /job/groff/letter/stadtmuenchen/web/stadtmuenchen.g.bjc \ # stadtmuenchen.g.ps # ${.PREFIX} stadtmuenchen.g # ${.TARGET} stadtmuenchen.g.bjc # $< stadtmuenchen.g.ps # So this rule fails: # COPY_IT = install -c -m 644 ${.ALLSRC} ${.TARGET} # COPY = install -c -m 644 ${SRCD}/${.TARGET} ${.TARGET} # I switched from install -c to install -C to save web upload time etc. COPY = install -C -m 644 ${SRCD}/${.TARGET} ${.TARGET} # Since ~jhs/public_html/gifs/card/Makefile has not one ${SRCD} but 3. # COPY does not work, so use COPY2 #------- # COPY2 = echo ALLSRC ${.ALLSRC} IMPSRC ${.IMPSRC} \ # OODATE ${.OODATE} PREFIX ${.PREFIX} TARGET ${.TARGET} zzz #------- COPY2 = install -C -m 644 ${.ALLSRC} ${.TARGET} .endif #} #------------------------------------------------------------------------------ # Umlauts Usage # \*(:a \*(:o \*(:u \*(:s \*(:A \*(:O \*(:U ))))))) # \*[:a] \*[:o] \*[:u] \*[:s] \*[:A] \*[:O] \*[:U] # M\*[:u]nchnerstra\*(:se ) #------------------------------------------------------------------------------ # DEFAULT INPUT-OUTPUT CONVERSION RULES - NORMAL DATA, NOT WYSIWYG # Alphabetic order #------------------------------------------------------------------------------ # grohtml (part of groff) PATHs FreeBSD Release # /usr/src/contrib/groff/src/devices/grohtml/ 4-11 # /usr/src/gnu/usr.bin/groff/src/devices/grohtmlMakefile/ 4-11 # /usr/src/gnu/usr.bin/groff/src/preproc/html/Makefile 4-10 # /usr/bin/ post-grohtml & pre-grohtml 6.4 & 9.2 # /usr/local/bin/ post-grohtml & pre-grohtml 12 # /usr/share/man/man1/gro* 9 no grohtml # /usr/local/man/man1/grohtml.1.gz 12 # man grohtml 6.4 & 9.2 Fails # man grohtml 12 OK CLEAN_GROHTML_ALL = grohtml-[0-9]*[0-9].png # [ -e ] does a syntax fail if more than one grohtml to test, # so reduce names to test a single. # Other tests fail if there is no grohtml to test, CLEAN_GROHTML_SINGLE != for i in `/bin/ls -1` ; do \ echo $$i ; \ done | grep grohtml | tail -1 # JJLATER Maybe try using some of these to add to ${GROFF_HTML_FLAGS} # to stop grohtml crapping ${CLEAN_GROHTML_ALL} # man grohtml : # -Ddir Inform grohtml to place all image files into directory dir. # -Istem Determine the image stem name. If omitted grohtml uses # grohtml-XXX (XXX is the process ID). # grohtml uses temporary files. See the groff(1) man page for details # where such files are created. GROFF_HTML_FLAGS = -Thtml GROFF_PS_ARGS = -Tps -dformat=ps # JJLATER export GROFF_PS_ARGS to some of the other Makefiles in ~ that use -Tps -dformat=ps # job/groff/badge.rof # job/groff/cv/common/Makefile # job/project/utimaco/admin/contract/2008-05-20_jhs.rof # job/project/utimaco/admin/contract/2008-05-28/beratervertrag_nu.rof # public_html/src/bsd/jhs/bin/local/lpf_berklix/lpf_berklix # public_html/src/bsd/jhs/bin/local/lpf_berklix/lpf_berklix_gdi # public_html/txt/papersize.lmth # txt/health/living_will_vollmacht_power_of_attorney/julian/roff/Makefile # txt/health/living_will_vollmacht_power_of_attorney/melanie/Makefile #------------------------------------------------------------------------------ # Later possible additions: # - html2ascii using lynx -dump # - latex2html using tth # - latex2ps direct # - latex2pdf direct #------------------------------------------------------------------------------ # Keep this as first target, .if !target(all) #{ all: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} _all @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(_all) #{ # JJLATER maybe make this run faster by examining all my Makefile & in many specifing all: pdf _all: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} le @# le is not on dependency line cos for debuging I want to see @cd ${.CURDIR}; ${MAKE_JHS} all2 @# all2 cannot be on dependency line, as we need to re-evaluate @# dependencies after links are made by le @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(all2) #{ all2: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} l_lmth e_lmth lmth l_html e_html html \ l_rof e_rof rof l_tex e_tex tex dvi pdf # ps .if defined(ALL) #{{ @cd ${.CURDIR}; ${MAKE_JHS} ${ALL} .else #}{ @# No: epson txt lst dos latin1 fax fig @# Too big to generate by default: bjccolor bjc600 .endif #}} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(install) #{ # Rule added 2022-06-17 @# Dummy, to satisfy a standard recursive make from ~/public_html install: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" .if defined(SUBDIR) #{ ${CMD_FOR_INSTALL} i in ${SUBDIR} ; do \ cd ${.CURDIR}/$$i ; make install ; cd .. ; \ done .endif #} @#echo "${T_BERKLIX} a dummy $@ label passed to `pwd`" @# JJLATER should I do SUBDIR befor or after top ? lok at bsd examples in /usr/share/mk/bsd.subdir.mk @true @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(obj) #{ obj: # JJLATER look at where text files get put in /usr/obj # find . -type f -name \*\.\* | rev | sort | rev @# Dummy, to satisfy a standard recursive make from $(HOME) @echo "${T_BERKLIX} a dummy $@ label passed to `pwd`" .endif #} #------------------------------------------------------------------------------ .if !target(cleandir) #{ cleandir: @# Dummy, to satisfy a standard recursive make from $(HOME) @echo "${T_BERKLIX} a dummy $@ label passed to `pwd`" .endif #} #------------------------------------------------------------------------------ .if !target(le) #{ le: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" .if defined(SUBDIR) #{ @# Allow recursion. @# Occasionally I need to manualy call le to recurse down @# before then calling clean. @# As a clean on its own wont otherwise see @# longer names to purge. @# echo "Next line used to degrade host power on" @# echo "/site/usr/local/www/Data/virtual/berklix.com " @# echo "so commented to just a suggestion" @echo "Suggestion cd ${.CURDIR}; ${MAKE_JHS} _SUBDIR" .endif #} @cd ${.CURDIR}; ${MAKE_JHS} l_ e_ @# This creates seperate language copies of any multi language masters @# JJLATER do I need le to depend on e_ as well as l_ ? @# Probably not, now I''ve seperated naming for link & extract stages. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" l_: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} l_rof l_lmth l_html l_tex @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" e_: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} e_rof e_lmth e_html e_tex @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} le #------------------------------------------------------------------------------ # MORE SINGLE TARGETS IN ALPHABETIC ORDER #------------------------------------------------------------------------------ .if !target(bjccolor) #{ bjccolor: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ps ${CMD_FOR_BUILD} i in ${FOR_PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .ps`.bjccolor ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(cdj670) #{ cdj670: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ps ${CMD_FOR_BUILD} i in ${FOR_PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .ps`.cdj670 ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(bjc600) #{ bjc600: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ps ${CMD_FOR_BUILD} i in ${FOR_PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .ps`.bjc600 ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(epsi) #{ epsi: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; cd ${.CURDIR}; ${MAKE_JHS} ps ${CMD_FOR_BUILD} i in ${FOR_PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .ps`.epsi ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean) #{ clean: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} _clean @# CURDIR is needed above for /home/jhs/public_html to jump back @# from make clean failing in /usr/obj/0s1/usr1/home/jhs/._dir/public_html .if target(cleanmore) #{ @echo "Suggestion: make cleanmore" .endif #} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .if !target(_clean) #{ # JJLATER maybe make this run faster by examining all my Makefile # & in many specifing clean: clean_pdf _clean: \ clean_gif clean_ljet4 clean_pcl_rof clean_pcl_ps clean_cdj670 \ clean_bjccolor clean_bjc600 clean_epson clean_dos \ clean_latin1 clean_txt clean_lst clean_vfig clean_fig \ clean_vps clean_aux clean_css clean_log clean_Vps clean_pdf \ clean_epsi clean_ps clean_mp3 clean_fax clean_txt clean_tiff \ clean_jpg clean_grohtml clean_png clean_pnm clean_dvi \ clean_vhtml clean_html clean_e_html clean_l_html clean_lmth \ clean_e_lmth clean_l_lmth clean_tex clean_e_tex clean_l_tex \ clean_rof clean_e_rof clean_l_rof @# Clean the lowest dependency first, then crawl back to top source, so @# sub rules do not have to know every source a .pcl can come from @# ------------------------ @# pre 2018-05-16: @# rm -f ${CLEAN} .if exists( ${CLEAN} ) #{ rm -f ${CLEAN} .else # }{ @# echo "Nothing extra to clean." .endif #} @# JJLATER test -e add an eval here of ${CLEAN} & if empty, skip it. @# ------------------------ @# rm -rf .xvpics .endif #} #------------------------------------------------------------------------------ # Clean Explanations. Take example clean_ps: # a smarter replacement for "rm *.ps" # (can''t be done that crudely as we have .ps masters eg photos in docs). # It cleans all .ps that could be rebuilt from an exisiting immediate # source. (ie existence of a .rof would cause a .ps of the same name # to be removed). More distant sources # such as a .e_rof with no .rof, also get a .ps removed, to ensure a # clean really does remove all it can, even if an intermediate file # is missing, The body of the rule does not itself clean things a .ps # could be used to generate, it sets dependencies to do that. #------------------------------------------------------------------------------ .if !target(clean_txt) #{ clean_txt: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.txt ; \ done @${CMD_FOR_CLEAN} i in ${FOR_M4} ; do \ rm -f `basename $$i .m4`.txt ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.txt ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.txt ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.txt ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.txt ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.txt ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TIFF} ; do \ rm -f `basename $$i .tiff`.txt \ `basename $$i .tiff`.txt_e \ `basename $$i .tiff`.txt_g ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_bjc600) #{ clean_bjc600: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ rm -f `basename $$i .ps`.bjc600 ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.bjc600 \ `basename $$i .rof`.[0-9]*.bjc600 ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.bjc600 \ `basename $$i .tex`.[0-9]*.bjc600 ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.bjc600 \ `basename $$i .e_rof`_$$j.[0-9]*.bjc600 ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.bjc600 \ `basename $$i .l_rof`_$$j.[0-9]*.bjc600 ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.bjc600 \ `basename $$i .e_tex`_$$j.[0-9]*.bjc600 ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.bjc600 \ `basename $$i .l_tex`_$$j.[0-9]*.bjc600 ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_cdj670) #{ clean_cdj670: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ rm -f `basename $$i .ps`.cdj670 ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.cdj670 \ `basename $$i .rof`.[0-9]*.cdj670 ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.cdj670 \ `basename $$i .tex`.[0-9]*.cdj670 ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.cdj670 \ `basename $$i .e_rof`_$$j.[0-9]*.cdj670 ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.cdj670 \ `basename $$i .l_rof`_$$j.[0-9]*.cdj670 ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.cdj670 \ `basename $$i .e_tex`_$$j.[0-9]*.cdj670 ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.cdj670 \ `basename $$i .l_tex`_$$j.[0-9]*.cdj670 ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_bjccolor) #{ clean_bjccolor: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ rm -f `basename $$i .ps`.bjccolor ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.bjccolor \ `basename $$i .rof`.[0-9]*.bjccolor ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.bjccolor \ `basename $$i .tex`.[0-9]*.bjccolor ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.bjccolor \ `basename $$i .e_rof`_$$j.[0-9]*.bjccolor ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.bjccolor \ `basename $$i .l_rof`_$$j.[0-9]*.bjccolor ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.bjccolor \ `basename $$i .e_tex`_$$j.[0-9]*.bjccolor ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.bjccolor \ `basename $$i .l_tex`_$$j.[0-9]*.bjccolor ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_aux) #{ clean_aux: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.aux ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.aux ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.aux ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_css) #{ clean_css: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.css ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.css ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.css ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_log) #{ clean_log: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.log ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.log ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.log ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_dos) #{ clean_dos: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_TXT} ; do \ rm -f `basename $$i .txt`.dos ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.dos ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.dos ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.dos ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.dos ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.dos ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.dos ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_dvi) #{ clean_dvi: clean_ps @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.dvi ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.dvi ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.dvi ; \ done ; \ done @# JJLATER maybe sometime add a ROF rule, but I do not currently @# generate .dvi images from .rof. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_epson) #{ clean_epson: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ rm -f `basename $$i .ps`.epson ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.epson \ `basename $$i .rof`.[0-9]*.epson ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.epson \ `basename $$i .tex`.[0-9]*.epson ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.epson \ `basename $$i .e_rof`_$$j.[0-9]*.epson ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.epson \ `basename $$i .l_rof`_$$j.[0-9]*.epson ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.epson \ `basename $$i .e_tex`_$$j.[0-9]*.epson ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.epson \ `basename $$i .l_tex`_$$j.[0-9]*.epson ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_e_html) #{ clean_e_html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_L_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_lmth`_$$j.e_html ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_e_rof) #{ clean_e_rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.e_rof ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_e_lmth) #{ clean_e_lmth: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_L_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_lmth`_$$j.e_lmth ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_e_tex) #{ clean_e_tex: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.e_tex ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_fax) #{ clean_fax: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# A fax file is an absolute master, received by a fax modem. @# I''ll ignore for now the fact one Can create a fax file using @# hylafax tools etc. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_tiff) #{ clean_tiff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# A tiff file is usually an absolute master, received from a scanner. @# but may sometime be @# where ${TIFFSPLIT} has split multiple pages from an ADF block. @${CMD_FOR_CLEAN} i in ${FOR_JPG} ; do \ rm -f `basename $$i .jpg`.tiff ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_fig) #{ clean_fig: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# A fig file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !target(clean_html) #{ clean_html: clean_ps clean_vhtml @${ECHO_START} "${T_START_RULE} ${.IMPSRC} clean_html \ ${T_START_TARGET} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.html ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.html ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.html ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_html`_$$j.html ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_html`_$$j.html ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_LMTH} ; do \ rm -f `basename $$i .lmth`.html ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_lmth`_$$j.html ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_lmth`_$$j.html ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.html ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.html ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.html ; \ done ; \ done @# groff-html-[0-9]*-[0-9]*.png are junk @# from groff ${GROFF_HTML_FLAGS} @# I used to do this: @# rm -f groff-html-[0-9]*-[0-9]*.png groff-html-[0-9]*-[0-9]*.gif @# but it''s just noise if nothing is there, so now do it silently: @${CMD_FOR_CLEAN} i in ${FOR_GROFF_HTML_JUNK} ; do \ rm -f $$i ; \ done .if ( target(index.html) ) #{ .if defined (DEBUG_BERKLIX_MK) @echo "${T_BERKLIX} Rebuild rule exists, so removing index.html" .endif rm -f index.html .else .if defined (DEBUG_BERKLIX_MK) @echo "${T_BERKLIX} No rule for index.html, not not removing it." .endif .endif #} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_html #------------------------------------------------------------------------------ .if !target(clean_latin1) #{ clean_latin1: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.latin1 ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.latin1 ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.latin1 ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_latin1 #------------------------------------------------------------------------------ .if !target(clean_l_html) #{ clean_l_html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# An l_html file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_l_html #------------------------------------------------------------------------------ .if !target(clean_l_lmth) #{ clean_l_lmth: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# An l_lmth file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_l_lmth #------------------------------------------------------------------------------ .if !target(clean_l_rof) #{ clean_l_rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# An l_rof file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_l_rof #------------------------------------------------------------------------------ .if !target(clean_l_tex) #{ clean_l_tex: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# An l_tex file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_l_tex #------------------------------------------------------------------------------ .if !target(clean_lmth) #{ clean_lmth: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} clean_html @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ rm -f `basename $$i .e_rof`.lmth ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.lmth ; \ done @# Assume EG fred.lmth can be rebuilt from fred.le. @# next bit not useful yet. @# Clean up after aborted wysiwyg edits of .lmth files @${CMD_FOR_CLEAN} i in ${FOR_E_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_lmth`_$$j.lmth ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_lmth`_$$j.lmth ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_lmth #------------------------------------------------------------------------------ .if !target(clean_lst) #{ clean_lst: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.lst ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.lst ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.lst ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .L_rof`_$$j.lst ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.lst ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.lst ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_lst #------------------------------------------------------------------------------ .if !target(clean_pcl_rof) #{ clean_pcl_rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# ${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ @# rm -f `basename $$i .ps`.pcl_rof ; \ @# done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.pcl_rof \ `basename $$i .rof`.[0-9]*.pcl_rof ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.pcl_rof \ `basename $$i .tex`.[0-9]*.pcl_rof ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.pcl_rof \ `basename $$i .e_rof`_$$j.[0-9]*.pcl_rof ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.pcl_rof \ `basename $$i .l_rof`_$$j.[0-9]*.pcl_rof ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.pcl_rof \ `basename $$i .e_tex`_$$j.[0-9]*.pcl_rof ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.pcl_rof \ `basename $$i .l_tex`_$$j.[0-9]*.pcl_rof ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_pcl_rof #------------------------------------------------------------------------------ .if !target(clean_ljet4) #{ clean_ljet4: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ rm -f ${.CURDIR}/`basename $$i .ps`.ljet4 ; \ done ${CMD_FOR_CLEAN} i in ${FOR_PDF} ; do \ rm -f ${.CURDIR}/`basename $$i .pdf`.ljet4 ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_ljet4 #------------------------------------------------------------------------------ .if !target(clean_pcl_ps) #{ clean_pcl_ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ rm -f `basename $$i .ps`.pcl_ps ; \ done @# These rof can 1st generate a .ps @# so it is valid to delete these .pcl_ps @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.pcl_ps \ `basename $$i .rof`.[0-9]*.pcl_ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.pcl_ps \ `basename $$i .tex`.[0-9]*.pcl_ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.pcl_ps \ `basename $$i .e_rof`_$$j.[0-9]*.pcl_ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.pcl_ps \ `basename $$i .l_rof`_$$j.[0-9]*.pcl_ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.pcl_ps \ `basename $$i .e_tex`_$$j.[0-9]*.pcl_ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.pcl_ps \ `basename $$i .l_tex`_$$j.[0-9]*.pcl_ps ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_pcl_ps #------------------------------------------------------------------------------ .if !target(clean_gif) #{ clean_gif: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ rm -f `basename $$i .ps`.gif ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.gif \ `basename $$i .rof`.[0-9]*.gif ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.gif \ `basename $$i .tex`.[0-9]*.gif ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.gif \ `basename $$i .e_rof`_$$j.[0-9]*.gif ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.gif \ `basename $$i .l_rof`_$$j.[0-9]*.gif ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.gif \ `basename $$i .e_tex`_$$j.[0-9]*.gif ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.gif \ `basename $$i .l_tex`_$$j.[0-9]*.gif ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_FIG} ; do \ rm -f `basename $$i .fig`.gif ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_gif #------------------------------------------------------------------------------ .if !target(clean_ps) #{ # Do not call clean_pcl_rof, as a .ps is not allowed # to make a.pcl_rof clean_ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} clean_pcl_ps clean_epson clean_cdj670 \ clean_bjccolor clean_bjc600 clean_vps @${CMD_FOR_CLEAN} i in ${FOR_PDF} ; do \ rm -f `basename $$i .pdf`.ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.ps `basename $$i .rof`.[0-9]*.ps ; \ done @# The .[0-9]*.ps are single page images. @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.ps \ `basename $$i .e_rof`_$$j.[0-9]*.ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.ps \ `basename $$i .l_rof`_$$j.[0-9]*.ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.ps `basename $$i .tex`.[0-9]*.ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.ps \ `basename $$i .e_tex`_$$j.[0-9]*.ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.ps \ `basename $$i .l_tex`_$$j.[0-9]*.ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_FAX} ; do \ rm -f `basename $$i .fax`.ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TIFF} ; do \ rm -f `basename $$i .tiff`.ps ; \ done @${ECHO_DOING} Zap .ps files created by xfig from .fig @${CMD_FOR_CLEAN} i in ${FOR_FIG} ; do \ rm -f `basename $$i .fig`.ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_M4} ; do \ rm -f `basename $$i .m4`.ps ; \ done @# Zap .ps files created manually by a browser @${CMD_FOR_CLEAN} i in ${FOR_HTML} ; do \ rm -f `basename $$i .html`.ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_html`_$$j.ps \ `basename $$i .e_html`_$$j.[0-9]*.ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_html`_$$j.ps \ `basename $$i .l_html`_$$j.[0-9]*.ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_LMTH} ; do \ rm -f `basename $$i .lmth`.ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_html`_$$j.ps \ `basename $$i .e_html`_$$j.[0-9]*.ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_html`_$$j.ps \ `basename $$i .l_html`_$$j.[0-9]*.ps ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_ps #------------------------------------------------------------------------------ .if !target(clean_epsi) #{ # .epsi created by eg ${PS2EPSI} clean_epsi: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} clean_pcl_ps clean_epson clean_cdj670 \ clean_bjccolor clean_bjc600 clean_vps @${CMD_FOR_CLEAN} i in ${FOR_PDF} ; do \ rm -f `basename $$i .pdf`.epsi ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.epsi \ `basename $$i .rof`.[0-9]*.epsi ; \ done @# The .[0-9]*.epsi are single page images. @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.epsi \ `basename $$i .e_rof`_$$j.[0-9]*.epsi ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.epsi \ `basename $$i .l_rof`_$$j.[0-9]*.epsi ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.epsi \ `basename $$i .tex`.[0-9]*.epsi ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.epsi \ `basename $$i .e_tex`_$$j.[0-9]*.epsi ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.epsi \ `basename $$i .l_tex`_$$j.[0-9]*.epsi ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_FAX} ; do \ rm -f `basename $$i .fax`.epsi ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TIFF} ; do \ rm -f `basename $$i .tiff`.epsi ; \ done @# Zap .epsi files created by xfig from .fig @${CMD_FOR_CLEAN} i in ${FOR_FIG} ; do \ rm -f `basename $$i .fig`.epsi ; \ done @${CMD_FOR_CLEAN} i in ${FOR_M4} ; do \ rm -f `basename $$i .m4`.epsi ; \ done @# Zap .epsi files created manually by a browser @${CMD_FOR_CLEAN} i in ${FOR_HTML} ; do \ rm -f `basename $$i .html`.epsi ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_html`_$$j.epsi \ `basename $$i .e_html`_$$j.[0-9]*.epsi ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_html`_$$j.epsi \ `basename $$i .l_html`_$$j.[0-9]*.epsi ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_LMTH} ; do \ rm -f `basename $$i .lmth`.epsi ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_html`_$$j.epsi \ `basename $$i .e_html`_$$j.[0-9]*.epsi ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_html`_$$j.epsi \ `basename $$i .l_html`_$$j.[0-9]*.epsi ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_epsi #------------------------------------------------------------------------------ .if !target(clean_png) #{ clean_png: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_PNG_UCASE} ; do \ rm -f `basename $$i .PNG`.png ; \ done @${CMD_FOR_CLEAN} i in ${FOR_PNM} ; do \ rm -f `basename $$i .PNM`.png ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_png #------------------------------------------------------------------------------ .if !target(clean_grohtml) #{ clean_grohtml: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @# I suppose ${CLEAN_GROHTML_ALL} are created by one or both of @# /usr/bin/post-grohtml /usr/bin/pre-grohtml @# called from target .rof.html: @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @-cd ${.CURDIR} && \ if [ -n "`echo ${CLEAN_GROHTML_SINGLE}`" ] ; then \ if [ -e "`echo ${CLEAN_GROHTML_SINGLE}`" ] ; then \ rm ${CLEAN_GROHTML_ALL} ; \ fi \ fi @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_grohtml #------------------------------------------------------------------------------ .if !target(clean_pnm) #{ clean_pnm: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @true @# Nothing to do, .pnm are master coming from xsane @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_pnm #------------------------------------------------------------------------------ .if !target(clean_jpg) #{ clean_jpg: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_JPG_UCASE} ; do \ rm -f `basename $$i .JPG`.jpg ; \ done @${CMD_FOR_CLEAN} i in ${FOR_PNG} ; do \ rm -f `basename $$i .png`.jpg ; \ done @${CMD_FOR_CLEAN} i in ${FOR_PNM} ; do \ rm -f `basename $$i .pnm`.jpg ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_jpg #------------------------------------------------------------------------------ .if !target(clean_pdf) #{ clean_pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_PDF_UCASE} ; do \ rm -f `basename $$i .PDF`.pdf ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.pdf \ `basename $$i .rof`.[0-9]*.pdf ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.pdf ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.pdf ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.pdf ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TIFF} ; do \ rm -f `basename $$i .tiff`.pdf ; \ done @${CMD_FOR_CLEAN} i in ${FOR_PNM} ; do \ rm -f `basename $$i .pnm`.pdf ; \ done @${CMD_FOR_CLEAN} i in ${FOR_PNG} ; do \ rm -f `basename $$i .png`.pdf ; \ done @${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ rm -f `basename $$i .ps`.pdf ; \ done @${CMD_FOR_CLEAN} i in ${FOR_FIG} ; do \ rm -f `basename $$i .fig`.pdf ; \ done @# JJLATER to examine all Makefiles before I enable rule below @# that I wrote after noticing pdf in ~/public_html/symmetric/pictures/ @# @${CMD_FOR_CLEAN} i in ${FOR_JPG} ; do \ @# rm -f `basename $$i .jpg`.pdf ; \ @# done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_pdf #------------------------------------------------------------------------------ .if !target(clean_rof) #{ clean_rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.rof ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.rof ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_rof #------------------------------------------------------------------------------ .if !target(clean_tex) #{ clean_tex: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} clean_dvi @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.tex ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.tex ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_tex #------------------------------------------------------------------------------ .if !target(clean_vps) || !target(clean_Vps) #{ # Do not call clean_pcl_rof clean_vps clean_Vps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} clean_pcl_ps clean_epson clean_cdj670 \ clean_bjccolor clean_bjc600 @# In case I''ve been editing postscript files eg fax cover sheet @# (where .ps is the master, not produced from eg a .rof). @${CMD_FOR_CLEAN} i in ${FOR_PS} ; do \ name=`basename $$i .ps` ; rm -f $${name}.[vV]ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ name=`basename $$i .rof` ; rm -f $${name}.[vV]ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_rof`_$$j.[vV]ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_ROF} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_rof`_$$j.[vV]ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ name=`basename $$i .tex` ; rm -f $${name}.[vV]ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_tex`_$$j.[vV]ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_TEX} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_tex`_$$j.[vV]ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_HTML} ; do \ name=`basename $$i .html` ; rm -f $${name}.[vV]ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_html`_$$j.[vV]ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_html`_$$j.[vV]ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_LMTH} ; do \ name=`basename $$i .lmth` ; rm -f $${name}.[vV]ps ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_lmth`_$$j.[vV]ps ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_lmth`_$$j.[vV]ps ; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_vps #------------------------------------------------------------------------------ .if !target(clean_vfig) #{ clean_vfig: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# Clean up after aborted wysiwyg edits of .fig files @${CMD_FOR_CLEAN} i in ${FOR_FIG} ; do \ rm -f `basename $$i .fig`.vfig ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_vfig #------------------------------------------------------------------------------ .if !target(clean_vhtml) #{ clean_vhtml: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# Clean up after aborted wysiwyg edits of .html files @${CMD_FOR_CLEAN} i in ${FOR_HTML} ; do \ rm -f `basename $$i .html`.vhtml ; \ done @${CMD_FOR_CLEAN} i in ${FOR_ROF} ; do \ rm -f `basename $$i .rof`.vtml ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_html`_$$j.vhtml ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_HTML} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_html`_$$j.vthml ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_LMTH} ; do \ rm -f `basename $$i .lmth`.vtml ; \ done @${CMD_FOR_CLEAN} i in ${FOR_E_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .e_lmth`_$$j.vhtml ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_L_LMTH} ; do \ for j in ${LANGS} ; do \ rm -f `basename $$i .l_lmth`_$$j.vhtml ; \ done ; \ done @${CMD_FOR_CLEAN} i in ${FOR_TEX} ; do \ rm -f `basename $$i .tex`.vtml ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_vhtml #------------------------------------------------------------------------------ .if !target(dvi) #{ dvi: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} rof ${CMD_FOR_BUILD} i in ${FOR_TEX} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tex`.dvi ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} dvi #------------------------------------------------------------------------------ .if !target(e_html) #{ e_html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR} && ${MAKE_JHS} l_html ${CMD_FOR_BUILD} i in ${FOR_L_HTML} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ echo "${T_BERKLIX} ${T_PRE_EXIST} $$i" ; \ bla=`basename $$i .l_html` ; \ for j in ${LANGS} ; do \ ${ECHO_DOING} "Doing $${bla}_$$j.e_html" ; \ if ! test -e $${bla}_$$j.e_html ; then \ ln -s $$i $${bla}_$$j.e_html ; \ echo "$${bla}_$$j.e_html" ; \ fi; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} e_html #------------------------------------------------------------------------------ .if !target(e_lmth) #{ e_lmth: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} l_lmth ${CMD_FOR_BUILD} i in ${FOR_L_LMTH} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ echo "${T_BERKLIX} ${T_PRE_EXIST} $$i" ; \ bla=`basename $$i .l_lmth` ; \ for j in ${LANGS} ; do \ ${ECHO_DOING} "Doing $${bla}_$$j.e_lmth" ; \ if ! test -e $${bla}_$$j.e_lmth ; then \ ln -s $$i $${bla}_$$j.e_lmth ; \ echo "$${bla}_$$j.e_lmth" ; \ fi; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} e_lmth #------------------------------------------------------------------------------ .if !target(e_rof) #{ # Create 2 or more sym links for extracting English & German language, # such as resume_e.e_rof resume_g.e_rof e_rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} l_rof ${CMD_FOR_BUILD} i in ${FOR_L_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ echo "${T_BERKLIX} ${T_PRE_EXIST} $$i" ; \ bla=`basename $$i .l_rof` ; \ for j in ${LANGS} ; do \ ${ECHO_DOING} "Doing $${bla}_$$j.e_rof" ; \ if ! test -e $${bla}_$$j.e_rof ; then \ ln -s $$i $${bla}_$$j.e_rof ; \ echo "$${bla}_$$j.e_rof" ; \ fi; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} e_rof #------------------------------------------------------------------------------ .if !target(e_tex) #{ e_tex: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} l_tex ${CMD_FOR_BUILD} i in ${FOR_L_TEX} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ echo "${T_BERKLIX} ${T_PRE_EXIST} $$i" ; \ bla=`basename $$i .l_tex` ; \ for j in ${LANGS} ; do \ ${ECHO_DOING} "Doing $${bla}_$$j.e_tex" ; \ if ! test -e $${bla}_$$j.e_tex ; then \ ln -s $$i $${bla}_$$j.e_tex ; \ echo "$${bla}_$$j.e_tex" ; \ fi; \ done ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} e_tex #------------------------------------------------------------------------------ .if !target(epson) #{ epson: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} rof ${CMD_FOR_BUILD} i in ${FOR_PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .ps`.epson ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} epson #------------------------------------------------------------------------------ .if !target(html) #{ html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" .if !defined(PDF_TO_HTML_FORCE) #{{ @# Add functionality to get "${MAKE_JHS} html" go into SUBDIRs @# /usr/share/mk/bsd.subdir.mk has this: @# .for __target in all all-man checkdpadd clean cleandepend @# cleandir \ @# depend distribute lint maninstall \ @# obj objlink realinstall regress tags @# ${__target}: _SUBDIR @# .endfor @# So I do this: .if defined(SUBDIR) @# the if defined above is so I dont have to add @# .include @# even in public/html/......../Makefile that dont have SUBDIR += @# echo -n "Next line used to degrade host power on " @# echo -n "/site/usr/local/www/Data/virtual/berklix.com " @# echo "so commented to just a suggestion" @echo "Suggestion: cd ${.CURDIR}; ${MAKE_JHS} _SUBDIR" @# JJLATER This goes Recursive: ${MAKE_JHS} _SUBDIR @# JJLATER so for nor I manually do: @# foreach i ( `find . -type d` ) @# pushd $i @# ( ${MAKE_JHS} html ) @# echo DONE $i @# popd @# end .endif @# cd ${.CURDIR} is for ~/public_html which sometimes has an obj/ @cd ${.CURDIR} && ${MAKE_JHS} e_html lmth rof tex ${CMD_FOR_BUILD} i in ${FOR_E_HTML} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ ${ECHO_DOING} "Doing $$i" ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .e_html`.html ; \ done ${CMD_FOR_BUILD} i in ${FOR_LMTH} ; do \ ls -l `basename $$i .lmth`.* ; \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ ${ECHO_DOING} "Doing $$i" ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .lmth`.html ; \ ls -l `basename $$i .lmth`.* ; \ done ${CMD_FOR_BUILD} i in ${FOR_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .rof`.html ; \ done ${CMD_FOR_BUILD} i in ${FOR_TEX} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tex`.html ; \ done @cd ${.CURDIR} && ${MAKE_JHS} _index.html @# ${.CURDIR} above as my ~/public_html also has a /usr/obj equiv. .else # }{ # PDF_TO_HTML_FORCE ${CMD_FOR_BUILD} i in ${FOR_PDF} ; do \ ${ECHO_DOING} "Doing $$i" ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .pdf`.html ; \ done .endif # }} # PDF_TO_HTML_FORCE @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} html #------------------------------------------------------------------------------ # Can not call this target index.html, else it prevents # index.html being built from index.lmth .if !target(_index.html) #{ _index.html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" if [ -e index_e.html ] && [ ! -e index.html ]; then \ echo "${T_BERKLIX} ${T_PRE_EXIST} index_e.html" ; \ ln -s index_e.html index.html ; \ fi @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} _index.html #------------------------------------------------------------------------------ .if !target(l_html) #{ l_html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# An l_html file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} l_html #------------------------------------------------------------------------------ .if !target(l_lmth) #{ l_lmth: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# An l_lmth file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} l_lmth #------------------------------------------------------------------------------ .if !target(l_rof) #{ l_rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# An l_rof file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} l_rof #------------------------------------------------------------------------------ .if !target(l_tex) #{ l_tex: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# An l_tex file is an absolute master, made by human, not machine. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} l_tex #------------------------------------------------------------------------------ .if !target(lmth) #{ lmth: e_lmth rof tex @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_E_LMTH} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .e_lmth`.lmth ; \ done ${CMD_FOR_BUILD} i in ${FOR_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .rof`.lmth ; \ done ${CMD_FOR_BUILD} i in ${FOR_TEX} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tex`.lmth ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} lmth #------------------------------------------------------------------------------ .if !target(lmth_links) #{ .if !defined(LMTH_TARGET) #{ LMTH_TARGET_1 != pwd LMTH_TARGET_2 != basename ${LMTH_TARGET_1} LMTH_TARGET = ${LMTH_TARGET_2}.lmth .endif #} lmth_links: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${LMTH_LINKS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ if test ! -h $$i; then \ echo "${T_BERKLIX} ${T_PRE_EXIST} ${LMTH_TARGET}" ; \ ln -s ${LMTH_TARGET} $$i ; \ else \ echo Link already exists: $$i ; \ fi ; \ ls -l $$i ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} lmth_links #------------------------------------------------------------------------------ .if !target(lst) #{ lst: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} rof ${CMD_FOR_BUILD} i in ${FOR_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .rof`.lst ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} lst #------------------------------------------------------------------------------ .if !target(pcl_rof) #{ pcl_rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} rof ${CMD_FOR_BUILD} i in ${FOR_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .rof`.pcl_rof ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} pcl_rof #------------------------------------------------------------------------------ .if !target(pcl_ps) #{ pcl_ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @echo "Making .pcl from .ps" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ps ${CMD_FOR_BUILD} i in ${FOR_PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .ps`.pcl_ps ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} pcl_ps #------------------------------------------------------------------------------ .if !target(pcl) #{ pcl: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ps @echo -n "${T_BERKLIX} Suffix PCL no longer exists, " @echo "you must choose pcl_ps or pcl_rof" @echo "A .pcl_rof is a .pcl produced direct from a .rof with groff" @echo "FreeBSD-8.2 in ~jhs/job/groff/card/paper groff spacing fails." @echo -n "A .pcl_ps is a .pcl produced from a .ps maybe from a .rof " @echo "with the .ps to .pcl via ghostscript." @echo "On FreeBSD-8.2 in ~jhs/job/groff/card/paper/ gs spacing is OK" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} pcl #------------------------------------------------------------------------------ # Rule added 2023-01-07 .if !target(txt) #{ txt: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @echo "Making .txt from .tiff" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# Do sub dirs first in case they might be needed by top dir. ${CMD_FOR_BUILD} i in ${SUBDIR} ; do \ echo "{ Entering $$i" ; \ cd ${.CURDIR}/$$i ; ${MAKE_JHS} $@ ; \ echo "} Exiting $$i" ; \ done @# Now do any remaining files in top dir. ${CMD_FOR_BUILD} i in ${FOR_TIFF} ; do \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.txt ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} txt #------------------------------------------------------------------------------ # Rule added 2023-06-06 .if !target(txt_e) #{ txt_e: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @echo "Making .txt_e from .tiff" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# Do sub dirs first in case they might be needed by top dir. ${CMD_FOR_BUILD} i in ${SUBDIR} ; do \ echo "{ Entering $$i" ; \ cd ${.CURDIR}/$$i ; ${MAKE_JHS} $@ ; \ echo "} Exiting $$i" ; \ done @# Now do any remaining files in top dir. ${CMD_FOR_BUILD} i in ${FOR_TIFF} ; do \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.txt_e ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} txt #------------------------------------------------------------------------------ # Rule added 2023-06-06 .if !target(txt_g) #{ txt_g: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @echo "Making .txt_g from .tiff" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# Do sub dirs first in case they might be needed by top dir. ${CMD_FOR_BUILD} i in ${SUBDIR} ; do \ echo "{ Entering $$i" ; \ cd ${.CURDIR}/$$i ; ${MAKE_JHS} $@ ; \ echo "} Exiting $$i" ; \ done @# Now do any remaining files in top dir. ${CMD_FOR_BUILD} i in ${FOR_TIFF} ; do \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.txt_g ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} txt #------------------------------------------------------------------------------ .if !target(pdf2ps_maybe) #{ pdf2ps_maybe: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" .if defined(PDF_PS) #{ Default: Undefined. @echo "${T_BERKLIX} PDF_PS is defined, unusual." .else @echo -n "${T_BERKLIX} PDF_PS undefined as normal. " @echo "You might want it for eg .ps to .pcl" .endif #} @# echo -n "${T_BERKLIX} The echoes above do " @# echo "Not report the truth ${PDF_PS}." @# cd ${.CURDIR}; ${MAKE_JHS} pdf @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} pdf2ps_maybe #------------------------------------------------------------------------------ .if !target(ps) #{ ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} rof tex pdf2ps_maybe fig ${CMD_FOR_BUILD} i in ${FOR_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .rof`.ps ; \ done ${CMD_FOR_BUILD} i in ${FOR_TEX} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tex`.ps ; \ done ${CMD_FOR_BUILD} i in ${FOR_FIG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .fig`.ps ; \ done ${CMD_FOR_BUILD} i in ${FOR_TIFF2PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.ps ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} ps #------------------------------------------------------------------------------ .if !target(eps) #{ eps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} fig ${CMD_FOR_BUILD} i in ${FOR_FIG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .fig`.eps ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} eps #------------------------------------------------------------------------------ .if !target(gif) #{ gif: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ps ${CMD_FOR_BUILD} i in ${FOR_PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .ps`.gif ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} gif #------------------------------------------------------------------------------ .if !target(JPG) #{ JPG: # Must move all .JPG to .jpg to avoid need of duplicate rules @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_JPG_UCASE} ; \ do mv $$i `basename $$i .JPG`.jpg ; done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} JPG .if !target(PDF) #{ PDF: # Must move all .PDF to .pdf to avoid need of duplicate rules @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_PDF_UCASE} ; \ do mv $$i `basename $$i .PDF`.pdf ; done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} PDF .if !target(PNG) #{ PNG: # Must move all .PNG to .png to avoid need of duplicate rules @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_PNG_UCASE} ; \ do mv $$i `basename $$i .PNG`.png ; done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} PNG .if !target(TIF) #{ TIF: # Must move all .TIF to .tiff to avoid need of duplicate rules @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_TIF_UCASE} ; \ do mv $$i `basename $$i .TIF`.tiff ; done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} TIF .if !target(TIFF) #{ TIFF: # Must move all .TIFF to .tiff to avoid need of duplicate rules @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_TIFF_UCASE} ; \ do mv $$i `basename $$i .TIFF`.tiff ; done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} TIFF .if !target(jpeg) #{ jpeg: # Must move all .jpeg to .jpg to avoid need of duplicate rules @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_JPEG} ; \ do mv $$i `basename $$i .jpeg`.jpg ; done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} jpeg # .tif must be moved to .tiff to avoid need of duplicate rules .if !target(tif) #{ tif: # Must move all .tif to .tiff to avoid need of duplicate rules @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_TIF} ; \ do mv $$i `basename $$i .tif`.tiff ; done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} tif #------------------------------------------------------------------------------ .if !target(jpg) #{ jpg: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# cd ${.CURDIR}; ${MAKE_JHS} png .if !defined(TIFF_TO_JPG_FORCE) #{{ ${CMD_FOR_BUILD} i in ${FOR_PNG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5};\ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .png`.jpg ; \ done @# 2019-01-17 added .pnm ${CMD_FOR_BUILD} i in ${FOR_PNM} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5};\ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .pnm`.jpg ; \ done .else # }{ # TIFF_TO_JPG_FORCE ${CMD_FOR_BUILD} i in ${FOR_TIFF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5};\ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.jpg ; \ done .endif # }} # TIFF_TO_JPG_FORCE @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} jpg #------------------------------------------------------------------------------ .if !target(pdf) #{ # though, else maybe not enough will get built ? # 2009.03.02 I deleted dependency .tiff.ps , # because .ps output files are enormous & I have a .tiff.pdf # rule that pipes direct. I might need to add rof back in pdf: tiff @# .ps are either imported masters. or created from non .ps masters. @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# ------- @# cd ${.CURDIR}; ${MAKE_JHS} tex rof fig tiff tif @# 2019-06-03: removed tiff above & appended jpg @# cd ${.CURDIR}; ${MAKE_JHS} tex rof fig @# ------- @# 2020-12-13 Problem: @# In A directory with just sample.png : @# make sample.pdf just produces sample.pdf @# but @# make pdf produces sample.pdf & sample.jpg @# because pdf: calls jpg: @# but I dont want sample.jpg @# So I removed jpg @cd ${.CURDIR}; ${MAKE_JHS} tex rof fig @# ------- @# Do sub dirs first in case they might be needed by top dir. ${CMD_FOR_BUILD} i in ${SUBDIR} ; do \ echo "{ Entering $$i" ; \ cd ${.CURDIR}/$$i ; ${MAKE_JHS} $@ ; \ echo "} Exiting $$i" ; \ done @# Now do any remaining files in top dir. @# ------- @# No ps as I dont edit .ps: ${CMD_FOR_BUILD} i in ${FOR_TEX} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tex`.pdf; \ done @# ${CMD_FOR_BUILD} i in ${FOR_TIFF} ${FOR_TIF} ; do \ @# ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ @# ${EQUAL5} ; \ @# cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.pdf ; \ @# done @# 2019-06-03: removed above 10 lines & appended 5 below. ${CMD_FOR_BUILD} i in ${FOR_JPG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .jpg`.pdf; \ done ${CMD_FOR_BUILD} i in ${FOR_FIG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .fig`.pdf ; \ done @# There was no .rof.pdf rule, @# just rules for .rof.ps & a .ps.pdf, @# so first try to ${MAKE_JHS} from a .rof ${CMD_FOR_BUILD} i in ${FOR_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .rof`.pdf; \ done @# second try to ${MAKE_JHS} any .pdf still missing from a .ps ${CMD_FOR_BUILD} i in ${FOR_PS} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .ps`.pdf; \ done ${CMD_FOR_BUILD} i in ${FOR_PDF_UCASE} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .PDF`.pdf ; \ done ${CMD_FOR_BUILD} i in ${FOR_PNG_UCASE} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .PNG`.pdf ; \ done ${CMD_FOR_BUILD} i in ${FOR_PNG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .png`.pdf ; \ done ${CMD_FOR_BUILD} i in ${FOR_PNM} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .pnm`.pdf ; \ done ${CMD_FOR_BUILD} i in ${FOR_TIFF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.pdf ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} pdf #------------------------------------------------------------------------------ .if !target(png) #{ png: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_PNG_UCASE} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .PNG`.png ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} png #------------------------------------------------------------------------------ .if !target(pnm) #{ pnm: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @echo "Dummy rule in berklix2.mk , normaly .pnm created by xsane" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} pnm #------------------------------------------------------------------------------ .if !target(rof) #{ rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} e_rof ${CMD_FOR_BUILD} i in ${FOR_E_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .e_rof`.rof ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # Pre 2004.05.14, the single line with `make` was 3 lines: # for j in ${LANGS} ; do \ # rm -f `basename $$i .e_rof`_$$j.rof ; \ # done ; .endif #} rof #------------------------------------------------------------------------------ .if !target(tif2tiff) #{ tif2tiff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_TIF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ mv ${.CURDIR}/$$i ${.CURDIR}/`basename $$i .tif`.tiff ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} tif2tiff #------------------------------------------------------------------------------ .if !target(tiff) #{ # SUBDIR_ALL_RECURSIVE=YES # is not defined here, but either on command line, or # in a Makefile that owns a collection of sub directories # where recursion is desired, automaticaly evaluating SUBDIR # to apply to every sub directory. .if defined(SUBDIR_ALL_RECURSIVE) SUBDIR != find -s . -type d -depth 1 .endif tiff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" .if defined(SUBDIR) #{ @echo "$@ Recursion Started" for i in ${SUBDIR} ; do \ echo "Started $@ in ${.CURDIR}/$$i" ; \ cd ${.CURDIR}/$$i ; \ if test "${SUBDIR_ALL_RECURSIVE}" = "YES" ; \ then \ make SUBDIR_ALL_RECURSIVE=YES $@ ; \ else \ make $@ ; \ fi ; \ cd .. ; \ echo "Ending $@ in ${.CURDIR}/$$i" ; \ done @echo "$@ Recursion Ended" @echo "$@ top directory Started ${.CURDIR}" .endif ${CMD_FOR_BUILD} i in ${FOR_TIF_UCASE} ; do \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .TIF`.tiff ; \ done ${CMD_FOR_BUILD} i in ${FOR_TIFF_UCASE} ; do \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .TIFF`.tiff ; \ done ${CMD_FOR_BUILD} i in ${FOR_TIF} ; do \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tif`.tiff ; \ done .if !defined(PDF_TO_TIFF_FORCE) #{{ @# Next CMD_FOR_BUILD added 2019-08-22 @# As Xsane save by default to .pnm, not to .tiff, @# brackets.c balancer < < @# & as we have rules for .pnm > .jpg > .tiff ${CMD_FOR_BUILD} i in ${FOR_PNM} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .pnm`.jpg ; \ done ${CMD_FOR_BUILD} i in ${FOR_JPG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .jpg`.tiff ; \ done @echo -n "To convert pdf back to tiff use: " @echo "make PDF_TO_TIFF_FORCE=TRUE tiff" @# Often its to join pdf pages together eg tiffcp pages*.tiff all.tiff @# then back: make all.pdf @# But I have since realised that is horrible as the resultant @# pdf does not contain text that can be mouse copied, whereas @# the output from the experiment below .pdf.pdfwriter with gs can be moused. .else # }{ # PDF_TO_TIFF_FORCE @# Code below added 2019-05-14 so I can reverse my A4 PDF in @# ~/public_html/brexit/posters to tiff, convert to jpg, @# then create a gallery with cthumb. @# Another use is to convert imported .pdf to .tiff, then tiffcp @# then bundle to larger .pdf, though that looses things: @# - looses quality of images in diagrams @# - bloated .pdf as now all just bitimage @# - the text ins .pdf can no longer be extracted by mouse copy. ${CMD_FOR_BUILD} i in ${FOR_PDF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .pdf`.tiff ; \ done .endif # }} # PDF_TO_TIFF_FORCE @echo "$@ top directory Ended ${.CURDIR}" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} tiff #------------------------------------------------------------------------------ .if !target(.pdf.pdfwriter) #{ # This research was done so I could concatenate pdfs in ~/public_html/txt/airbag/service_manual/ # Assume a Makefile contains: # combined.pdfwriter:: page1.pdf page2.pdf # then do: cp /dev/null combined.pdf; make combined.pdfwriter .pdf.pdfwriter: gs -dNOPAUSE -dBATCH -q -sDEVICE=pdfwrite -sOutputFile=$@ ${.ALLSRC} # Experiment on joining multiple PDF to common output pdf: # ls -l /usr/local/bin/pdftk /usr/local/bin/qpdf # Not looked at them further JJLATER /usr/ports/print/ # (cd ~/public_html/cv ; cp stacey_e.1.pdf stacey_g.2.pdf ~/tmp ) # cd ~/tmp # gs --help > gs.opts ; vi -c/DEVICE gs.opts # gs -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -dBATCH -q -sDEVICE=pdfimage24 -sOutputFile=combi_image24.pdf stacey_e.1.pdf stacey_g.2.pdf # gs -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -dBATCH -q -sDEVICE=pdfimage32 -sOutputFile=combi_image32.pdf stacey_e.1.pdf stacey_g.2.pdf # gs -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -dBATCH -q -sDEVICE=pdfimage8 -sOutputFile=combi_image8.pdf stacey_e.1.pdf stacey_g.2.pdf # gs -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -dBATCH -q -sDEVICE=pdfocr24 -sOutputFile=combi_ocr24.pdf stacey_e.1.pdf stacey_g.2.pdf # gs -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -dBATCH -q -sDEVICE=pdfocr32 -sOutputFile=combi_ocr32.pdf stacey_e.1.pdf stacey_g.2.pdf # gs -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -dBATCH -q -sDEVICE=pdfocr8 -sOutputFile=combi_ocr8.pdf stacey_e.1.pdf stacey_g.2.pdf # gs -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -dBATCH -q -sDEVICE=pdfwrite -sOutputFile=combi_write.pdf stacey_e.1.pdf stacey_g.2.pdf # file combi*.pdf stacey_e.1.pdf stacey_g.2.pdf # combi_image24.pdf: PDF document, version 1.3 # combi_image32.pdf: PDF document, version 1.3 # combi_image8.pdf: PDF document, version 1.3 # combi_ocr24.pdf: PDF document, version 1.3 # combi_ocr32.pdf: PDF document, version 1.3 # combi_ocr8.pdf: PDF document, version 1.3 # combi_write.pdf: PDF document, version 1.7, 2 pages # stacey_e.1.pdf: PDF document, version 1.4, 1 pages # stacey_g.2.pdf: PDF document, version 1.4, 1 pages # ls -l combi*.pdf stacey_e.1.pdf stacey_g.2.pdf # 1722788 combi_image24.pdf # 1731032 combi_image32.pdf # 1128396 combi_image8.pdf # 1743863 combi_ocr24.pdf # 1752398 combi_ocr32.pdf # 1149471 combi_ocr8.pdf # 51195 combi_write.pdf # 39775 stacey_e.1.pdf # 31220 stacey_g.2.pdf # foreach i ( combi_*.pdf ) # shrinkpdf $i > shrink_$i # end # ls -l shrink_*.pdf # 530099 shrink_combi_image24.pdf # 727608 shrink_combi_image32.pdf # 321283 shrink_combi_image8.pdf # 550014 shrink_combi_ocr24.pdf # 747790 shrink_combi_ocr32.pdf # 341198 shrink_combi_ocr8.pdf # 49585 shrink_combi_write.pdf # file shrink_*.pdf # shrink_combi_image24.pdf: PDF document, version 1.3, 2 pages # shrink_combi_image32.pdf: PDF document, version 1.3, 2 pages # shrink_combi_image8.pdf: PDF document, version 1.3, 2 pages # shrink_combi_ocr24.pdf: PDF document, version 1.3, 2 pages # shrink_combi_ocr32.pdf: PDF document, version 1.3, 2 pages # shrink_combi_ocr8.pdf: PDF document, version 1.3, 2 pages # shrink_combi_write.pdf: PDF document, version 1.3, 2 pages # echo "Now see if mouse can copy paste from these:" # foreach i ( combi_*.pdf ) # echo doing $i # xpdf $i # end # combi_image24.pdf NO # combi_image32.pdf NO # combi_image8.pdf NO # combi_ocr24.pdf YES # combi_ocr32.pdf YES # combi_ocr8.pdf YES # combi_write.pdf YES # foreach i ( shrink_combi_*.pdf ) # echo doing $i # echo doing $i # xpdf $i # end # shrink_combi_image24.pdf NO # shrink_combi_image32.pdf NO # shrink_combi_image8.pdf NO # shrink_combi_ocr24.pdf YES # shrink_combi_ocr32.pdf YES but some were vertical offset # shrink_combi_ocr8.pdf YES # shrink_combi_write.pdf YES # Conclusion: # -sDEVICE=pdfwrite seems best, as it produces much # smaller .pdf that do not need to be shrunk, & also # is mouseable text, however it is "PDF document, # version 1.7" & I recall some HMRC .pdf that used # to be 1.7. that some of my pdf tools could not # handle, but xpdf on freebsd-12.4 has no problem, # so that is the format I will use for now. # gs -sPAPERSIZE=a4 -dFIXEDMEDIA -dNOPAUSE -dBATCH -q -sDEVICE=pdfwrite -sOutputFile=output.pdf input1.pdf input2.pdf # gs -dNOPAUSE -dBATCH -q -sDEVICE=pdfwrite -sOutputFile=output.pdf input1.pdf input2.pdf # https://ghostscript.com/docs/9.54.0/Devices.htm # https://ghostscript.com/docs/9.54.0/Devices.htm#PDF # pdfimage8, pdfimage24, pdfimage32 and PCLm # for raster printing # pdfocr8, pdfocr24 and pdfocr32. # These produce valid PDF files with # a colour depth of 8 (Gray), 24 # (RGB) or 32 (CMYK). # ---- # 4.3 Vector PDF output (with OCR # Unicode CMaps) The pdfwrite device # has been augmented to use the OCR # engine to analyse text (not images!) # in the input stream, and derive # Unicode code points for it. That # information can then be used to # create ToUnicode CMaps which are # attached to the Font (or CIDFont) # objects embedded in the PDF file. .endif #} .pdf.pdfwriter #------------------------------------------------------------------------------ .if !target(fig) #{ fig: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${CMD_FOR_BUILD} i in ${FOR_FIG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .fig`.pdf ; \ done @# ${CMD_FOR_BUILD} i in ${FOR_FIG} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ @# cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .fig`.ps ; \ @# done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} fig #------------------------------------------------------------------------------ .if !target(${TXT_BERKLIX}) #{ # A previous .if !target(txt) did not avoid warning: # "/usr/share/mk/bsd.subdir.mk", line 66: # warning: duplicate script for target "txt" ignored # So to avoid trouble 2020-08-15 I experimentaly renamed rule set # txt: # to # txt_berklix: # Note I have not touched prefix .txt ${TXT_BERKLIX}: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} rof tiff tif @# brackets.c balancer < < @# ps # ps is for tex > ps > txt ${CMD_FOR_BUILD} i in ${FOR_ROF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .rof`.txt ; \ done @# I could add something to ignore warnings such as @# warning: can''t find font ``H'' ${CMD_FOR_BUILD} i in ${FOR_TEX} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tex`.txt ; \ done @cd ${.CURDIR}; ${MAKE_JHS} tiff tif @# rof is not necessary. @# OCR next ${CMD_FOR_BUILD} i in ${FOR_TIFF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.txt ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} ${TXT_BERKLIX} #------------------------------------------------------------------------------ .if !target(txt_e) #{ txt_e: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} tiff tif @# rof is not necessary. @# OCR next ${CMD_FOR_BUILD} i in ${FOR_TIFF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.txt_e ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} txt_e #------------------------------------------------------------------------------ .if !target(txt_g) #{ txt_g: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} tiff tif @# rof is not necessary. @# OCR next ${CMD_FOR_BUILD} i in ${FOR_TIFF} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ echo aa1;\ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .tiff`.txt_g ; \ echo aa2;\ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} txt_g #------------------------------------------------------------------------------ .if !target(tex) #{ tex: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} e_tex ${CMD_FOR_BUILD} i in ${FOR_E_TEX} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .e_tex`.tex ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} tex #------------------------------------------------------------------------------ .if !target(tools) #{ tools: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${BUILD_TOOLS} ${VIEW_TOOLS} ${CHECK_TOOLS} @# You can run "${MAKE_JHS} tools" (as root) to install all tools @# on a new host, before you later run "${MAKE_JHS} all" @# as a normal user. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} tools #------------------------------------------------------------------------------ .if !target(view) #{ view: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${VIEW_TOOLS} @echo "${T_BERKLIX} Try one of ${MAKE_JHS} view_ps view_pdf view_dvi" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} view #------------------------------------------------------------------------------ .if !target(view_dvi) #{ view_dvi: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" # ${XDVI} ${GHOSTVIEW} ${GV} ${GS} @cd ${.CURDIR}; ${MAKE_JHS} ${TARGS_DVI} @${CMD_FOR_CLEAN} i in $(TARGS_PS) ; \ do \ @if [ -x ${XDVI} ]; then \ ${XDVI} ${XDVI_ARGS} $$i ; \ elif [ -x ${GHOSTVIEW} ]; then \ ${GHOSTVIEW} $$i ; \ elif [ -x ${GV} ]; then \ ${GV} $$i ; \ elif [ -x ${GS} ]; then \ ${GS} -sPAPERSIZE=a4 $$i ; \ fi ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} view_dvi #------------------------------------------------------------------------------ .if !target(view_pdf) #{ view_pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${TARGS_PDF} # ${ACROREAD} ${GHOSTVIEW} ${GV} ${GS} @${CMD_FOR_CLEAN} i in $(TARGS_PS) ; \ do \ @if [ -x ${ACROREAD} ]; then \ ${ACROREAD} $$i ; \ elif [ -x ${GHOSTVIEW} ]; then \ ${GHOSTVIEW} $$i ; \ elif [ -x ${GV} ]; then \ ${GV} $$i ; \ elif [ -x ${GS} ]; then \ ${GS} -sPAPERSIZE=a4 $$i ; \ fi ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} view_pdf #------------------------------------------------------------------------------ .if !target(view_ps) #{ view_ps: # ${GV} ${GHOSTVIEW} ${GS} @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${TARGS_PS} @${CMD_FOR_CLEAN} i in $(TARGS_PS) ; \ do \ @if [ -x ${GV} ]; then \ ${GV} -media a4 -antialias $$i ; \ elif [ -x ${GHOSTVIEW} ]; then \ ${GHOSTVIEW} $$i.ps; \ elif [ -x ${GS} ]; then \ ${GS} -sPAPERSIZE=a4 $$i.ps; \ fi ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} view_ps #------------------------------------------------------------------------------ # FAQ: What is .rof format ? # Answer: From memory of jhs@ not yet checked to sources: # - Input file with format suitable to what was once called roff # - roff command was first written in PDP11 assembler ? ran on V6 Unix, # for some photo type setter, # - I think modeled on a pre Unix, DEC OS text formatter, called Run Off # - Later re-written in C for Unix V6 or V7, # - Known as roff when I used it at University in ~1978 # - Bell Labs seperated roff & a few other optionals out as part of # PWB = Programmers Work Bench, extensions to stripped down Unix, # so one could buy more or less Unix, # - Rof became Nroff (new roff) on later Unix, or possibly early FreeBSD # - src/ nroff was replaced by groff, a gnu rewrite, # - In 2021 /usr/ports/textproc/groff/pkg-plist includes bin/nroff # - All my (jhs@) complex stuff like business cards, # CVs etc are mastered in .rof # - A competitor to groff is Latex. .if !target(.rof.pdf) #{ # The rules for .rof.ps & .ps.pdf were sufficient to ${MAKE_JHS} a .pdf # but I added this rule, as using just the earlier 2 rules left bulky .ps files # that were surplus bulk on web directories, in ~/ at home, & on USB sticks, # & slowed rdist back ups, & bad for wear on USB flash media. .rof.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @# brackets.c balancer < ${GROFF_MORE} ${GROFF_PS_ARGS} \ -dfile=`basename ${.TARGET} .ps` ${.IMPSRC} \ | ${PS2PDF} ${PS2PDF_PORTRAIT_ARGS} ${PS2PDF_PIPE} > ${.TARGET} @cd ${.CURDIR}; make pdf-warn @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .rof.pdf #------------------------------------------------------------------------------ .if !target(.dvi.pdf) #{ # The rules for .dvi.ps & .ps.pdf were sufficient to ${MAKE_JHS} a .pdf # but I added this rule, as using just the earlier 2 rules left bulky .ps files # that were surplus bulk on web directories, in ~/ at home, & on USB sticks, # & slowed rdist back ups, & bad for wear on USB flash media. # For explanation of parameters see comments in rule .dvi.ps .dvi.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${DVIPS} ${PSSELECT} ${PSNUP} ${PSTOPS} \ ${PS2PDF} @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" dvips -t landscape -o \ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.ps \ ${.IMPSRC} psselect 2,3,4,5,6,1 \ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.ps \ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_2}.ps $(PSNUP) -w21cm -h29.2cm -W9.9cm -H21cm -s1 -3 \ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_2}.ps \ `basename ${.TARGET} .pdf`.ps rm -f ${.CURDIR}/`basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.ps\ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_2}.ps # brackets.c balancer < cat `basename ${.TARGET} .pdf`.ps \ | ${PS2PDF} ${PS2PDF_PORTRAIT_ARGS} ${PS2PDF_PIPE} > ${.TARGET} -rm `basename ${.TARGET} .pdf`.ps @cd ${.CURDIR}; make pdf-warn @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .dvi.pdf #------------------------------------------------------------------------------ # DEFAULT INPUT-OUTPUT CONVERSION RULES - WYSIWYG #------------------------------------------------------------------------------ # Support for "ghostview". # (ghostview is marked broken (security loophone) in FreeBSD-4.8) # Wysiwyg loop to allow vi in one xterm to cause re-display in adjacent # ghostview, each time vi sees :w (write). .if !target(.ps.vps) #{ .ps.vps: # create a temporary pid file for signal linking vi + ghostview @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# echo -n "${T_BERKLIX} ghostview gone in current 2014-12-26, " @# echo "need to port my mods to gv" @sleep 2 @# brackets.c balancer < ghostview -reopen_sig -pid_report ${.IMPSRC} > ${.TARGET} & @# Wait for ghostview to initialise then report its process number. @# & print dots while waiting as a debug indicator. @# while `test ! -s ${.TARGET}` ; do echo -n . ; done @# or skip the dots normally. while `test ! -s ${.TARGET}` ; do true ; done process=`cat ${.TARGET}` ; \ name=`basename ${.IMPSRC} .ps` ; \ if [ -f $${name}.le ]; then \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ kill -${SIG_REOPEN} $${process}" $${name}.le ; \ else \ if [ -f $${name}.e_rof ]; then \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.e_rof ; \ elif [ -f $${name}.rof ]; then \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.rof ; \ elif [ -f $${name}.e_tex ]; then \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.e_tex ; \ elif [ -f $${name}.tex ]; then \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.tex ; \ else \ echo -n "${T_BERKLIX} Dont know what to edit " ; \ echo "to cd ${.CURDIR}; ${MAKE_JHS} $${name}" ; \ exit 1 ; \ fi ; \ fi ; \ kill -${sighup} $${process} ; \ echo "${T_BERKLIX} Suggestion: Maybe rm $${name}.ps" @# letter_g.rof is extracted from letter_g.e_rof @# brackets.c balancer < @# letter_g.e_rof@ -> letter.l_rof @# {--------------- OLD @# if [ -f $${name}.le ]; then \ @# vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ @# kill -${SIG_REOPEN} $${process}" \ @# $${name}.le ; \ @# else \ @# if [ -f $${name}.rof ]; then \ @# vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ @# kill -${SIG_REOPEN} $${process}" \ @# ${.CURDIR}/$${name}.rof ; \ @# else \ @# vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ @# kill -${SIG_REOPEN} $${process}" \ @# ${.CURDIR}/$${name}.tex ; \ @# fi ; \ @# fi ; \ @# kill -${sighup} $${process} ; \ @# echo "${T_BERKLIX} Suggestion: Maybe rm $${name}.ps" @# --------------- } @# JJLATER: Allow for a $${name}.tex as well as a $${name}.rof @rm -f ${.TARGET} @# merely an obsolete process number @# --- @# The ${sighup} is to remove a no longer updated ghostview. @# --- @# Hopefully a kernel guru will confirm the printf & fflush I use to @# generate the pid print in ghostview is effectively monatomic by the @# time the process number arrives in the file ${THING}.pid. @# If not, and the pid were eg 1234, @# & only the 1 is output before the test, @# and it stays at 1 when then read with cat, and if you are root, @# the system might then crash or something with equivalent of @# su ; kill -SIGUSR1 1 (note SIGUSR1) @# --- @# Note ghostview sometimes doesnt seem to update its screen display @# till the mouse floats over the top of it (no clicks necessary) @# (this being with fvwm + freebsd). @# --- @# I couldn''t use a structure like @# pid=`ghostview -reopen_sig -pid_report generic.g.ps` & @# because that waits for ghostview to complete before evaluating pid @# --- @# The backslashes need to extend to end, else $${name} evaluate @# to null on the suggestion line. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.vps #------------------------------------------------------------------------------ # Support for "gv". (successor or descendant to/from ghostview). # Wysiwyg loop to allow vi in one xterm to cause re-display in adjacent # gv, each time vi sees :w (write). .if !target(.ps.Vps) #{ .ps.Vps: # create a temporary pid file for signal linking vi + ghostview @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# A "-watch" parameter to gv is not needed, & avoided to lighten load @# on slow machines. @# brackets.c balancer < < ${GV} ${.IMPSRC} > ${.TARGET} & \ sleep 3 ; \ process=$$! ; \ echo "$${process}" > ${.TARGET} ; \ name=`basename ${.IMPSRC} .ps` ; \ if [ -f $${name}.le ]; then \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps ; \ kill -s SIGHUP $${process}" \ $${name}.le ; \ else \ if [ -f $${name}.rof ]; then \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps;\ kill -s SIGHUP $${process}" \ ${.CURDIR}/$${name}.rof ; \ else \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.ps;\ kill -s SIGHUP $${process}" \ ${.CURDIR}/$${name}.tex ; \ fi ; \ fi ; \ kill $${process} ; \ echo "${T_BERKLIX} Suggestion: Maybe rm $${name}.ps" @# JJLATER: Allow for a $${name}.tex as well as a $${name}.rof @rm -f ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.Vps #------------------------------------------------------------------------------ # Same as .ps.vps, but also generates a .pcl_rof afterward # (note no .vpcl_rof gets generated). .if !target(.rof.vpcl_rof) #{ .rof.vpcl_rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" name=`basename ${.IMPSRC} .rof` ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.vps ; \ tm $${name}.ps ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.pcl_rof ; \ echo Suggestion: lpr -Ppcl_rof.g $${name}.pcl_rof @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" @# The Wysiwyg uses the .ps, @# then we discard the .ps, & go straight from rof to pcl. .endif #} .rof.vpcl_rof #------------------------------------------------------------------------------ # Same as .ps.vps, but also generates a .pcl_ps afterward # (note no .vpcl_ps gets generated). .if !target(.ps.vpcl_ps) #{ .ps.vpcl_ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" name=`basename ${.IMPSRC} .ps` ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.vps ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.pcl_ps ; \ echo Suggestion: lpr -Ppcl_ps.g $${name}.pcl_ps @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.vpcl_ps #------------------------------------------------------------------------------ .if !target(.ps.vbjccolor) #{ # (note no .vbjccolor gets generated). .ps.vbjccolor: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" name=`basename ${.IMPSRC} .ps` ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.vps ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.bjccolor ; \ echo Suggestion: lpr -Pbjc $${name}.bjccolor @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.vbjccolor #------------------------------------------------------------------------------ .if !target(.ps.vcdj670) #{ # (note no .vcdj670 gets generated). .ps.vcdj670: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" name=`basename ${.IMPSRC} .ps` ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.vps ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.cdj670 ; \ echo Suggestion: lpr -Pcdj670 $${name}.cdj670 @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.vcdj670 #------------------------------------------------------------------------------ .if !target(.ps.vbjc600) #{ .ps.vbjc600: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" name=`basename ${.IMPSRC} .ps` ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.vps ; \ cd ${.CURDIR}; ${MAKE_JHS} $${name}.bjc600 ; \ echo Suggestion: lpr -Pbjc $${name}.bjc600 @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.vbjc600 #------------------------------------------------------------------------------ CHIMERA_PARAMS = -s -p # CHIMERA_PARAMS are not available from generic chimera, but are added by: # http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/ports/gen/www/chimera/files/ # JJLATER: Warning chimera has disappeared by 2016-04-14 from ports/www/ .if !target(.m4.vhtml) #{ # This new rule is being tested first on ~/public_html/bim/Makefile # There is not yet a generic clean rule. That comes from the Makefile for now. .m4.vhtml: chimera_warn # create a temporary pid file for signal linking vi + chimera @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# for explanation see comments in .ps.vps: above @# I need ${.CURDIR} in next line, else chimera fails to display @# ~jhs/public_html/ (as /usr/obj/.... always exists) @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.IMPSRC} .m4`.html @# brackets.c balancer < chimera ${CHIMERA_PARAMS} \ ${.CURDIR}/`basename ${.IMPSRC} .m4`.html > ${.TARGET} & @# Wait for chimera to initialise then report its process number. @# & print dots while waiting as a debug indicator. @# while `test ! -s ${.TARGET}` ; do echo -n . ; done @# or skip the dots normally. while `test ! -s ${.TARGET}` ; do true ; done process=`cat ${.TARGET}` ; \ name=`basename ${.IMPSRC} .m4` ; \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.html ;\ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.m4 ; \ ${SPELLAFTERVI} ${.CURDIR}/$${name}.m4 ; \ ${TIDYAFTERVI} ${.CURDIR}/$${name}.m4 ; \ ${CHECKLINKSAFTERVI} ${.CURDIR}/$${name}.m4 ; \ kill -${sighup} $${process} rm -f ${.TARGET} @# Do a 2nd tidy to see if there were any unfixable errors. @# brackets.c balancer < @echo "Consider something like ${TIDY} ${.IMPSRC} > /dev/null" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .m4.vhtml #------------------------------------------------------------------------------ .if !target(.html.vhtml) #{ .html.vhtml: chimera_warn @# create a temporary pid file for signal linking vi + chimera @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# for explanation see comments in .ps.vps: above @# I need ${.CURDIR} in next line, else chimera fails to display @# ~jhs/public_html/ (as /usr/obj/.... always exists) @# brackets.c balancer < chimera ${CHIMERA_PARAMS} ${.CURDIR}/${.IMPSRC} > ${.TARGET} & @# Wait for chimera to initialise then report its process number. @# & print dots while waiting as a debug indicator. @# while `test ! -s ${.TARGET}` ; do echo -n . ; done @# or skip the dots normally. while `test ! -s ${.TARGET}` ; do true ; done process=`cat ${.TARGET}` ; \ name=`basename ${.IMPSRC} .html` ; \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.html ; \ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.html ; \ ${SPELLAFTERVI} ${.CURDIR}/$${name}.html ; \ ${TIDYAFTERVI} ${.CURDIR}/$${name}.html ; \ ${CHECKLINKSAFTERVI} ${.CURDIR}/$${name}.html ; \ kill -${sighup} $${process} rm -f ${.TARGET} @# Do a 2nd tidy to see if there were any unfixable errors. @# brackets.c balancer < -${TIDY} ${.IMPSRC} > /dev/null @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .html.vhtml #------------------------------------------------------------------------------ chimera_warn: @echo "No Chimera on 12.2-STABLE, need to back port." # JJLATER @echo "Meanwhile path includes /9-RELEASE." #------------------------------------------------------------------------------ .if !target(.lmth.vhtml) #{ .lmth.vhtml: chimera_warn @# create a temporary pid file for signal linking vi + chimera @# ------------------------ @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# for explanation see comments in .ps.vps: above @# I need ${.CURDIR} in next line, else chimera fails to display @# ~jhs/public_html/ (as /usr/obj/.... always exists) @cd ${.CURDIR} ; ${MAKE_JHS} `basename ${.IMPSRC} .lmth`.html @# brackets.c balancer < chimera ${CHIMERA_PARAMS} \ ${.CURDIR}/`basename ${.IMPSRC} .lmth`.html > \ ${.TARGET} & @# Wait for chimera to initialise then report its process number. @# & print dots while waiting as a debug indicator. @# while `test ! -s ${.TARGET}` ; do echo -n . ; done @# or skip the dots normally. while `test ! -s ${.TARGET}` ; do true ; done process=`cat ${.TARGET}` ; \ name=`basename ${.IMPSRC} .lmth` ; \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.html ; \ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.lmth ; \ ${SPELLAFTERVI} ${.CURDIR}/$${name}.lmth ; \ ${TIDYAFTERVI} ${.CURDIR}/$${name}.lmth ; \ ${CHECKLINKSAFTERVI} ${.CURDIR}/$${name}.lmth ; \ kill -${sighup} $${process} rm -f ${.TARGET} @# Do a 2nd tidy to see if there were any unfixable errors. @# brackets.c balancer < -${TIDY} ${.IMPSRC} > /dev/null @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .lmth.vhtml #------------------------------------------------------------------------------ .if !target(.e_lmth.vhtml) #{ .e_lmth.vhtml: chimera_warn @# create a temporary pid file for signal linking vi + chimera @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# for explanation see comments in .ps.vps: above @# I need ${.CURDIR} in next line, else chimera fails to display @# ~jhs/public_html/ (as /usr/obj/.... always exists) @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.IMPSRC} .e_lmth`.html chimera ${CHIMERA_PARAMS} \ ${.CURDIR}/`basename ${.IMPSRC} .e_lmth`.html \ > ${.TARGET} & @# Wait for chimera to initialise then report its process number. @# & print dots while waiting as a debug indicator. @# while `test ! -s ${.TARGET}` ; do echo -n . ; done @# or skip the dots normally. while `test ! -s ${.TARGET}` ; do true ; done process=`cat ${.TARGET}` ; \ name=`basename ${.IMPSRC} .e_lmth` ; \ vi -C "cd ${.CURDIR}; ${MAKE_JHS} $${name}.html ; \ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.e_lmth ; \ kill -${sighup} $${process} rm -f ${.TARGET} @# Do a 2nd tidy to see if there were any unfixable errors. @# brackets.c balancer < -${TIDY} ${.IMPSRC} > /dev/null @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .e_lmth.vhtml #------------------------------------------------------------------------------ .if !target(.fig.vfig) #{ .fig.vfig: # create a temporary pid file for signal linking vi + xfig @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# for explanation see comments in .ps.vps: above @# brackets.c balancer < xfig -pid_report -reopen_sig ${.IMPSRC} > ${.TARGET} & @# Wait for xfig to initialise then report its process number. @# & print dots while waiting as a debug indicator. @# while `test ! -s ${.TARGET}` ; do echo -n . ; done @# or skip the dots normally. while `test ! -s ${.TARGET}` ; do true ; done process=`cat ${.TARGET}` ; \ name=`basename ${.IMPSRC} .fig` ; vi -C \ "cd ${.CURDIR}; ${MAKE_JHS} $${name}.fig ; \ kill -${SIG_REOPEN} $${process}" \ ${.CURDIR}/$${name}.fig ; kill -SIGKILL $${process} rm -f ${.TARGET} @# Xfig with a ${sighup} creates a core, (despite man signal saying @# default is no core), so as xfig does this I use sigkill @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .fig.vfig #------------------------------------------------------------------------------ .if !target(.txt.dos) #{ .txt.dos: # ascii to dos @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" cp ${.IMPSRC} ${.TARGET} ${NOTAIL} ${.TARGET} addcr ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .txt.dos #------------------------------------------------------------------------------ .if !target(.txt.epub) #{ .txt.epub: # ascii to dos @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @echo "For now manually use eg /usr/ports/deskutils/calibre" @echo "berklix2.mk has to make a rule to create a .pub" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # From: Gary J 2021-11-13 # I did a search under /usr/ports for every pkg-descr which # contains epub and, other than some libraries, they all seem to be # graphics based tools or require weird formats for parsing. # The only ones which may be relevant are these: # ./textproc/rubygem-asciidoctor-epub3/pkg-descr # Asciidoctor EPUB3 is a set of Asciidoctor extensions for converting AsciiDoc # documents directly to the EPUB3 and KF8/MOBI e-book formats. It''s a tool for # creating highly aesthetic, professional, easy-to-read e-books. # WWW: https://github.com/asciidoctor/asciidoctor-epub3 # ./textproc/rubygem-gepub/pkg-descr # Gepub is a generic EPUB parser/generator. Generates and parse EPUB2 and EPUB3. # WWW: https://github.com/skoji/gepub # But hard to tell from these descriptions. # There were alot more hits in pkg-plist, but there were way more # than I was willing to look at. .endif #} .txt.epub #------------------------------------------------------------------------------ .if !target(.dvi.ps) #{ # Specific to the BIM3 column leaflet, for now. .dvi.ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${DVIPS} ${PSSELECT} ${PSNUP} ${PSTOPS} @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# This rule is only good for producing a 3 column leaflet, @# it is Not a general rule. @# ----- @# Man dvips - convert a TeX DVI file to PostScript dvips -t landscape -o \ `basename ${.TARGET} .ps`_${TMP_BERKLIX_GENERIC_1}.ps \ ${.IMPSRC} @# Allowable syntax: @# -t a4 @# -O .1in,-.3cm # Off from default 1" down 1" right. @# -T offset # Set paper size to given pair of dimensions. @# ----- @# The previous latex delivers front page last, which suits us. @# Without the psselect, fold both edges into the middle, @# & the last page is visible when folded, which is nice, as @# the English version has additional URLs exposed on back. @# Man psselect - select pages from a PostScript file psselect 2,3,4,5,6,1 \ `basename ${.TARGET} .ps`_${TMP_BERKLIX_GENERIC_1}.ps \ `basename ${.TARGET} .ps`_${TMP_BERKLIX_GENERIC_2}.ps \ @# ----- @# Man psnup - multiple pages per sheet $(PSNUP) -w21cm -h29.2cm -W9.9cm -H21cm -s1 -3 \ `basename ${.TARGET} .ps`_${TMP_BERKLIX_GENERIC_2}.ps \ ${.TARGET} @# 29.7 to 29.2 as Brother HL-P2500 was off the short edge. @# A4 measured by JHS is 29.7 x 21 cm. 9.9 is column width @# -W -H input sizes, if different from the output sizes. @# -w -h output sizes. @# Allowable syntax: @# -Pa4 # default is a4. -Pletter @# -m0.3cm # man says: leave margin around the whole page @# # only really seems to displace from left & base @# # margin, overflowing off not top & right. @# ----- @# Man pstops - shuffle pages in a PostScript file @# Allowable syntax: @# -pa4 @# $(PSTOPS) -w21cm -h29.7cm "$(PSTOPS_ARGS)" \ @# ${TMP_BERKLIX_GENERIC_1}.${.TARGET} ${.TARGET} @# Always screws up & prints 2nd page upside down. @# ----- rm -f \ ${.CURDIR}/`basename ${.TARGET} \ .ps`_${TMP_BERKLIX_GENERIC_1}.ps \ `basename ${.TARGET} .ps`_${TMP_BERKLIX_GENERIC_2}.ps @# ----- @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .dvi.ps #------------------------------------------------------------------------------ .if !target(.e_html.html) #{ # _LANG_HTML extracts the e from foobar_e.html or the g from foobar_g.html _LANG_HTML = `basename ${.IMPSRC} .e_html | rev | \ awk 'BEGIN {FS="_"} {print $$1}'` .e_html.html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < echo "" > ${.TARGET} @# brackets.c balancer < < ${LE} -${_LANG_HTML} ${.IMPSRC} >> ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .e_html.html #------------------------------------------------------------------------------ .if !target(.e_lmth.lmth) #{ # _LANG_LMTH extracts the e from foobar_e.lmth or the g from foobar_g.lmth _LANG_LMTH = `basename ${.IMPSRC} .e_lmth | rev | \ awk 'BEGIN {FS="_"} {print $$1}'` .e_lmth.lmth: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < echo "" > ${.TARGET} @# brackets.c balancer < < ${LE} -${_LANG_LMTH} ${.IMPSRC} >> ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .e_lmth.lmth #------------------------------------------------------------------------------ .if !target(.e_rof.rof) #{ # _LANG_ROF extracts the e from foobar_e.rof or the g from foobar_g.rof _LANG_ROF = `basename ${.IMPSRC} .e_rof | rev | \ awk 'BEGIN {FS="_"} {print $$1}'` .e_rof.rof: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# "\\\" " " @# brackets.c balancer < echo ".\\\" ${DONT_EDIT}" > ${.TARGET} # " @# brackets.c balancer < < ${LE} -${_LANG_ROF} ${.IMPSRC} >> ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .e_lmth.lmth #------------------------------------------------------------------------------ .if !target(.e_tex.tex) #{ # _LANG_TEX extracts the e from foobar_e.tex or the g from foobar_g.tex # (${LATEX2HTML} refuses double dotted names such as doc.english.tex) _LANG_TEX = `basename ${.IMPSRC} .e_tex | rev | \ awk 'BEGIN {FS="_"} {print $$1}'` .e_tex.tex: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < echo "% ${DONT_EDIT}" > ${.TARGET} @# brackets.c balancer < < ${LE} -${_LANG_TEX} ${.IMPSRC} >> ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .e_tex.tex #------------------------------------------------------------------------------ .if !target(.fax.ps) #{ # convert received fax to postscript ready for ghostview .fax.ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${FAX2PS} @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < ${FAX2PS} ${.IMPSRC} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .fax.ps #------------------------------------------------------------------------------ .if !target(.fig.ps) #{ .fig.ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < @# ${FIG2DEV} -L ps -P -z A4 ${.IMPSRC} > ${.TARGET} @# FreeBSD-9.2 does not support ${FIG2DEV} -P @# FreeBSD-10.0 man ${FIG2DEV}: @# -P Generate a complete LaTeX file. In other words, @# the output file can be formatted without requiring any @# changes. The additional text inserted in the beginning @# and at the end of the file is controlled by the configuration @# parameter "Preamble" and "Post- amble". @# So 2014-09-09 I removed -P @# brackets.c balancer < ${FIG2DEV} -L ps -z A4 ${.IMPSRC} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .fig.ps #------------------------------------------------------------------------------ # Till 2016-02-02 theer was no .fig.ps rule, so it went through # .fig.ps & .ps.pdf which produced surplus .ps files. .if !target(.fig.ps) #{ .fig.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${FIG2DEV} ${PS2PDF} @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# see comments in .fig.ps @# brackets.c balancer < ${FIG2DEV} -L ps -z A4 ${.IMPSRC} | \ ${PS2PDF} ${PS2PDF_LANDSCAPE_ARGS} ${PS2PDF_PIPE} > ${.TARGET} @cd ${.CURDIR}; make pdf-warn @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .fig.ps #------------------------------------------------------------------------------ .if !target(.fig.eps) #{ .fig.eps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < @# ${FIG2DEV} -L ps -P -z A4 ${.IMPSRC} > ${.TARGET} @# FreeBSD-9.2 does not support ${FIG2DEV} -P @# FreeBSD-10.0 man ${FIG2DEV}: @# -P Generate a complete LaTeX file. In other words, @# the output file can be formatted without requiring any @# changes. The additional text inserted in the beginning @# and at the end of the file is controlled by the configuration @# parameter "Preamble" and "Post- amble". @# So 2014-09-09 I removed -P @# brackets.c balancer < ${FIG2DEV} -L ps -z A4 ${.IMPSRC} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .fig.eps #------------------------------------------------------------------------------ .if !target(.ps.epsi) #{ .ps.epsi: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${PS2EPSI} ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.epsi #------------------------------------------------------------------------------ .if !target(.lmth.html) #{ NO_OBJ=true # Append a standard ${LMTH_TAIL} footer to a .lmth file, # to ${MAKE_JHS} a .html. .if !defined(LMTH_TAIL) #{ .if defined(NO_SIDEBAR) #{ LMTH_TAIL = ${.CURDIR}/Inc/tail_no_sb.inc .else # }{ .if exists( ${.CURDIR}/.just_com ) #{ LMTH_TAIL = ${.CURDIR}/Inc/tail_sb_com.inc .else # }{ LMTH_TAIL = ${.CURDIR}/Inc/tail_sb_org.inc .endif #} .endif #} .endif #} # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # The files .just_com used to be zero size file until 2017-06-20, # when I inserted in each: used by berklix2.mk to silence errors from # httrack --spider -p0 -P gate:80 --verbose berklix.com/jhs # which complained eg: # file not stored in cache due to bogus state # (incomplete type with OK (200), size 0): # localhost/~jhs/some_dir/.just_com # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .if !defined(SP_TOP) #{ .if exists( ${.CURDIR}/.just_com ) #{ SP_TOP = ${.CURDIR}/Inc/sidebar_com.sed .else # }{ SP_TOP = ${.CURDIR}/Inc/sidebar_org.sed .endif #} .endif #} # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .lmth.html: ${LMTH_TAIL} ${SP_TOP} @${ECHO_START} \ "${T_START_RULE} ${.IMPSRC} .lmth.html ${T_START_TARGET} $@ {" @# echo "${T_BERKLIX} DEBUG CURDIR: ${.CURDIR}" @# localhost: /0s1/usr1/home/jhs/._dir/public_html/src @# amd+nfs_host: @# /.amd_mnt/scrn/0s1/usr1/home/jhs/._dir/public_html/src @# echo "${T_BERKLIX} DEBUG TARGET: ${.TARGET}" @# localhost: @# fixes.html @# amd+nfs_host: @# /.amd_mnt/scrn/0s1/usr1/home/jhs\ @# /._dir/public_html/src/fixes.html @# So ${.CURDIR}/${.TARGET} works on localhost, but fails on @# amd+nfs_host, so I used to use ${.TARGET} without prefix ${.CURDIR}/ @# But that created some .html in /usr/obj \ @# & failed to update web. so use @# ${.CURDIR}/`basename ${.TARGET}` @# ---------- @${ECHO_BUILD} "${.CURDIR}/`basename ${.TARGET}`: ${.IMPSRC}" @# brackets.c balancer < echo "" > ${.CURDIR}/`basename ${.TARGET}` @# Do not echo "edit ${.IMPSRC}" @# as that may be built from something else. .if defined(NO_SIDEBAR) @# Include main page & @# Strip end of page, so I can append my tail. @# brackets.c balancer < < grep -i -v '' ${.IMPSRC} | grep -i -v '' >> \ ${.CURDIR}/`basename ${.TARGET}` .else # Newer & normal for most now. @# Let through top of page with title & meta keywords for search etc, @# but swap the single word for entire content of ${SP_TOP} @# Then include main page, @# Then strip end of page after , so I can append my tail. @# ------ @# Below, rather than use ${.IMPSRC} or ${.CURDIR}/${.IMPSRC} @# I use ${.CURDIR}/`basename ${.IMPSRC}` @# as @# ${.IMPSRC} has different values in these 2 directories: @# /home/jhs/public_html \ @# /0s1/usr1/home/jhs/._dir/public_html/index.lmth @# /home/jhs/public_html/src fixes.lmth cat ${.CURDIR}/`basename ${.IMPSRC}` | \ sed -e 'sx' | grep -i -v '' \ >> ${.CURDIR}/`basename ${.TARGET}` .endif @# Strip top of my new common tail before appending it. @# brackets.c balancer < < cat ${LMTH_TAIL} | grep -i -v '' | \ grep -i -v '' | grep -i -v '' | grep -i -v '' | \ grep -i -v '' | grep -i -v '' >> \ ${.CURDIR}/`basename ${.TARGET}` @# --- @echo "${T_BERKLIX} Appending the Berklix Icon" @# cat ${.CURDIR}/`basename ${.TARGET}` | \ sed -e 'sxxx' | sed -e \ 'szzz' \ > `basename ${.TARGET} .html`_${TMP_BERKLIX_GENERIC_1}.html @# brackets.c balancer < cat `basename ${.TARGET} .html`_${TMP_BERKLIX_GENERIC_1}.html > \ ${.CURDIR}/`basename ${.TARGET}` rm -f `basename ${.TARGET} .html`_${TMP_BERKLIX_GENERIC_1}.html @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .lmth.html # Work toward a later per page QR code in left bar. # .dir: Makefile \ # /home/jhs/public_html/src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix2.mk # /bin/pwd # @echo # echo ${.CURDIR} # @echo # brackets.c balancer < # /bin/pwd | sed -e sZ"`cd ${HOME}/public_html;/bin/pwd`"ZZ > $@ #------------------------------------------------------------------------------ .if !target(.m4.html) #{ # There is not yet a generic rule for conversion from .m4 to .html. # Look to the Makefile for that, eg ~/public_html/bim/Makefile .endif #} .m4.html #------------------------------------------------------------------------------ .if !target(.ps.txt) #{ .ps.txt: ${DVIPS2ASCII} @# brackets.c balancer < ${DVIPS2ASCII} < ${.IMPSRC} > ${.TARGET} @# OLD Junk follows (predates bim leaflet) @# ps2ascii ${.IMPSRC} ${.TARGET} @# @# actually uses /usr/local/bin/ps2ascii which has: @# @# XX = ${GS} -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT \ @# @# -dSIMPLE ps2ascii.ps @# @# if ( test $# -eq 0 ) then @# @# ${XX} - quit.ps @# @# elif ( test $# -eq 1 ) then @# @# ${XX} $1 quit.ps @# @# else @# brackets.c balancer < @# @# ${XX} $1 quit.ps >$2 @# @# fi .endif #} .ps.txt #------------------------------------------------------------------------------ # For Geometry (page offsets etc), see: ~jhs/job/project/cd/labels/inc/geo.rof # For Ink refil notes see: ~jhs/tech/canon/bjc-70 .if !target(.ps.bjccolor) #{ .ps.bjccolor: # postscript to Canon BJC-70 Color @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${GS} ${GS_ARGS} -sDEVICE=bjccolor ${GS_OUT} -- ${.IMPSRC} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.bjccolor #------------------------------------------------------------------------------ .if !target(.ps.cdj670) #{ .ps.cdj670: # postscript to Canon BJC-70 Color @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${GS} ${GS_ARGS} -sDEVICE=cdj670 ${GS_OUT} -- ${.IMPSRC} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.cdj670 #------------------------------------------------------------------------------ .if !target(.ps.bjc600) #{ .ps.bjc600: # postscript to Canon BJC-70 Monochrome @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${GS} ${GS_ARGS} -sDEVICE=bjc600 ${GS_OUT} -- ${.IMPSRC} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.bjc600 # ${GS} -h shows Available devices (Col 1=Driver Name, 2=Source Of Note, 3=Note) # bj10e gs Canon BubbleJet BJ-10e # bj10v gs Canon BubbleJet BJ-10v [BJ10V] # bj10vh gs Canon BubbleJet BJ-10v, high-mergin [BJ10V] # bj200 gs Canon BubbleJet BJ-200 and BJC-240(b&w) # bjc600 gs Canon Color BJC-600/4xxx/70 + Apple StyleWriter 2x00 # bjc600 jhs 362K fails to print black text to left of colour demon # bjc800 gs Canon Color BubbleJet BJC-240/800 # bjc880j # bjccmyk gs Canon Color BubbleJet BJC-210/240/250/265/1000 [BJC250] # bjccolor gs Canon Color BubbleJet BJC-210 ... 1000 truecolor [BJC250] # bjccolor jhs 1.2M succeeds to print black text to left of colour demon # bjcgray gs Canon Color BubbleJet BJC-210 ... 1000 grayscale [BJC250] # bjcmono gs Canon Color BubbleJet BJC-210 ... 1000 monochrome [BJC250] #------------------------------------------------------------------------------ .if !target(.ps.epson) #{ .ps.epson: # Postscript to Epson bit map @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" rm -f ${.TARGET} ${GS} ${GS_ARGS} -sDEVICE=epson ${GS_OUT} -- $? @# These generate a bit map I think, for an epson, @# it does Not generate an ascii file @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.epson #------------------------------------------------------------------------------ # A .pcl_rof is not allowed to be made from a .ps, only from a .rof # .if !target(.ps.pcl_rof) #{ # .ps.pcl_rof: # postscript to Hewlett Packard PCL-5 # @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" # @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" # ${GS} ${GS_ARGS} -sDEVICE=ljet3 ${GS_OUT} -- ${.IMPSRC} # @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # .endif #} .ps.pcl_rof #------------------------------------------------------------------------------ .if !target(.ps.pcl_ps) #{ .ps.pcl_ps: # postscript to Hewlett Packard PCL-5 @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${GS} ${GS_ARGS} -sDEVICE=ljet3 ${GS_OUT} -- ${.IMPSRC} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.pcl_ps #------------------------------------------------------------------------------ .if !target(.pdf.ljet4) #{ .pdf.ljet4: # pdf to Hewlett Packard LJET4 @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${GS} ${GS_ARGS} -sDEVICE=ljet4 ${GS_OUT} -- ${.IMPSRC} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .pdf.ljet4 #------------------------------------------------------------------------------ .if !target(.ps.ljet4) #{ .ps.ljet4: # ps to Hewlett Packard LJET4 @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${GS} ${GS_ARGS} -sDEVICE=ljet4 ${GS_OUT} -- ${.IMPSRC} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ps.ljet4 #------------------------------------------------------------------------------ .if !target(.png.jpg) #{ .png.jpg: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @# brackets.c balancer < ${PNGTOPNM} < ${.IMPSRC} | ${PNMTOJPEG} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .png.jpg #------------------------------------------------------------------------------ .if !target(.png.tiff) #{ .png.tiff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .tiff`.jpg mv `basename ${.TARGET} .tiff`.jpg \ `basename ${.TARGET} .tiff`_${TMP_BERKLIX_GENERIC_1}.jpg @cd ${.CURDIR}; ${MAKE_JHS} \ `basename ${.TARGET} .tiff`_${TMP_BERKLIX_GENERIC_1}.tiff rm ${.CURDIR}/`basename ${.TARGET} .tiff`_${TMP_BERKLIX_GENERIC_1}.jpg mv `basename ${.TARGET} .tiff`_${TMP_BERKLIX_GENERIC_1}.tiff ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .png.tiff #------------------------------------------------------------------------------ .if !target(.png.pdf) #{ .png.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .pdf`.jpg @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .pdf`.tiff rm -f `basename ${.TARGET} .pdf`.jpg @# -------- @# Now force a pdf from a tiff, otherwise next ${MAKE_JHS} .. .pdf @# will try to make from .png & this rule would go recursive as @# shown by this extract from @# .SUFFIXES: .jpg .tiff .png .pdf @# another way to avoid recursion might be within .SUFFIXES to move @# .png left before .tiff, but I have given no thought to @# how that might affect all the oher rules in this file. mv `basename ${.TARGET} .pdf`.tiff \ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.tiff @cd ${.CURDIR}; ${MAKE_JHS} \ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.pdf -rm ${.CURDIR}/`basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.tiff mv `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.pdf ${.TARGET} @cd ${.CURDIR}; make pdf-warn @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .png.pdf #------------------------------------------------------------------------------ .if !target(.png.ps) #{ .png.ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .ps`.jpg @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .ps`.tiff -rm `basename ${.TARGET} .ps`.jpg @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .ps`.tiff mv `basename ${.TARGET} .ps`.tiff \ `basename ${.TARGET} .ps`_${TMP_BERKLIX_GENERIC_1}.tiff @cd ${.CURDIR}; \ ${MAKE_JHS} `basename ${.TARGET} \ .ps`_${TMP_BERKLIX_GENERIC_1}.ps mv `basename ${.TARGET} .ps`_${TMP_BERKLIX_GENERIC_1}.ps ${.TARGET} -rm ${.CURDIR}/`basename ${.TARGET} .ps`_${TMP_BERKLIX_GENERIC_1}.tiff @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .png.ps #------------------------------------------------------------------------------ .if !target(.png.epsi) #{ .png.epsi: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .epsi`.jpg @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .epsi`.tiff -rm `basename ${.TARGET} .epsi`.jpg @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .epsi`.ps -rm ${.CURDIR}/`basename ${.TARGET} .epsi`.tiff \ `basename ${.TARGET} .epsi`.tiff mv `basename ${.TARGET} .epsi`.ps \ `basename ${.TARGET} .epsi`_${TMP_BERKLIX_GENERIC_1}.ps @cd ${.CURDIR}; ${MAKE_JHS} \ `basename ${.TARGET} .epsi`_${TMP_BERKLIX_GENERIC_1}.epsi -rm ${.CURDIR}/`basename ${.TARGET} .epsi`_${TMP_BERKLIX_GENERIC_1}.ps mv `basename ${.TARGET} .epsi`_${TMP_BERKLIX_GENERIC_1}.epsi ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .png.epsi #------------------------------------------------------------------------------ .if !target(.pnm.jpg) #{ .pnm.jpg: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @# brackets.c balancer < cat ${.IMPSRC} | ${PNMTOJPEG} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .pnm.jpg #------------------------------------------------------------------------------ .if !target(.pnm.pdf) #{ # This avoids leaving .jpg & .tiff temporary files after a sequence of rules: # .pnm.jpg + .jpg.tiff + .tiff.pdf .pnm.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .pdf`.jpg @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .pdf`.tiff @cd ${.CURDIR}; rm `basename ${.TARGET} .pdf`.jpg mv `basename ${.TARGET} .pdf`.tiff \ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.tiff @cd ${.CURDIR}; \ ${MAKE_JHS} `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.pdf -rm ${.CURDIR}/`basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.tiff mv `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.pdf ${.TARGET} @cd ${.CURDIR}; make pdf-warn @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .pnm.pdf #------------------------------------------------------------------------------ .if !target(.gif.gif_transparent) #{ .gif.gif_transparent: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${GIFTOPNM} ${PPMTOGIF} @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# -rm `basename ${.IMPSRC} .gif`.ps @# brackets.c balancer < ${GIFTOPNM} ${.IMPSRC} > `basename ${.TARGET} .gif`.pnm @# brackets.c balancer < ${PPMTOGIF} -transparent white `basename ${.TARGET} .gif`.pnm > \ ${.TARGET} -rm `basename ${.TARGET} .gif`.pnm @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .gif.gif_transparent #------------------------------------------------------------------------------ .if defined(PDF_PS) #{{ Default: Undefined. # The 'if' above avoids both rules .pdf.ps & .ps.pdf directions colliding, # with error eg: Graph cycles through target.ps .if !target(.pdf.ps) #{ # Occasional use: To print from a web downloaded .pdf .pdf.ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${PDF2PS} -sPAPERSIZE=a4 ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .else # }{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .if !target(.ps.pdf) #{ # brackets.c balancer < < # Usage includes: .rof -> .ps -> .pdf for ~/public_html/cv/ # including from ~jhs/job/groff/cv/web/ .ps.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ${PS2PDF} @# ${PS2PDF} cannot be appended to ":" line above, else if @# non existant it is built even when .pdf does not need remake! @# brackets.c balancer < ${PS2PDF} ${PS2PDF_PORTRAIT_ARGS} ${PS2PDF_PIPE} < ${.IMPSRC} > \ ${.TARGET} @cd ${.CURDIR}; make pdf-warn @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .endif #}} PDF_PS #------------------------------------------------------------------------------ .if !defined(.pdf.epub) #{ .pdf.epub: #{CALIBRE} @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @echo "Use manually: calibre" @echo "See usage notes in http://www.berklix.com/~jhs/tolino/#epub" @echo "& reservation in http://withouthotair.com/epubVersions.html" @echo "Calibre is not renowned for the quality of its products" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .pdf.epub #------------------------------------------------------------------------------ .if !defined(GIF_PS) #{{ Default: Undefined. for Normal direction GIF to PS # Normal direction PS to GIF .if !target(.ps.gif) #{ pid_berklix_mk != echo $$$$ # ~/public_html/gifs/brexit.ps (from brexit.fig) already contains # %%Orientation: Landscape # but ${TMP_PSTOPNM}.1 comes out wrong as portrait, even forcing with # PSTOPNM_ARGS += -landscape # still fails to force landscape, & I see rotate called. # Maybe it is coming from bounding box ? # PSTOPNM_ARGS += -la PSTOPNM_ARGS += -verbose # The landscape above only changes the viewer screen, # not direction of text within # PSTOPNM_ARGS += | grep -v %%BoundingBox TMP_PSTOPNM = ${HOME}/tmp/ps2gif_${TMP_BERKLIX}_-${pid_berklix_mk}.pnm .ps.gif: # postscript to GIF @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${PSTOPNM} ${PPMTOGIF} ${PNMCROP} \ ${PNMROTATE} @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# echo ".TARGET=${.TARGET} .IMPSRC=${.IMPSRC}" @# -ls -l ${.TARGET} ${.IMPSRC} @# -e True if exists (regardless of type). @# -s True if exists and has a size greater than zero. @echo -n "${T_BERKLIX} Warning PSTOPNM=${PSTOPNM} " @echo "[at least used to] breaks margin," @if test -s ${.TARGET} ; then \ echo -n "${T_BERKLIX} Outdated: ${.TARGET}" ; \ echo "being regenerated from ${.IMPSRC}" ; \ echo -n "${T_BERKLIX} (This may be retrograde, " ; \ echo "you may want to check.)" ; \ else \ echo -n "${T_BERKLIX} Absent or zero size, " ; \ echo "so will create: ${.TARGET}" ; \ fi @# echo -n "${T_BERKLIX} You could also recreate " @# echo "${.TARGET} from xv ${.IMPSRC}" @# brackets.c balancer < ${PSTOPNM} ${PSTOPNM_ARGS} < ${.IMPSRC} > ${TMP_PSTOPNM}.1 @# --------- @# JJLATER @echo -n "${T_BERKLIX} Warning: pstopnm above fails, " @echo "vertically squashes" @echo " ~/gifs/qr/berklix_org.gif" @# it warns: @# pstopnm: Extracting the box ((72,72),(540,720)) @# pstopnm: language is not encapsulated postscript @# pstopnm: With borders, extracted box is ((25,7),(587,785)) @# pstopnm: output is 570 pixels wide X 789 pixels high @# This is OK: @# cd ~/publict_html/gifs/qr @# qrencode -o berklix_org.png http://www.berklix.org @# make berklix_org.gif @# routing via .png .jpg .tiff .ps .gif @# up to the .ps to .gif where it fails. @# Dont know how to fix this, except manually: @# This exports .gif from .png OK: xv berklix_org.png @# --------- @# brackets.c balancer < ${PNMCROP} ${TMP_PSTOPNM}.1 > ${TMP_PSTOPNM}.2 .if defined (BERKLIX_SHRINK) #{ @# setenv BERKLIX_SHRINK 0.5 # For half size. @# brackets.c balancer < cat ${TMP_PSTOPNM}.2 | pnmscale ${BERKLIX_SHRINK} > ${TMP_PSTOPNM}.3 .else # }{ @# brackets.c balancer < cat ${TMP_PSTOPNM}.2 > ${TMP_PSTOPNM}.3 .endif #} BERKLIX_SHRINK @# brackets.c balancer < pnmquant 256 ${TMP_PSTOPNM}.3 > ${TMP_PSTOPNM}.4 .if defined (BERKLIX_ROTATE_PS2GIF) #{ @# setenv BERKLIX_ROTATE_PS2GIF +90 # anti clockwise 90 @# setenv BERKLIX_ROTATE_PS2GIF -90 # clockwise 90 @# brackets.c balancer < @# ${PNMROTATE} -90 ${TMP_PSTOPNM}.1 | ${PPMTOGIF} > ${.TARGET} @# brackets.c balancer < ${PNMROTATE} ${BERKLIX_ROTATE_PS2GIF} ${TMP_PSTOPNM}.4 | \ ${PPMTOGIF} > ${.TARGET} .else #}{ BERKLIX_ROTATE_PS2GIF @# brackets.c balancer < cat ${TMP_PSTOPNM}.4 | ${PPMTOGIF} > ${.TARGET} .endif #} BERKLIX_ROTATE_PS2GIF rm -f ${TMP_PSTOPNM}.1 ${TMP_PSTOPNM}.2 \ ${TMP_PSTOPNM}.3 ${TMP_PSTOPNM}.4 @echo "JJLATER These dont seem to disappear so forcing an ls -l" -ls -l ${TMP_PSTOPNM}.1 ${TMP_PSTOPNM}.2 \ ${TMP_PSTOPNM}.3 ${TMP_PSTOPNM}.4 @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # Other Conversion Tools, not used but could be explored: # ~jhs/src/bsd/imports/troff2html/pstoppm.ps # from khe? maybe Oct 26 1994 # ppmtobmp: # bad magic number - not a ppm, pgm, or pbm file # pstoimg # installed from /usr/ports/textproc/latex2html, but # pstoimg -type gif -out `basename ${.IMPSRC} .ps` -crop a ${.IMPSRC} # errors: This version of pstoimg does not support "gif" image format. # dvips2ascii eps2eps ps2ascii ps2epsi ps2frag ps2pdf ps2pdf12 ps2pdf13 # ps2pdf14 ps2pdfwr ps2pk ps2ps ps2ps2 epstopdf hipstopgm pstopnm # con2gif raw2gif rgb2gif text2gif gd2togif ppmtogif .endif #} !target(.ps.gif) .else #}{ # if both rules .gif.ps & .ps.gif are defined, make errors with eg: # Graph cycles through target.ps # JJLATER I expect the rule still wont work though, unless SUFFIXES # are re-arranged with ifdef s .if !target(.gif.ps) #{ # Occasional use: Rule added 2013-04-01 .gif.ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${GIFTOPNM} ${PNMTOPS} @# brackets.c balancer < ${GIFTOPNM} < ${.IMPSRC} | ${PNMTOPS} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" @# Do not use gif2ps which expands to full page. @# (gif2ps was used until 2013-04-01 in @# http://www.berklix.com/\ @# ~jhs/src/bsd/jhs/bin/local/lpf_berklix/lpf_berklix @# but the .gif expanded to full page in .pd, which was not convenient, @# ( eg March 2013 an email from bordkarte@mobile.lufthansa.com @# included a seperate MIME enclosure with @# "GIF image data, version 89a, 148 x 172" of a code for @# customer phone/PDA to display at airport, for their entry @# machines, & customer might want to print a copy either: @# - if they have no phone/ PDA @# - insurance against flat battery on PDA/phone @# for that you need a small size for scanner. )) @# gif2ps @# is delivered by both giflib-4.1.6 libungif-4.1.4_5 @# /usr/ports/graphics/{ giflib libungif } @# There is no man gif2ps, but: @# Identical: /usr/local/share/doc/ @# { libungif/gif2ps.html giflib/gif2ps.html } @# gif2ps.html says it maximises, & gives @# no option to turn off maximising. @# gs (ghostscript)# has no option to import .gif @# lib/libpnm1.c lib/pam.h lib/pnm.h .endif #} !target(.gif.ps) .endif #} else defined(GIF_PS) } #------------------------------------------------------------------------------ .if !target(.html.pdf) #{ .html.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @echo "Use Print in firefox ${.IMPSRC}" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .html.pdf #------------------------------------------------------------------------------ .if !target(.rof.txt) #{ .rof.txt: # troff to ascii @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < ${GROFF_MORE} -Tascii -dformat=ascii -dfile=`basename ${.TARGET} .ps` \ ${.IMPSRC} | sed -e 's/.//g' > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .rof.txt #------------------------------------------------------------------------------ .if !target(.rof.html) #{ # ROF_HTML_XX="-P-g -P-a -P-r120" # No support from FreeBSD-4.5 /usr/bin/post-grohtml # -P-F/usr/share/groff_font/devhtml probably default # Following 2 ( ROF_HTML_YY & ROF_HTML_ZZ ) commented out 2005.05.31, # as FreeBSD-5.4 & FreeBSD-4.10 both require a space after -P # ROF_HTML_YY = -P-Igif # ROF_HTML_ZZ = -P-r .rof.html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# echo "${T_BERKLIX} Ignore junk from each .pso, such as eg:" @# echo -n " post-grohtml: (*)" @# echo ":50:warning: unrecognized command \`-'" @# brackets.c "`'" @# Each .pso works, but causes a spurious complaint on 5.3 & 6.0. @# eg on a virtually empty file with just @# 123456 @# .pso /bin/echo abcdef @# it bleats (with a single copy of quote marks, @# ( but here doubled to satisfy brackets.c )): @# post-grohtml: \ @# (/bin/echo):50:warning: unrecognized command ``a'' @# brackets.c balancer < ${GROFF_MORE} \ ${GROFF_HTML_FLAGS} \ -dformat=html \ -dfile=`basename ${.TARGET} .ps` \ -mhtml \ ${ROF_HTML_YY} \ ${ROF_HTML_XX} \ ${ROF_HTML_ZZ} \ ${.IMPSRC} | \ sed -e 's/\//g' | \ sed -e 'sx\xxg' | \ sed -e 'sxHTML-IMAGE\.nrxxg' | \ sed -e 'sx^ 3cxxg' | \ sed -e 'sx^3cxxg' | \ sed -e 'sx^0

xxg' | \ sed -e 'sxHTML-IMAGE-ENDxxg' | \ sed -e '/^$$/d' | \ sed -e 's/\&/\&/g' > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" #------------ # Cludge to kill what the back end generates after a table: (.TS .TE) # Sometimes the 3c has a space in front. #

HTML-IMAGE.nr # 3c # 0

#------------ # Cludge to remove 3 blank lines between table entries in my resume: # sed -e '/^$$/d' #------------ # see ${UMLAUTS_INC}.rof for why I use the sed above. # the stuff used to wreck my resume # FreeBSD-4.5 with my CV says: # brackets.c balancer < # Calling ``pnmcut 560 138 61 80 ... | pnmtopng ... > page1.ps.png # pnmcut & pnmtopng come from /usr/ports/graphics/netpbm # This lot was used sometime prior to FreeBSD-4.5, but is no longer needed: # | sed -e 's// -->/g' \ #'"' # | sed -e 'sxx xg' \ # | sed -e 's///g' \ # | sed -e 'sxxxg' \ # | sed -e 's///g' \ # | sed -e 'sxxxg' \ # | sed -e 's/^
$$/
/g' \ # | sed -e 's/
$$//g' \ # | sed -e 's/











/
/g' \ # | sed -e 's/










/
/g' \ # | sed -e 's/









/
/g' \ # | sed -e 's/








/
/g' \ # | sed -e 's/







/
/g' \ # | sed -e 's/






/
/g' \ # | sed -e 's/





/
/g' \ # | sed -e 's/




/
/g' \ # | sed -e 's/



/
/g' \ # | sed -e 's/


/
/g' \ # | sed -e 's/

/
/g' \ # | sed -e 's/ / /g' \ # | sed -e 's/ $$//g' \ # This is the old justification why it was neded: # Removing all
is too drastic, but its worse without removal. # span not in my HTML book. # brackets.c balancer < # soelim ${.IMPSRC} | tbl | unroff -fhtml handle-tbl=gif | \ # sed -e '/^ email @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# maybe should add -a @# brackets.c balancer < < ${GROFF_MORE} -Tlatin1 -dformat=latin1 \ -dfile=`basename ${.TARGET} .ps` \ ${.IMPSRC} > ${.TARGET} @# sed -e "s/.^H//g" < ${.TARGET} > ${.TARGET}.tmp @# mv ${.TARGET}.tmp ${.TARGET} addcr ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .rof.latin1 #------------------------------------------------------------------------------ .if !target(.rof.lst) #{ # This produces a rough nasty draft on the 4.2BSD Symmetric S375, # That nroff has no concept of proportional spacing, result not nice. .rof.lst: # Symmetric dependencies: /usr/bin/nroff /usr/lib/term/tabhp3p @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @echo "${T_BERKLIX} Nroff is being phased out by jhs" tbl ${.IMPSRC} | nroff -Thp3p -ms ${.IMPSRC} | \ overlay -o ${.TARGET} ../odd/vsl_head.hp ${NOTAIL} ${.TARGET} @# 78bit -8 ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .rof.lst #------------------------------------------------------------------------------ # Short cut straight from rof to pcl_rof, does a4 ok. # ps2pcl_rof fails to do a4, but must be fixed for files I receive in .ps. .if !target(.rof.pcl_rof) #{ .rof.pcl_rof: # groff to Hewlett Packard PCL-5 @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < ${GROFF_MORE} -Tlj4 -dformat=lj4 \ -dfile=`basename ${.TARGET} .ps` \ ${.IMPSRC} > ${.TARGET} @echo -n "${T_BERKLIX} Caution, .eps images not included " @echo "(EG arrow in VSL header)" @# .PSPIC -R inc/vsl_logo.eps 4.8c 0.45c fails in inc/vsl.l_rof @# FreeBSD-9.2: man 5 groff_tmac & ${TMAC_DIR}/pspic.tmac @# for .PSPIC parameter values. @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .rof.pcl_rof #------------------------------------------------------------------------------ # It is not allowed to go straight from .rof to .pcl_ps, # One must go via .ps intermediary, so we do not need a rule set of # .rof.pcl_ps: # As make fill find rules of .rof.ps & .ps.pcl_ps #------------------------------------------------------------------------------ .if !target(.rof.ps) #{ .rof.ps: ${UMLAUTS_INC} ${COMMON_INC} @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < ${GROFF_MORE} ${GROFF_PS_ARGS} \ -dfile=`basename ${.TARGET} .ps` \ ${.IMPSRC} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # Maybe later I''ll also pass along time from eg: # /usr/local/bin/stat ${.IMPSRC} | grep st_atime .endif #} .rof.ps #------------------------------------------------------------------------------ .if !target(.ppm.jpg) #{ .ppm.jpg: ${PNMTOJPEG} @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < cat ${.IMPSRC} | ${PNMTOJPEG} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .ppm.jpg #------------------------------------------------------------------------------ .if !defined(NO_JPG_PDF) #{ # This rule converting straight from .jpg to .pdf creates slightly larger .pdf than # { converting from .jpg to .tiff, manually moving the .jpg aside # & converting from .tiff to from .pdf } # Example sizes: # 612142 straight/file1.pdf # 612092 via/file1.pdf # 601191 straight/file2.pdf # 601141 via/file2.pdf # dc 612142 612092 - p 50 # dc 601191 601141 - p 50 # Reason is the longer temporary file names gets embedded in the pdf, eg # hal_berklix_mk_tmp_generic_1.tiff # /Title(hal_berklix_mk_tmp_generic_1.tiff) # instead of shorter name such as # hal.tiff # /Title(hal.tiff) # The commans run are the same: # Commands with straight: # brackets.c balancer < # /usr/local/bin/djpeg -pnm file.jpg | \ # /usr/local/bin/pamtotiff > file.tiff # mv `basename file.pdf .pdf`.tiff \ # `basename file.pdf .pdf`_berklix_mk_tmp_generic_1.tiff # brackets.c balancer < # /usr/local/bin/tiff2ps -p -a -h11.6944 -w8.26389 \ # file_berklix_mk_tmp_generic_1.tiff | \ # /usr/local/bin/ps2pdf - - > file_berklix_mk_tmp_generic_1.pdf # mv `basename file.pdf .pdf`_berklix_mk_tmp_generic_1.pdf \ # /0s1/usr1/home/jhs/tmp/straight/file.pdf # Commands via .tiff: # brackets.c balancer < # /usr/local/bin/djpeg -pnm file.jpg | \ # /usr/local/bin/pamtotiff > file.tiff # mv *jpg j/ # brackets.c balancer < # /usr/local/bin/tiff2ps -p -a -h11.6944 -w8.26389 \ # file.tiff | \ # /usr/local/bin/ps2pdf - - > file.pdf # Which command is embedding the temporary file names Ive not yet established, # but consider embedding a file name inside a file could be both: # - a security leak # - a means of advertising/ stamping that it was produced by berklix.mk .if !target(.jpg.pdf) #{ .jpg.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} `basename ${.TARGET} .pdf`.tiff mv `basename ${.TARGET} .pdf`.tiff \ `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.tiff @cd ${.CURDIR}; \ ${MAKE_JHS} `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.pdf -rm `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.tiff mv `basename ${.TARGET} .pdf`_${TMP_BERKLIX_GENERIC_1}.pdf ${.CURDIR}/${.TARGET} @cd ${.CURDIR}; make pdf-warn @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .endif #} NO_JPG_PDF #------------------------------------------------------------------------------ .if !defined(pdf-warn) #{ pdf-warn: @# @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @# @echo "Caution: Some pdf fail to print, Notes:" @# @echo -n " vi -c/$@ /home/jhs/public_html/" @# @echo "src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix2.mk" @# @echo -n " http://www.berklix.com/~jhs/" @# @echo "src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix2.mk" # Some of my xsane scans converted from .png to .pdf fail # Examples of failure in ~/scan/mk/2020-01-03-mozart-apotheke/ # Even the 75 dpi scan failed to print # 82293 075_gray.pdf # 536227 075_gray.pnm # 44649 075_lineart.pdf # 67126 075_lineart.pnm # 356796 150_gray.pdf # 2157907 150_gray.pnm # 269836 150_lineart.pnm # 1452209 300_gray.pdf # Maybe it is too big single page bit map images that fail. # Or Maybe the page buffer too small in my Axis ethernet to parallel converter. # Or Maybe in laser printers Axis feeds: { Samsung ML-4500 & HP LaserJet 4L} # My Lexmark CX310dn prints them OK though. # Single page scans from jes@ in format .jpg that I convert # to .pdf size=806986 print OK # PDFs I make from my own .rof, eg CV print OK @# @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} #------------------------------------------------------------------------------ .if !defined(TIFF_TO_JPG_FORCE) #{ .if !target(.jpg.tiff) #{ .jpg.tiff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# brackets.c balancer < ${DJPEG} -pnm ${.IMPSRC} | ${PAMTOTIFF} > ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # man djpeg: -pnm Select PBMPLUS (PPM/PGM) output # format (this is the default for- mat). PGM is emitted # if the JPEG file is gray-scale or if -grayscale is # specified; otherwise PPM is emitted. .endif #} .endif #} TIFF_TO_JPG_FORCE #------------------------------------------------------------------------------ .if defined(TIFF_TO_JPG_FORCE) #{{ .if !target(.tiff.jpg) #{ .tiff.jpg: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @echo "${T_BERKLIX}: JJLATER Work Needed: to call ${TIFFTOPNM}" exit -1 @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .endif # }} # TIFF_TO_JPG_FORCE #------------------------------------------------------------------------------ .if !target(.PNG.png) #{ .PNG.png: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# ln -s ${.IMPSRC} ${.TARGET} mv ${.IMPSRC} ${.TARGET} @# brackets.c balancer < @# sample.png -> sample.PNG @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .PNG.png #------------------------------------------------------------------------------ .if !target(.JPG.jpg) #{ .JPG.jpg: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# ln -s ${.IMPSRC} ${.TARGET} mv ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .JPG.jpg #------------------------------------------------------------------------------ .if !target(.PDF.pdf) #{ .PDF.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# ln -s ${.IMPSRC} ${.TARGET} mv ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .PDF.pdf #------------------------------------------------------------------------------ .if !target(.TIFF.tiff) #{ .TIFF.tiff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" mv ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .TIFF.tiff #------------------------------------------------------------------------------ .if !target(.TIF.tiff) #{ .TIF.tiff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" mv ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .TIF.tiff #------------------------------------------------------------------------------ .if !target(.tif.tiff) #{ .tif.tiff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" mv ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .tif.tiff #------------------------------------------------------------------------------ # /bin/ls -1 *jpg* *jpeg* # cjpeg: { PPM (PBMPLUS color format), PGM (PBMPLUS # gray-scale format), BMP, Targa, and RLE # (Utah Raster Tool- kit format). (RLE is # supported only if the URT library is # available.) } to jpg # djpeg: jpg to: { PBM- PLUS (PPM/PGM), BMP, GIF, # Targa, or RLE (Utah Raster Toolkit) output # format can be selected. (RLE is supported # only if the URT library is available.) } # jpeg2yuv: Convert to yuv format # jpegexiforient: no manual # jpegorient: no manual # jpegtopnm: no manual # jpegtran: lossless transformation of JPEG files # mjpeg_simd_helper: no manual # pnmtojpeg: PNMTOJPEG # brackets.c balancer < # ppmtojpeg: ppmtojpeg@ -> pnmtojpeg PNMTOJPEG # rdjpgcom: display text comments from a JPEG file # wrjpgcom: insert text comments into a JPEG file #------------------------------------------------------------------------------ SNIFF_ASPECT_RATIO = \ @${ECHO_BUILD} "${T_BERKLIX} Deciding if portrait or landscape:" ASPECT_PORT=Assuming vertical A4 portrait. ASPECT_LAND=Assuming horizontal landscape (or 180 rotated, aka seascape). TIFF_LANDSCAPE_A4=Image Width: 3239 Image Length: 2344 # For other tiff sizes see notes in See http://www.berklix.com/~jhs/bin/.sh/portrait #------------------------------------------------------------------------------ .if !target(.tiff.ps) #{ .tiff.ps: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @make warn_crop ${SNIFF_ASPECT_RATIO} ${.IMPSRC} @# brackets.c balancer < < if ( ! ${TIFFINFO} ${.IMPSRC} | \ grep -q "${TIFF_LANDSCAPE_A4}" ) ; \ then \ ${ECHO_BUILD} "${T_BERKLIX} ${.IMPSRC} ${ASPECT_PORT}" ; \ ${TIFF2PS} ${TIFF2PS_ARGS} \ ${TIFF2PS_ARGS_PORTRAIT} \ ${.IMPSRC} > ${.TARGET} ; \ else \ ${ECHO_BUILD} "${T_BERKLIX} ${.IMPSRC} ${ASPECT_LAND}" ; \ ${TIFF2PS} ${TIFF2PS_ARGS} \ ${TIFF2PS_ARGS_LANDSCAPE} \ ${.IMPSRC} > ${.TARGET} ; \ fi @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # Although the .ps gets: %%BoundingBox: 0 0 843 596 for horiz, # instead of %%BoundingBox: 0 0 596 843 for vert. # ghostview still cant cope, whereas ${GV} does cope, even without # needing to select all the -w & -h above. .endif #} .tiff.ps #------------------------------------------------------------------------------ # A hook with names one might remember, to remind user of macro names. .if !target(pdf2tiff) #{ .if !target(pdftotiff) #{ pdf2tiff pdftotiff: @echo "If you really want to go in reverse: .pdf to .tiff, then:" @echo "Perhaps because you want to split pages " @echo "with ${TIFFSPLIT} thing.tiff" @echo "cd ${.CURDIR}; ${MAKE_JHS} PDF_TO_TIFF_FORCE=YES thing.tiff" .endif #} pdftotiff .endif #} pdf2tiff #------------------------------------------------------------------------------ .if !defined(PDF_TO_TIFF_FORCE) #{{ .if !target(.tiff.pdf) #{ # I havent tried printing landscape .pdf they look OK on screen though. # A pipe speed up of the rules ".tiff.ps" and ".ps.pdf" # Advantage: The awfully big .ps files never get left on disc. .tiff.pdf: #{ @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @# JJLATER consider code to remove the temporary intermediate .ps @echo -n "Ensuring no '=' in file name" @echo " that would cause an infinite loop." @echo ${.TARGET} | grep -v -q = @echo ${.TARGET} | grep -v = && echo "OK, No '=' in name, continuing" @-echo ${.TARGET} | grep = && echo "Error, A '=' in name, Aborting" && exit 1 @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${SNIFF_ASPECT_RATIO} ${.IMPSRC} @make warn_crop if ( ! ${TIFFINFO} ${.IMPSRC} | \ grep -q "${TIFF_LANDSCAPE_A4}" ) ; \ then \ ${ECHO_BUILD} "${T_BERKLIX} ${.IMPSRC} ${ASPECT_PORT}" ; \ ${TIFF2PS} ${TIFF2PS_ARGS} ${TIFF2PS_ARGS_PORTRAIT} \ ${.IMPSRC} \ | ${PS2PDF} ${PS2PDF_MISSING_ARGS} ${PS2PDF_PIPE} \ > ${.TARGET} ; \ else \ ${ECHO_BUILD} "${T_BERKLIX} ${.IMPSRC} ${ASPECT_LAND}" ; \ ${TIFF2PS} ${TIFF2PS_ARGS} \ ${TIFF2PS_ARGS_LANDSCAPE} ${.IMPSRC} \ | ${PS2PDF} ${PS2PDF_LANDSCAPE_ARGS} ${PS2PDF_PIPE} \ > ${.TARGET} ; \ fi @# If there is a bloated .tiff intermediary made from a .jpg, @# then rm the .tiff @# -ls -l `basename ${.TARGET} .pdf`.* if [ -e `basename ${.TARGET} .pdf`.jpg -a \ -e `basename ${.TARGET} .pdf`.tiff ]; then \ ${ECHO_BUILD} ".jpg source of .tiff exists, " ; \ ${ECHO_BUILD} " removing intermediary .tiff" ; \ rm ${.CURDIR}/`basename ${.TARGET} .pdf`.tiff ; \ fi @echo "Tiff are normally bigger than Pdf, so if you have already done" @echo -n " make `basename ${.TARGET} .pdf`.txt Or " @echo "make `basename ${.TARGET} .pdf`.txt_g" @echo "Suggestion, consider: rm ${.IMPSRC}" @echo "Do not rm if you want to do OCR with ${TESSERACT} using:" @echo " make ${.CURDIR}/`basename ${.TARGET} .tiff`.txt" @echo -n "or ${PNMROTATE} from .tiff, or tiffsplit, " @echo "or merge tiffs with tiffcp." @echo " or ${PNMROTATE} from .tiff, or tiffsplit, or merge tiffs with tiffcp." @echo -n "( Occasionaly Tiff can be smaller than Pdf, " @echo "eg ~/scan/private/id/passport+id/ )" @# echo " 24834537 2_front_detail_page_600dpi.pdf" @# echo " 3288432 2_front_detail_page_600dpi.tiff" @cd ${.CURDIR}; make pdf-warn @# Show the real file name last as there''s been so much text info. @ls -l ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" @# } .tiff.pdf #------------------------------------------------------------------------------ .endif #} !target(.tiff.pdf) .else # }{ defined PDF_TO_TIFF_FORCE .if !target(.pdf.tiff) #{ # CAUTION: # Enabling this rule without disabling others might error eg: # ``50.pdf'' not remade because of errors. # 1 error # Graph cycles through 60.pdf # Purpose: # For .pdf.txt conversion. # This is not a normal direction of generation. # brackets.c balancer < < # Normal direction is from a document source such as a .rof > .ps > .tiff # You probably only want .pdf to .tiff so you can convert an # emailed foreign produced .pdf to a .tiff so you can then # use OCR for a .txt # History Of Experiments To Achieve A .pdf.txt: # 2013-10-07, converting a .pdf to .txt # "${PDF2PS} produced an enormous .ps file, then" # "${DVIPS2ASCII} slowly produced rubbish" # # 7594292 Oct 7 22:25 BSD-09-2013.pdf # # 978875485 Oct 8 01:12 BSD-09-2013.ps # # 38399 Oct 8 02:58 BSD-09-2013.txt # # BSD-09-2013.pdf: PDF document, version 1.7 # # BSD-09-2013.ps: PostScript document text conforming # # DSC level 3.0, Level 2 # # BSD-09-2013.txt: ASCII text, with very long lines # 2017-03-29 cd ~/public_html/brexit # ls -l 29-03-17_article50.pdf # make PDF_PS=YES 29-03-17_article50.ps # gs -help | grep tiff # tiff12nc tiff24nc tiff32nc tiffcrle tiffg3 tiffg32d # tiffg4 tiffgray tifflzw tiffpack tiffsep # gs -sDEVICE=tiffg3 29-03-17_article50.ps # cat 29-03-17_article50.ps | \ # gs -q -sDEVICE=tiffg3 -sPAPERSIZE=a4 \ # -dNOPAUSE -sOutputFile=- \ # > 29-03-17_article50.tiff # ls -1 # 374709 Mar 29 15:28 29-03-17_article50.pdf # 374709 Mar 29 15:29 29-03-17_article50.pdfcp # 2081302 Mar 29 15:33 29-03-17_article50.ps # 21469736 Mar 29 15:50 29-03-17_article50.tiff # make 29-03-17_article50.txt # Error in pixReadStream: \ # Unknown format: no pix returned # Unsupported image type. # above fails on every tiff type # Next attempt was display each individual page of a pdf with # xpdf, then frame grab with xv & export to .tiff, # but that was manual per page, # & also the .tiff was the same low # DPI quality as the X windows screen resolution. # man gs: # devicenames == # tiff12nc tiff24nc tiff32nc tiffcrle tiffg3 tiffg32d # tiffg4 tiffgray tifflzw tiffpack tiffsep # I dont know what these different tiff formats are, so did an # experiment: # foreach i ( tiff12nc tiff24nc tiff32nc tiffcrle \ # tiffg3 tiffg32d tiffg4 tiffgray tifflzw \ # tiffpack tiffsep ) # gs -dNOPAUSE -sDEVICE=$i \ # -sOutputFile=article.$i.tiff \ # article.pdf # make article.$i.txt_g # end # None produced a good OCR scanned .txt, & all .tiff # were rather small # ls -l *.tiff # 2909483 article.tiff12nc.tiff # 5814341 article.tiff24nc.tiff # 7936400 article.tiff32nc.tiff # 937797 article.tiffcrle.tiff # 943866 article.tiffg3.tiff # 1107126 article.tiffg32d.tiff # 1151442 article.tiffg4.tiff # 1937877 article.tiffgray.tiff # 425526 article.tifflzw.tiff # 938553 article.tiffpack.tiff # 4864393 article.tiffsep.tiff # so I chose tiff32nc as it was biggest, & name seemed to # imply perhaps more resolution. # examining with vi on scanned pdf # dpi 200 200^M/Width 4677 # gs -dNOPAUSE -sDEVICE=tiff32nc \ # -sOutputFile=article.tiff \ # -r200 article.pdf # ls -l article.r200.tiff32nc.tiff # 59972168 article.tiff # make article.txt_g # The resultant OCR is very acceptable, got umlauts # right, it even did a good job processing the 6 text # columns, though it mis-placed 2 blocks: {side panel # & title spannning top of all columns} in the middle # of the article. # --------------- # If the .pdf is too big the .tiff will break at 4 Gig: # Examples (From Acer Aspire 5741 Laptop 32 language # Generic_User_Guide & Quick_Guide: # 15271571 ok_313-pages.pdf* # 2434470188 ok_313-pages.tiff # 38849550 too_big_2345_pages.pdf* # 4294891388 too_big_2345_pages-fails_at_page_554.tiff # 4294967296 dc 4 1024 1024 1024 * * * p 4294967296 # The reason I was creating a large tiff: so I could use tiffplit # & tiffcat to extract just English. # However viewing the cut down just english versions using xpdf at 300% # I can see a lot of lost resolution, eg fuzzy. # A quick search for PDF splitter sources shows: # https://pdfsam.org/download-pdfsam-basic/ # https://github.com/torakiki/pdfsam/releases # but it uses JDK (often means hastle) # so I''m not keen to port it to FreeBSD). # --------------- .pdf.tiff: #{ @# @echo "${T_BERKLIX} At each GS> type a Control D." @# JJLATER find a gs flag to avoid needing Control D = EOT. @# ${GS} -dNOPAUSE -sDEVICE=tiff32nc -r200 -s${.TARGET} ${.IMPSRC} @# The above on current with 4 page lift.pdf gives error: @# GPL Ghostscript 9.16: Device 'tiff32nc' requires an output @# file but no file was specified. @# Error: /undefinedfilename in --showpage-- ${GS} -dNOPAUSE -dBATCH -sDEVICE=tiff32nc -r200 \ -sOutputFile=${.TARGET} ${.IMPSRC} @# JJLATER add a redirect to discard this junk: @# GPL Ghostscript 9.06 (2012-08-08) @# Copyright (C) 2012 Artifex Software, Inc. All rights reserved. @# This software comes with NO WARRANTY: @# see the file PUBLIC for details. @# Processing pages 1 through 5. @# 9.2-RELEASE gs -help lists @# tiff12nc tiff24nc tiff32nc tiffcrle tiffg3 tiffg32d tiffg4 @# tiffgray tifflzw tiffpack tiffsep @# 12.0-CURRENT 2017-12-12 offers @# tiff12nc tiff24nc tiff32nc tiffcrle tiffg3 tiffg32d tiffg4 @# tiffgray tifflzw tiffpack tiffsep @# I used 200 cos that is what Ingrid''s commercially scanned copy of @# her SZ interview was, the first time I used this rule. @# It seems to be OK too for 29-03-17_article50.pdf but JJLATER review, @# JJLATER rule Fails on other .pdf @# --- @# Next test & exit with error if a .tiff has not been created, as @# ${GS} of a corrupt pdf @# (From a subaru manual @# ~/public_html/txt/airbag/ebayliverpool/\ @# wiring_diagram/wiring_diagram/\ @# ~/xtra/scan/subaru/bought/vendor/ebayliverpool/\ @# subarulegacy_1998/1998/service_manual/\ @# wiring_diagram/wiring_diagram/\ @# msa5tcd98l21376.pdf @# bytes = 2551808 @# MD5 = 976647acc4c3c236cba066aa976ee12f @# ) @# emits this error text: @# Catalog dictionary not located in file, unable to proceed @# **** Error: Couldn't initialise file. @# Output may be incorrect. @# No pages will be processed (FirstPage > LastPage). @# The following errors were encountered at least once @# while processing this file: @# no startxref token found @# & produces no .tiff, but fails to return an error code, so @# Use "test -e" to exit with an error if no .tiff has been produced. @# (JJLATER do I need to add a prefix before ${.TARGET} @# to allow for a possible /usr/obj ? test -e ${.TARGET} @# } .endif #} !target(.pdf.tiff) .endif #}} defined PDF_TO_TIFF_FORCE .if defined(PDF_TO_HTML_FORCE) #{{ .if !target(.pdf.html) #{ .pdf.html: ${PDFTOHTML} ${.IMPSRC} ${.TARGET} .endif #} !target(.pdf.html) .endif #}} defined PDF_TO_HTML_FORCE #------------------------------------------------------------------------------ .if !target(tiffsniff) #{ tiffsniff: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @# @ 2022-02 The Achhen combi scanner printer ex Ron is Epson XP-312 @# Having a look if xsane read from Epson XP-312 in full screen size, @# file: height=3508, width=2544 @# xv: 2544x3508 @# or if I remembered to reduce size to Portrait A4 @# file: height=2480, width=2480 @# xv: 2480x2480 @# I guess there is an error when it reports height=2480. @# Other indicators: @# monocrome: @# bps=1 @# compression=bi-level group 3 @# PhotometricIntepretation=WhiteIsZero @# colour: @# bps=37716 @# compression=JPEG @# PhotometricIntepretation=YCbCr -file *.tiff @# JJLATER do more @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} tiffsniff #------------------------------------------------------------------------------ .if !target(.tex.html) #{ .tex.html: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${LATEX2HTML} @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${LATEX2HTML} -no_subdir ${LATEX2HTML_ARGS} ${.IMPSRC} @# index.html is still produced, & `basename ${.IMPSRC} .tex`.html @# hard linked together. @# Specifying "-prefix `basename ${.IMPSRC} .tex`" to ${LATEX2HTML} @# does not avoid this. @# Removing index.html could be highly dangerous, especially if the @# rm command is in a macro, as here, so called from many different @# Makefiles, some of which may well have neighbouring real @# index.html files with valid content that should not be deleted. .if exists( ${CMPD} ) #{ ${CMPD} -d index.html `basename ${.IMPSRC} .tex`.html .else @# So just advise it, but do not do it: @echo "${T_BERKLIX} Please rm index.html" .endif #} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .tex.html #------------------------------------------------------------------------------ .if !target(.tex.lmth) #{ .tex.lmth: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${LATEX2HTML} -no_subdir ${LATEX2HTML_ARGS} ${.IMPSRC} .if exists( ${CMPD} ) #{ ${CMPD} -d index.lmth `basename ${.IMPSRC} .tex`.lmth .else @# So just advise it, but do not do it: @echo "${T_BERKLIX} Please rm index.lmth" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .endif #} .tex.lmth #------------------------------------------------------------------------------ .if !target(.tex.pdf) #{ .tex.pdf: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${PDFLATEX} ${.IMPSRC} @echo "${T_BERKLIX} Maybe this should instead use ${TEXI2PDF} ?" @cd ${.CURDIR}; make pdf-warn @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .tex.pdf #------------------------------------------------------------------------------ .if !target(.tex.dvi) #{ .tex.dvi: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" ${LATEX} ${.IMPSRC} @echo "${T_BERKLIX} Maybe this should instead use ${TEXI2DVI} ?" @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .tex.dvi #------------------------------------------------------------------------------ # Patched out 2014-06-09 # .if !target(.tiff.tif) #{ # # For a tiff document read in by http://www.berklix.com/scanjet/ # # that was double sided, where 2 sheets were wrongly read in as one by # # the auto sheet feeder. # # Sometimes the order is a simple [2,1,4],3,6,5,8,7 that can be fixed just by # # tiffswap (see http://www.berklix.com/~jhs/bin/.sh/tiffswap ) # # Sometimes the order is: [1,3,2],5,4,7,6,9,8 to be fixed by rule below: # .tiff.tif: # @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" # @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" # ${TIFFSPLIT} ${.IMPSRC} # @# Set 1st page aside, for later. # mv xaa.tif ${.TARGET}.1.tmp # @# Create new files with correct names ready to swap pages. # @# (- as seems to error even when should not ) # @echo "${T_BERKLIX} Ignore next error code from tiffcp." # -tiffcp x[a-z][a-z].tif ${.TARGET}.2.tmp # -rm x[a-z][a-z].tif # tiffswap ${.TARGET}.2.tmp # ~jhs/bin/.sh/tiffswap # @echo "${T_BERKLIX} Ignore next error code from tiffcp." # -tiffcp ${.TARGET}.1.tmp ${.TARGET}.2.tmp ${.TARGET} # -rm ${.TARGET}.1.tmp ${.TARGET}.2.tmp # @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # .endif #} #------------------------------------------------------------------------------ # How To Build Tools .if !target(${ACROREAD}) #{ ${ACROREAD}: pkg install acroread @# cd /usr/ports/print/acroread && make install @# acroread: with pdf, gives a better presentation, & is @# faster if antialias enabled. But won''t compile. .endif #} ${ACROREAD} .if !target(${CMPD}) #{ ${CMPD}: mkdir cmpd @cd cmpd && fetch ${PATH_CMPD}/cmpd.c @cd cmpd && fetch ${PATH_CMPD}/Makefile @cd cmpd && fetch ${PATH_CMPD}/cmpd.1 @cd cmpd && cd ${.CURDIR}; ${MAKE_JHS} all install rm -rf cmpd .endif #} ${CMPD} .if !target(${DJPEG}) #{ ${DJPEG}: pkg install jpeg @# cd /usr/ports/graphics/jpeg && ${MAKE_JHS} install @# In release 4.11 6.4 8.4 9.2 9.3 10.4 12.2 missing in current 2021-05 pkg install jpeg-turbo @# cd /usr/ports/graphics/jpeg-turbo && ${MAKE_JHS} install @# pkg-descr: @# drop-in replacement for the graphics/jpeg @# uses SIMD instructions (MMX, SSE2 @# brackets.c : ) @# So maybe it wont support 486 4.11-RELEASE in @# http://www.berklix.com/scanjet/ ? @# Both in pkg-plist have bin/djpeg .endif #} ${DJPEG} .if !target(${DVIPS}) #{ ${DVIPS}: pkg install dvips @# cd /usr/ports/print/dvips && ${MAKE_JHS} install .endif #} ${DVIPS} .if !target(${DVIPS2ASCII}) #{ ${DVIPS2ASCII}: pkg install dvips2ascii @# cd /usr/ports/print/dvips2ascii && ${MAKE_JHS} install .endif #} ${DVIPS2ASCII} .if !target(${FAX2PS}) #{ ${FAX2PS}: pkg install tiff @# cd /usr/ports/graphics/tiff && ${MAKE_JHS} install .endif #} ${FAX2PS} .if !target(${TIFF2PS}) #{ ${TIFF2PS}: pkg install tiff @# cd /usr/ports/graphics/tiff && ${MAKE_JHS} install .endif #} ${TIFF2PS} .if !target(${TIFFINFO}) #{ ${TIFFINFO}: pkg install tiff @# cd /usr/ports/graphics/tiff && ${MAKE_JHS} install .endif #} ${TIFFINFO} .if !target(${FFMPEG}) #{ ${FFMPEG}: pkg install ffmpeg @# cd /usr/ports/multimedia/ffmpeg && ${MAKE_JHS} install .endif #} ${FFMPEG} .if !target(${FIG2DEV}) #{ ${FIG2DEV}: pkg install transfig @# cd /usr/ports/print/transfig && ${MAKE_JHS} install .endif #} ${FIG2DEV} .if !target(${GHOSTVIEW}) #{ ${GHOSTVIEW}: pkg install ghostview @# cd /usr/ports/print/ghostview && ${MAKE_JHS} install @# ghostview: Wont start with multiple file invocation .endif #} ${GHOSTVIEW} .if !target(netpbm) #{ netpbm: @echo "Suggestion: pkg install netpbm" pkg install netpbm @# cd /usr/ports/graphics/netpbm && ${MAKE_JHS} install @echo "${T_BERKLIX} giftopnm has no manual of any sort, but see" @echo " /usr/local/share/doc/netpbm/USERDOC" @echo "No manual is installed, see source with params with:" @# brackets.c "/*" @echo " cd /usr/ports/graphics/netpbm/work/netpbm-*/converter" @echo " vi -c/parse_command_line other/pstopnm.c ppm/ppmtogif.c" @echo " vi -c/pnm_init other/giftopnm.c" @echo " vi other/pstopnm.csh" # Probably not installed. @echo "No man pstopnm, although 'pstopnm -help' emits" @echo " pstopnm: Use 'man pstopnm' for help." @# .csh: @# case -la*: # -landscape .endif #} netpbm .if !target(${GIFTOPNM}) #{ ${GIFTOPNM}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${GIFTOPNM} .if !target(${PNMCROP}) #{ ${PNMCROP}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PNMCROP} .if !target(${PNGTOPNM}) #{ ${PNGTOPNM}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PNGTOPNM} .if !target(${PNMQUANT}) #{ ${PNMQUANT}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PNMQUANT} .if !target(${PNMROTATE}) #{ ${PNMROTATE}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PNMROTATE} .if !target(${PNMSCALE}) #{ ${PNMSCALE}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PNMSCALE} .if !target(${PNMTOJPEG}) #{ ${PNMTOJPEG}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PNMTOJPEG} .if !target(${PNMTOPS}) #{ ${PNMTOPS}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PNMTOPS} .if !target(${PPMTOGIF}) #{ ${PPMTOGIF}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PPMTOGIF} .if !target(${PS2EPSI}) #{ ${PS2EPSI}: pkg install ghostscript9-base @# cd /usr/ports/print/ghostscript9-base && ${MAKE_JHS} install .endif #} ${PS2EPSI} .if !target(${PSTOPNM}) #{ ${PSTOPNM}: @cd ${.CURDIR}; ${MAKE_JHS} netpbm .endif #} ${PSTOPNM} .if !target(${GS}) #{ .if !target(${PS2PDF}) #{ ${GS} ${PS2PDF}: pkg install ghostscript8 @# cd /usr/ports/print/ghostscript8 && ${MAKE_JHS} install pkg install ghostscript9-agpl-bas @# cd /usr/ports/print/ghostscript9-agpl-base && make @# OL JJLATER consider removal: pkg install ghostscript @# cd /usr/ports/print && ${MAKE_JHS} ghostscriptjhs @# label ghostscriptjhs supplied by @# ~/public_html/src/bsd/fixes/FreeBSD/ports/jhs/print/Makefile.local .endif #} ${PS2PDF} .endif #} ${GS} .if !target(${GV}) #{ ${GV}: pkg install gv @# cd /usr/ports/print/gv && ${MAKE_JHS} install @# gv: with PDF, gives wrong format & chops right margin @# at the normal/landscape boundary & chops right margin @# at the normal/landscape boundary @# Does not offer a "Next" button (for multiple @# file invocation). .endif #} ${GV} .if !target(${INFO}) #{ .if !target(${INFOKEY}) #{ .if !target(${INSTALL-INFO}) #{ .if !target(${MAKEINFO}) #{ .if !target(${TEXI2DVI}) #{ .if !target(${TEXI2PDF}) #{ ${INFO} ${INFOKEY} ${INSTALL-INFO} ${MAKEINFO} ${TEXI2DVI} ${TEXI2PDF} \ ${TEXINDEX}: pkg install texinfo @# cd /usr/ports/print/texinfo && ${MAKE_JHS} install .endif #} ${TEXI2PDF} .endif #} ${TEXI2DVI} .endif #} ${MAKEINFO} .endif #} ${INSTALL-INFO} .endif #} ${INFOKEY} .endif #} ${INFO} .if !target(${LAME}) #{ ${LAME}: pkg install lame @# cd /usr/ports/audio/lame && ${MAKE_JHS} install .endif #} ${LAME} .if !target(${LATEX}) #{ ${LATEX}: # For bim leaftlet pkg install latex @# cd /usr/ports/print/latex && ${MAKE_JHS} install .endif #} ${LATEX} .if !target(${LATEX2HTML}) #{ ${LATEX2HTML}: pkg install latex2html @# cd /usr/ports/textproc/latex2html && ${MAKE_JHS} install .endif #} ${LATEX2HTML} .if !target(${LE}) #{ ${LE}: mkdir le @cd le && fetch ${PATH_LE}/le.c @cd le && fetch ${PATH_LE}/Makefile @cd le && fetch ${PATH_LE}/le.1 @cd le && cd ${.CURDIR}; ${MAKE_JHS} all install rm -rf le .endif #} ${LE} .if !target(${NOTAIL}) #{ ${NOTAIL}: mkdir notail @cd notail && fetch ${PATH_NOTAIL}/notail.c @cd notail && fetch ${PATH_NOTAIL}/Makefile @cd notail && fetch ${PATH_NOTAIL}/notail.1 @cd notail && cd ${.CURDIR}; ${MAKE_JHS} all install rm -rf notail .endif #} ${NOTAIL} .if !target(${PDF2PS}) #{ ${PDF2PS}: pkg install ghostscript9 @# cd /usr/ports/print/ghostscript9 && ${MAKE_JHS} install .endif #} ${PDF2PS} .if !target(${PDFTOHTML}) #{ ${PDFTOHTML}: pkg install pdftohtml @# cd /usr/ports/textproc/pdftohtml && ${MAKE_JHS} install .endif #} ${PDFTOHTML} .if !target(${PDFLATEX}) #{ ${PDFLATEX}: # For bim leaftlet pkg install teTeX-base @# cd /usr/ports/print/teTeX-base && ${MAKE_JHS} install .endif #} ${PDFLATEX} .if !target(${CALIBRE}) #{ ${CALIBRE}: # For production of .epub from .pdf pkg install calibre @# cd /usr/ports/deskutils/calibre && ${MAKE_JHS} install .endif #} ${CALIBRE} .if !target(${PAMTOTIFF}) #{ ${PAMTOTIFF}: @# http://netpbm.sourceforge.net/doc/pnmtotiff.html @# In Netpbm 10.30 (October 2005), @# ${PNMTOTIFF} was extended and renamed to ${PAMTOTIFF} @# FreeBSD 9.2-RELEASE & 2018-12-06-current both have: @# brackets.c balancer < @# ${PNMTOTIFF}@ -> ${PAMTOTIFF} @# Old: cd /usr/ports/graphics/pamtotiff && ${MAKE_JHS} install pkg install netpbm @# cd /usr/ports/graphics/netpbm && ${MAKE_JHS} install @# Flags include "transparent" "comment" etc, but nothing for: @# landscape portrait a4 letter pagesize papersize .endif #} ${PAMTOTIFF} .if !target(${PSNUP}) #{ .if !target(${PSSELECT}) #{ .if !target(${PSTOPS}) #{ ${PSNUP} ${PSSELECT} ${PSTOPS}: pkg install psutils-a4 @# cd /usr/ports/print/psutils-a4 && ${MAKE_JHS} install @# print/psutils-letter .endif #} ${PSTOPS} .endif #} ${PSSELECT} .endif #} ${PSNUP} .if !target(${ASPELL}) #{ ${ASPELL}: pkg install aspell @# cd /usr/ports/textproc/aspell && ${MAKE_JHS} install @# In FreeBSD-9.3 & current_2014-08, not in 9.2 & 10.0. .endif #} ${ASPELL} .if !target(${ISPELL}) #{ ${ISPELL}: pkg install aspell @# cd /usr/ports/textproc/aspell && ${MAKE_JHS} install @# In FreeBSD-9.2 & 10.0, not in 9.3 & current_2014-08. @# JJLATER what is pkg name pkg install aspell-german @cd /usr/ports/german/aspell && ${MAKE_JHS} install .endif #} ${ISPELL} .if !target(${TESSERACT}) #{ ${TESSERACT}: pkg install tesseract @# cd /usr/ports/graphics/tesseract && ${MAKE_JHS} install @# https://cgit.freebsd.org/ports/plain/graphics/tesseract/pkg-descr @# https://github.com/tesseract-ocr/tesseract @# http://groups.google.com/group/tesseract-ocr @# https://tesseract-ocr.github.io/ @# https://en.wikipedia.org/wiki/Tesseract_(software) @# add support for German: pkg install tesseract-data @# cd /usr/ports/graphics/tesseract-data && ${MAKE_JHS} install @# tesseract -v @# tesseract 3.05.02 @# leptonica-1.76.0 l @# libgif 5.1.4 @# libjpeg 8d (libjpeg-turbo 2.0.0) @# libpng 1.6.35+apng @# libtiff 4.0.10 @# zlib 1.2.11 @# libwebp 1.0.1 @# libopenjp2 2.3.0 @# graphics/leptonica .endif #} ${TESSERACT} # TESSDATA_PREFIX=/usr/local/share/tessdata # Where tesseract finds eng.traineddata, not needed on # FreeBSD-9.2-RELEASE, but needed for 12.2-STABLE # & current 2018-12. tesseract fails to set it by default. .if !target(${TIDY}) #{ ${TIDY}: pkg install tidy @# cd /usr/ports/www/tidy && ${MAKE_JHS} install && \ ln -s tidy4 /usr/local/bin/tidy .endif #} ${TIDY} .if !target(${VLC}) #{ ${VLC}: pkg install vlc @# cd /usr/ports/multimedia/vlc && ${MAKE_JHS} install .endif #} ${VLC} .if !target(${XDVI}) #{ ${XDVI}: pkg install xdvi @# cd /usr/ports/print/xdvi && ${MAKE_JHS} install .endif #} ${XDVI} .if !target(${XEARTH}) #{ ${XEARTH}: pkg install xearth @# cd /usr/ports/astro/xearth && ${MAKE_JHS} install @# xearth for ~jhs/src/bsd/jhs/bin/public/date/ .endif #} ${XEARTH} .if !target(${XPDF}) #{ ${XPDF}: pkg install xpdf @# cd /usr/ports/print/xpdf && ${MAKE_JHS} install @# xpdf with pdf, works ok @# Does not offer a "Next" button (for multiple file invocation). .endif #} ${XPDF} #------------------------------------------------------------------------------ .if !target(${UMLAUTS_INC}) #{ UMLAUTS_SRC = ${HOME}/public_html/standards/umlauts.rof # JJLATER change path to \ # ${HOME}/public_html/src/bsd/fixes/freebsd/src/jhs/share/tmac/ ${UMLAUTS_INC}: .if exists(${UMLAUTS_SRC}) #{{ -mkdir `dirname` @mkdir ${TMAC_DIR} # Necessary since nroff was removed from src/. install -c ${UMLAUTS_SRC} ${UMLAUTS_INC} .else #}{ @cd && cd tmp && fetch \ http://www.berklix.com/~jhs/standards/umlauts.rof \ && install -c umlauts.rof ${UMLAUTS_INC} .endif #}} .endif #} ${UMLAUTS_SRC} #------------------------------------------------------------------------------ .if !target(${COMMON_INC}) #{ COMMON_SRC = ${HOME}/public_html/standards/common.rof # JJLATER change path to \ # ${HOME}/public_html/src/bsd/fixes/freebsd/src/jhs/share/tmac/ ${COMMON_INC}: .if exists(${COMMON_SRC}) install -c ${COMMON_SRC} ${COMMON_INC} .else @cd && cd tmp && fetch \ http://www.berklix.com/~jhs/standards/common.rof \ && install -c common.rof ${COMMON_INC} .endif .endif #} ${COMMON_INC} #------------------------------------------------------------------------------ # Viewers. .if ! defined (VIEW_TOOLS) #{ VIEW_TOOLS = ${GHOSTVIEW} ${GV} ${XDVI} ${XPDF} # ${ACROREAD} .endif #} VIEW_TOOLS .if ! defined (CHECK_TOOLS) #{ CHECK_TOOLS = ${DVIPS2ASCII} ${SPELL} # ${ACROREAD} .endif #} CHECK_TOOLS .if ! defined (BUILD_TOOLS) #{ BUILD_TOOLS = ${DVIPS} ${GS} ${LATEX2HTML} ${LATEX} ${LE} ${PDFLATEX} \ ${PS2PDF} ${PSNUP} ${PSSELECT} ${PSTOPS} .endif #} BUILD_TOOLS #------------------------------------------------------------------------------ # Syntax examples: # t: # man true: utility always returns with an exit code of zero # @if ( true ) ; then \ # echo -n "printed " ; echo "printed" ; \ # else \ # echo -n "silent " ; echo "silent" ; \ # fi # nt: # @if ( ! true ) ; then \ # echo -n "silent " ; echo "silent" ; \ # else \ # echo -n "printed " ; echo "printed" ; \ # fi # f: # man false: utility always returns with a non-zero exit code # @if ( false ) ; then \ # echo -n "silent " ; echo "silent" ; \ # else \ # echo -n "printed " ; echo "printed" ; \ # fi # tst: # man test: -s returns 0 if file exists and # # has a size greater than zero # # brackets.c balancer < # @echo text > $@.tmp # @if ( test -s $@.tmp ) ; then \ # echo -n "printed " ; echo "printed" ; \ # else \ # echo -n "silent " ; echo "silent" ; \ # fi # @rm $@.tmp # c: # man cmp: returns 0 if same. # # brackets.c balancer < # @echo tmp > ${HOME}/tmp/$@.tmp # @if ( cmp ${HOME}/tmp/$@.tmp ${HOME}/tmp/$@.tmp ) ; then \ # echo -n "printed " ; echo "printed" ; \ # else \ # echo -n "silent " ; echo "silent" ; \ # fi # @rm ${HOME}/tmp/$@.tmp # tort: # @if ( true || true ) ; then \ # echo -n "printed " ; echo "printed" ; \ # else \ # echo -n "silent " ; echo "silent" ; \ # fi # forf: # @if ( false || false ) ; then \ # echo -n "silent " ; echo "silent" ; \ # else \ # echo -n "printed " ; echo "printed" ; \ # fi # tandt: # @if ( true && true ) ; then \ # echo -n "printed " ; echo "printed" ; \ # else \ # echo -n "silent " ; echo "silent" ; \ # fi # fandf: # @if ( false && false ) ; then \ # echo -n "silent " ; echo "silent" ; \ # else \ # echo -n "printed " ; echo "printed" ; \ # fi # test: t nt f tort forf tandt fandf tst # # Warning although ~ evaluates in /bin/sh it doesnt in Makefiles. #------------------------------------------------------------------------------ # Retrofit all ~ Makefiles to be able to run silently without complaint # on both 6.0-BETA2 & also silently on 5 & 4. fo NOOBJ NO_OBJ # See also /usr/share/mk/bsd.compat.mk # { # .if !defined(BURN_BRIDGES) # .for oldnew in \ # NOATM:NO_ATM \ # NOCLEANDIR:NO_CLEANDIR \ # NOCRYPT:NO_CRYPT \ # NODOCCOMPRESS:NO_DOCCOMPRESS \ # NOEXTRADEPEND:NO_EXTRADEPEND \ # NOFORTH:NO_FORTH \ # NOFSCHG:NO_FSCHG \ # NOGAMES:NO_GAMES \ # NOHTML:NO_HTML \ # NOINET6:NO_INET6 \ # NOINFO:NO_INFO \ # NOINFOCOMPRESS:NO_INFOCOMPRESS \ # NOINSTALLLIB:NO_INSTALLLIB \ # NOLIBC_R:NO_LIBC_R \ # NOLIBPTHREAD:NO_LIBPTHREAD \ # NOLIBTHR:NO_LIBTHR \ # NOLINT:NO_LINT \ # NOMAN:NO_MAN \ # NOMANCOMPRESS:NO_MANCOMPRESS \ # NOMLINKS:NO_MLINKS \ # NOOBJ:NO_OBJ \ # NOPAM:NO_PAM \ # NOPIC:NO_PIC \ # NOPROFILE:NO_PROFILE \ # NO_RCMNDS:NO_RCMDS \ # NOSHARE:NO_SHARE \ # NOSHARED:NO_SHARED \ # NOTAGS:NO_TAGS # To silence brackets.c I inserted an underscore _ in next line # .for old in ${oldnew:C/:.*_//} # .for new in ${oldnew:C/.*://} # .if defined(${old}) && !defined(${new}) # .warning ${old} is deprecated in favor of ${new} # ${new}= ${${old}} # .endif # .endfor # .endfor # .endfor # .endif # } #------------------------------------------------------------------------------ # Strings of 8bit binary characters observed to be emitted from ${TESSERACT}. # I dont like 8bit, neither do various Unix BSD commands such as fmt, # & neither does mgdiff which refuses to display. # FROM=H # English from ~/txt/brexit/2018-11-30_mp/ # FROM=G # German from cd ~/txt/subaru/2legacy_trend/; # make 2015-10-29_schneider_check_list_10000km_blank.txt_g # FROM=! Clash on emissions depending on language # START OF EVIL 8BIT chars below, I should escape them JJLATER { # 8BIT DIRTY 7BIT CLEAN FROM DESCRIPTION # ° \xc2\xb0 G small circle for degrees temp # » \xc2\xbb G . in abreviation eg ggf. # — \xe2\x80\x94 CG a long hyphen -- # ‘ \xe2\x80\x98 G 2nd * suffix for a PS note # ’ \xe2\x80\x99 C an apostrophe in don''t # “ \xe2\x80\x9c C! [Italicised] `` # “ \xe2\x80\x9c C! [Italicised] `` 1st * suffix for a PS note # “ \xe2\x80\x9c G! 1st * suffix for a PS note # ” \xe2\x80\x9d C [Italicised] '' # fi \xef\xac\x81 C fi in field # fl \xef\xac\x82 C fl in flourish # Seen from Joy@ # 2021-12-28 # User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) \ # Gecko/20100101 Thunderbird/91.4.1 # Content-Type: text/plain; charset=UTF-8; format=flowed # Content-Transfer-Encoding: 8bit # MOT test Unit price      Disc %        Total price vadated code # 8BIT DIRTY 7BIT CLEAN FROM DESCRIPTION #   \xc2\xa0 Joy Long space or a tab # https://en.wikipedia.org/wiki/UTF-8#Codepage_layout # Man ascii + hand added 1st column: # 0&8 00 NUL 01 SOH 02 STX 03 ETX 04 EOT 05 ENQ 06 ACK 07 BEL # 0&8 08 BS 09 HT 0a LF 0b VT 0c FF 0d CR 0e SO 0f SI # 1&9 10 DLE 11 DC1 12 DC2 13 DC3 14 DC4 15 NAK 16 SYN 17 ETB # 1&9 18 CAN 19 EM 1a SUB 1b ESC 1c FS 1d GS 1e RS 1f US # 2&A 20 SP 21 ! 22 "" 23 # 24 $ 25 % 26 & 27 '' # 2&A 28 ( 29 ) 2a * 2b + 2c , 2d - 2e . 2f / # 3&B 30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7 # 3&B 38 8 39 9 3a : 3b ; 3c < 3d = 3e > 3f ? # 4&C 40 @ 41 A 42 B 43 C 44 D 45 E 46 F 47 G # 4&C 48 H 49 I 4a J 4b K 4c L 4d M 4e N 4f O # 5&D 50 P 51 Q 52 R 53 S 54 T 55 U 56 V 57 W # 5&D 58 X 59 Y 5a Z 5b [ 5c \ 5d ] 5e ^ 5f _ # 6&E 60 `` 61 a 62 b 63 c 64 d 65 e 66 f 67 g # 6&E 68 h 69 i 6a j 6b k 6c l 6d m 6e n 6f o # 7&F 70 p 71 q 72 r 73 s 74 t 75 u 76 v 77 w # 7&F 78 x 79 y 7a z 7b { 7c | 7d } 7e ~ 7f DEL # Long hyphen seen elsewhere: # At 2019-01-09, a screen save of # https://www.independent.co.uk/subscribe?utm_campaign=footer_our_products\ # &utm_medium=prompt&utm_source=internal\ # &utm_term=subscribe # contained this string: # 8BIT DIRTY 3 bytes with top bit: "journalists — with" # 7BIT CLEAN expanded to be legible: "journalists \xe2\x80\x94 with" # Question: where are these evil 8bit strings defined ? # brackets.c: /* ' OCR_PUNCTUATION = \ | sed -e s/°/deg./g \ | sed -e s/»/./g \ | sed -e s/—/--/g \ | sed -e s/—/-/g \ | sed -e s/‘/\*/g \ | sed -e s/’/\'/g \ | sed -e s/”/\'\'/g \ | sed -e s/fi/fi/g \ | sed -e s/fl/fl/g OCR_PUNCTUATION_E = | sed -e s/“/\`\`/g OCR_PUNCTUATION_G = | sed -e s/“/\Z/g # Warning some of these 8bit bytes screw up the xterm so that running # vi after a make is screwed. # JJLATER remove these 8bit bytes & use a meta escaped representation. .ifndef DEBUG_BERKLIX_MK #{{ quieter, just do the work OCR_UMLAUTS = \ | sed -e s/Ö/Oe/g \ | sed -e s/Ü/ae/g \ | sed -e s/ä/ae/g \ | sed -e s/é/ae/g \ | sed -e s/ö/oe/g \ | sed -e s/ü/ue/g .else # }{ Noisier: do the work, but also add a marker for search in # typescript. Assume the ___DEBUG___ unlikely to match data. OCR_UMLAUTS = \ | sed -e s/Ö/Oe/g | sed -e s/___DEBUG___/___DEBUG___1__/\ | sed -e s/Ü/ae/g | sed -e s/___DEBUG___/___DEBUG___2__/\ | sed -e s/ä/ae/g | sed -e s/___DEBUG___/___DEBUG___4__/\ | sed -e s/é/ae/g | sed -e s/___DEBUG___/___DEBUG___5__/\ | sed -e s/ö/oe/g | sed -e s/___DEBUG___/___DEBUG___6__/\ | sed -e s/ü/ue/g | sed -e s/___DEBUG___/___DEBUG___7__/ .endif #}} # This below was OK with 9.2-RELEASE, # but breaks on the one sed before ___DEBUG___3 with 12.2-STABLE # 0_9f & 0_7f = 0_1f = ascii US # OCR_UMLAUTS = \ # | sed -e s/Ö/Oe/g | sed -e s/___DEBUG___/___DEBUG___1__/\ # | sed -e s/Ü/ae/g | sed -e s/___DEBUG___/___DEBUG___2__/\ # | sed -e s/ß/ss/g | sed -e s/___DEBUG___/___DEBUG___3__/\ # | sed -e s/ä/ae/g | sed -e s/___DEBUG___/___DEBUG___4__/\ # | sed -e s/é/ae/g | sed -e s/___DEBUG___/___DEBUG___5__/\ # | sed -e s/ö/oe/g | sed -e s/___DEBUG___/___DEBUG___6__/\ # | sed -e s/ü/ue/g | sed -e s/___DEBUG___/___DEBUG___7__/ # JJLATER some umlauts above may need to be converted # from lower to upper case. # ${HOME}/tmp/`basename ${.TARGET} .txt_g`.tesseract_debug # below is to analyse which. # END OF EVIL 8bit chars above, I should escape them JJLATER } .if !target(.tiff.txt) #{ For English (& Italian etc), no special characters # Normally direction might be other way using nroff ? # But this does not seem to complain about a graph cycle. .tiff.txt: ${TESSERACT} @echo "${T_BERKLIX} OCR: Optical Character Recognition, may be slow." @echo "For English cleaned of 8bit puctuation, instead use: " @echo " make `basename ${.TARGET} .txt`.txt_e" @echo -n "For German with umlauts, cleaned of 8bit puctuation, " @echo -n "instead use: cd ${.CURDIR}; ${MAKE_JHS}" @echo " `basename ${.TARGET} .txt`.txt_g" export TESSDATA_PREFIX=/usr/local/share/tessdata ; \ ${TESSERACT} ${.IMPSRC} `basename ${.TARGET} .txt` .endif #} .tiff.txt # # brackets.c balancer < # cat ${.IMPSRC} | tr \\200-\\377 _ > ${.TARGET} .if !target(.tiff.txt_e) #{ NEW TO FIX .tiff.txt_e: ${TESSERACT} # For English + puctuation to ascii + 7 bit cleaned @# ${MAKE_JHS} expects to create eg Thing.txt_e @#echo "${T_BERKLIX} OCR: Optical Character Recognition, so slow." export TESSDATA_PREFIX=/usr/local/share/tessdata ; \ ${TESSERACT} ${.IMPSRC} `basename ${.TARGET} .txt_e` @# tesseract appends a .txt to create Thing.txt @# Apache knows about serving .txt so do not move it. mv `basename ${.TARGET} .txt_e`.txt \ `basename ${.TARGET} .txt_e`.txt.pre_sed.tmp @# brackets.c balancer < cat `basename ${.TARGET} .txt_e`.txt.pre_sed.tmp \ ${OCR_PUNCTUATION} ${OCR_PUNCTUATION_E} | \ tr \\200-\\377 _ > `basename ${.TARGET} .txt_e`.txt -rm `basename ${.TARGET} .txt_e`.txt.pre_sed.tmp @# ln -s `basename ${.TARGET} .txt_e`.txt ${.TARGET} .endif #} .tiff.txt_e .if !target(.tiff.txt_g) #{ .tiff.txt_g: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @cd ${.CURDIR}; ${MAKE_JHS} ${TESSERACT} @# For German @# make expects to create eg Thing.txt_g @#echo -n "${T_BERKLIX} OCR: Optical Character Recognition, " @#echo "so rather slow." export TESSDATA_PREFIX=/usr/local/share/tessdata ; \ ${TESSERACT} -l deu ${.IMPSRC} `basename ${.TARGET} .txt_g` @# tesseract appends a .txt to create Thing.txt @# Apache knows about serving .txt so do not move it. @# cp `basename ${.TARGET} .txt_g`.txt \ @# ${HOME}/tmp/`basename ${.TARGET} .txt_g`.tesseract_debug @# umlauts above use 8th bit high which screws xterm bt not vi, @# later below they get converted to ae oe ue etc. @# ls -l `basename ${.TARGET} .txt_g`.txt @test -s ${.CURDIR}/`basename ${.TARGET} .txt_g` \ && echo -n "Info: ${TESSERACT} extracted text to " \ && echo "`basename ${.TARGET} .txt_g`.txt" \ || echo -n "Warning: ${TESSERACT} failed to extract text " \ && echo "to `basename ${.TARGET} .txt_g`.txt" @# --- @# Duplicate alternate code. @# @if filesize 0 = ${.CURDIR}/`basename ${.TARGET} .txt_g`.txt ; \ @# then echo -n "Warning: ${TESSERACT} failed to extract text to " @# && echo "`basename ${.TARGET} .txt_g`.txt" ; \ @# else echo -n "Info: ${TESSERACT} extracted text to " \ @# && echo "`basename ${.TARGET} .txt_g`.txt" ; fi @# --- mv `basename ${.TARGET} .txt_g`.txt \ `basename ${.TARGET} .txt_g`.txt.pre_sed.tmp @# brackets.c balancer < cat `basename ${.TARGET} .txt_g`.txt.pre_sed.tmp \ ${OCR_PUNCTUATION} ${OCR_PUNCTUATION_G} ${OCR_UMLAUTS} | \ tr \\200-\\377 _ > `basename ${.TARGET} .txt_g`.txt -rm `basename ${.TARGET} .txt_g`.txt.pre_sed.tmp @# --- @echo "Suggestion: To avoid avoid OCR running again, you could:" @echo " ln -s `basename ${.TARGET} .txt_g`.txt ${.TARGET}" @echo "but usually it is better to:" @echo " vi `basename ${.TARGET} .txt_g`.txt" @echo " make `basename ${.TARGET} .txt_g`.pdf" @echo " rm `basename ${.TARGET} .txt_g`.tiff" @echo " rm -f `basename ${.TARGET} .txt_g`.txt_g" @# --- @# echo -n "${T_BERKLIX} Note umlauts get expanded " @# echo "to 2 letter ascii representation." @# My jhs@ preference, ready to be embedded in eg .rof files using \(:ae @# brackets.c: \) @# rather than single byte 8bit, which could be preference of @# non technical Germans who don''t understand escape sequences. @# --- @# graphics/tesseract-data also offers tesseract -l deu-frak @# but that is for Fraktur script (ie century old), @# which I don''t want to scan @# https://en.wikipedia.org/wiki/Fraktur @# https://en.wikipedia.org/wiki/Tesseract_%28software%29 @# --- @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .tiff.txt_g #------------------------------------------------------------------------------ .if !target(.wav.mp3) #{ .wav.mp3: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ${LAME} ${LAME} ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .wav.mp3 # Does a wav2mp3 conversion works on wav from cd, # but not wav from clipman # lame on same host called twice produces same content. # lame on different hosts fire & laps produces same size # different content both playable. # --------- # wav2mp3 # not installed, but web search: # http://wav2mp3lame.sourceforge.net/ # Welcome to the homepage of Wav2MP3 Wizard, the lightest and # fastest GUI for the 3 most-widely used open-source encoders; # LAME, BladeEnc and OGG Vorbis. # ---- # clipman generates both 32 kbps .wav files & 8bkps .act files #------------------------------------------------------------------------------ .if !target(mp3) #{ mp3: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# ${MAKE_JHS} # wav ${CMD_FOR_BUILD} i in ${FOR_WAV} ; do \ ${EQUAL1} $$i ${EQUAL2} $$i ${EQUAL3} ${EQUAL4} $$i \ ${EQUAL5} ; \ cd ${.CURDIR}; ${MAKE_JHS} `basename $$i .wav`.mp3 ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} mp3 #------------------------------------------------------------------------------ .if !target(.wma.mp3) #{ # xmms plays .wav .wma.mp3: @echo "${T_BERKLIX} What tool to convert .wma to .mp3 ?" @echo "ffmpeg can encode wma: http://ffmpeg.mplayerhq.hu" @# k3b references multimedia/ffmpeg decoder for wma files, @# ports/multimedia/ffmpeg - video motion reduction. .endif #} .wma.mp3 #------------------------------------------------------------------------------ # echo "ports/audio/xmms-wma for xmms, supports MickeySoft WMA format" #------------------------------------------------------------------------------ # sound stick formats: # ogg: gnu max compact free # mp3 rights reg with fraunhofer # drm digital rights management (for holywood legal download) #------------------------------------------------------------------------------ @# /usr/ports/audio/mp3splt to split mp3 ogg vorbis and native flac @# cdda2wav # ports/sysutils/cdrtools @# cdda2wav -B # printenv CDDA_DEVICE ; cdrecord -v -scanbus #------------------------------------------------------------------------------ @# cd2mp3 # ports/audio/audio/cd2mp3 #------------------------------------------------------------------------------ .if !target(clean_mp3) #{ clean_mp3: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @# cd ${.CURDIR}; ${MAKE_JHS} # clean_wav @${CMD_FOR_CLEAN} i in ${FOR_WAV} ; do \ rm -f `basename $$i .wav`.mp3 ; \ done @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} clean_mp3 #------------------------------------------------------------------------------ # A tune from Apple in their non mp3 format, 'file' reported as: # tune.m4a: ISO Media, MPEG v4 system, iTunes AAC-LC # After conversion became: # tune.mp2: MPEG ADTS, layer II, v1, 64 kbps, 44.1 kHz, Stereo # tune.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, \ # layer III, v1, 128 kbps, 44.1 kHz, JntStereo .if !target(.m4a.mp2) #{ .m4a.mp2: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ${FFMPEG} ffmpeg -i ${.IMPSRC} -acodec mp2 ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .m4a.mp2 #------------------------------------------------------------------------------ .if !target(.mp2.mp3) #{ .mp2.mp3: @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" @cd ${.CURDIR}; ${MAKE_JHS} ${LAME} ${LAME} --tt `basename ${.TARGET} .mp3` ${.IMPSRC} ${.TARGET} @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" .endif #} .mp2.mp3 #------------------------------------------------------------------------------ # I dont need this rule, so leave it commented out. # .if !target(.m4a.mpeg4) #{ # .m4a.mpeg4: ${VLC} # @${ECHO_START} "${T_START_RULE} ${.IMPSRC} $@ {" # @${ECHO_BUILD} "${.TARGET}: ${.IMPSRC}" # @echo export it using vlc ${.IMPSRC} # @${ECHO_END} "${T_END_RULE} ${.IMPSRC} $@ }" # .endif #} #------------------------------------------------------------------------------ .if !target(ocr) #{ ocr: @echo "Suggestion: I you want to make thing.txt from thing.pdf try:" @echo " make PDF_TO_TIFF_FORCE=YES thing.tiff" @echo " For English docs: make thing.txt" @echo " OR" @echo " For German docs: make thing.txt_g" @echo " rm thing.tiff" .endif #} ocr #------------------------------------------------------------------------------ .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) #{ # The above ifdef was a failed attempt to try to avoid warning: # "/usr/share/mk/bsd.subdir.mk", # line 66: warning: duplicate script for target "txt" ignored # I added .if !target(____) # see TXT_BERKLIX .if !target(____) #{ .include .endif #} bsd.init.mk .endif #} SUBDIR # Previously berklix.mk & bsd.subdir.mk were included by my Makefiles in # /site /home/jhs /home/jhs/extra # in either order: # .include # .include # Or # .include # .include # Both orderings presented problems: # With # .include # .include # Then # as bsd.subdir.mk defines an all: that stopped berklix.mk # all: calling all_: & thus html: & thus no rebuilds of # index.html from index.lmth # in eg /site/usr/local/www/Data/virtual/ # OTOH ~jhs/Makefile needed order: # .include # .include # else it complained dont know to make le. #------------------------------------------------------------------------------ .rof.epub: @echo "JJLATER No rule yet for .rof to .epub" @echo -n "vi -c/.rof.epub " @echo "~jhs/public_html/src/bsd/fixes/FreeBSD/src/jhs/share/mk/berklix2.mk" # need to search with eg: generation of .epub from .rof , command line # Some clues to chase # Calibre # ebook-convert # https://manpages.ubuntu.com/manpages/xenial/man1/ebook.1p.html # https://github.com/drjackyl/epubgen #------------------------------------------------------------------------------ .endif #} BERKLIX2_DEFINED # End