help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help me simplify this makefile


From: Bob Stark
Subject: Help me simplify this makefile
Date: Mon, 24 Mar 2008 19:05:53 -0400

I have a directory full of word documents (..\courses) that I want to
programmatically convert into a separate directory of adobe PDF files
(..\pdf), using make.

It seems that this should be a simple project, but it is eluding me.

After some hours, I wrote the make file below, which works. I run in from
the PDF directory (the output directory), so as to follow Paul's Make file
rule # 2.

The makefile below will be a bear to maintain (as there are actually several
thousand files). I don't want to hard-code the targets, as I have done; I
merely want EVERY word document converted to a corresponding PDF document,
if the word document has been updated or if the PDF document does not exist.

Can someone guide me thru proper use of the wildcard function, or whatever
approach is the "best practice" here?

Regards,

Bob Stark 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Makefile for building PDF outlines from word documents w/ gnu make

.SUFFIXES  :                      # Clean out default suffixes
.SUFFIXES  : .pdf .doc            # Define suffixes that make acts on

vpath %.doc ../courses

outline1=PT5464_ProductOwnerWorkshop
outline2=PT5466_WebServicesUsingRADv70
outline3=PT5467_DB2zOSPerformanceforDBAs
outline4=PT5468_AdvancedKornShellProgramming
outline5=PT5469_DB2VisualExplain
outline6=PT5470_QAFundamentals
outline7=PT5471_CISSPPreparationWorkshop
outline8=PT5476_IntermediateUNIX

all : ${outline1}.pdf           \
      ${outline2}.pdf           \
      ${outline3}.pdf           \
      ${outline4}.pdf           \
      ${outline5}.pdf           \
      ${outline6}.pdf           \
      ${outline7}.pdf           \
      ${outline8}.pdf           \

${outline1}.pdf : ${outline1}.doc
${outline2}.pdf : ${outline2}.doc
${outline3}.pdf : ${outline3}.doc
${outline4}.pdf : ${outline4}.doc
${outline5}.pdf : ${outline5}.doc
${outline6}.pdf : ${outline6}.doc
${outline7}.pdf : ${outline7}.doc
${outline8}.pdf : ${outline8}.doc

  # Generic rule to create intermediate PDF files from Word documents
%.pdf : %.doc
        printdoc -PRINTER="Adobe PDF" -EXITWORD=YES -OUTDIR=. -FILES=${<}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]