# Makefile to build .eps files from .fig, and .pdf files from either # .eps or .fig. # Part of the compexity here is because the xfig source to some of the # diagrams is missing. # 8 October 2000 Nick Urbanik # /usr/bin/epstopdf is part of tetex-1.0.7-7 on my Red Hat 7 system. EPSTOPDF = epstopdf # /usr/X11R6/bin/convert is part of ImageMagick on my Red Hat 7 system CONVERT = convert # /usr/X11R6/bin/fig2dev is part of transfig-3.2.3c-1 on my Red Hat 7 system FIG2DEV = fig2dev # There is a bug in epstopdf (gs?) where some bitmapped files get converted # into a mess. For these, I found that converting to .png then to .pdf # seemed to work. # Doing convert kdeshot.eps kdeshot.pdf seems to result in part of the # picture missing. # No need to do anything with this, but remember that we need it! TEX_SOURCE_FILE = kernel-layering.tex # A strange two-step process seems to be required to successfuly convert # these to pdf, so that can generate a PDF document: BITMAP_EPS_FILES = \ cli2 \ fvwmshot \ gnomeshot \ kdeshot \ overview2 \ overview3 \ permissions # All the rest are best handled using epstopdf, since it gets the bounding # box right. FIG_FILES = \ basic_filesystem_hard_links \ basic_filesystem_soft_links-1 \ basic_filesystem_soft_links-2 \ basic_shell_use_input_redirection \ basic_shell_use_output_redirection \ basic_shell_use_pipelines \ basic_tools_sorting_and_uniq \ fundamentals_of_TCPIP_address_classes-long-lines \ fundamentals_of_TCPIP_address_classes \ linux_overview_pipes_and_tools \ linux_overview_redirect_IO_1 \ linux_overview_redirect_IO_2 \ linux_overview_unix_philosophy \ overview3-shell # These files were drawn with xfig, but the source is missing. # Calling epstopdf works well with these. OTHER_EPSTOPDF_OKAY_FILES = \ fundamentals_of_TCPIP_packets \ fundamentals_of_TCPIP_ports \ fundamentals_of_TCPIP_routing # Pattern(s) to match for old versions of files to be deleted by 'make clean' OLDVERSIONS = *~ *.fig.bak EPSFILES = $(BITMAP_EPS_FILES:%=%.eps) \ $(FIG_FILES:%=%.eps) \ $(OTHER_EPSTOPDF_OKAY_FILES:%=%.eps) PDFFILES = $(BITMAP_EPS_FILES:%=%.pdf) \ $(FIG_FILES:%=%.pdf) \ $(OTHER_EPSTOPDF_OKAY_FILES:%=%.pdf) # create all eps and pdf files all: $(PDFFILES) $(EPSFILES) eps: $(EPSFILES) # create a pdf file from an xfig file %.pdf: %.fig $(FIG2DEV) -L eps $< $*.eps && \ $(EPSTOPDF) $*.eps > $@ # create a pdf file from a bitmap eps file; epstopdf fails on these: # Now you would think that calling convert in one step would work, # but for reasons I don't understand, it doesn't: # convert bitmap-epsfile.eps bitmap-epsfile.pdf $(BITMAP_EPS_FILES:%=%.pdf): $(BITMAP_EPS_FILES:%=%.eps) $(CONVERT) $(basename $@).eps $(basename $@).png && \ $(CONVERT) $(basename $@).png $@ && \ rm $(basename $@).png $(OTHER_EPSTOPDF_OKAY_FILES:%=%.pdf): $(OTHER_EPSTOPDF_OKAY_FILES:%=%.eps) $(EPSTOPDF) $(basename $@).eps > $@ %.pdf: %.eps $(EPSTOPDF) $*.eps > $@ # create an encapsulated postscript file from an xfig file %.eps: %.fig $(FIG2DEV) -L eps $< $@ # delete all files which can easily be regenerated tidy: -rm -f $(PDFFILES) $(FIG_FILES:%=%.eps) # delete all files which can be regenerated clean: tidy @# delete editor old-version files -rm -f $(OLDVERSIONS)