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

OT?: make questions

I'm having a problem trying to make this makefile work.  The problem is in 
the path lookup of the prerequisite files.  For some reason make keeps 
throwing away the path and just keeps the filename.  According to the 
documentation on gnu.org here:

If I set the GPATH variable to the subdirectories I wish to parse it's 
supposed to keep the path along with the filename.  For some reason I'm not 
getting that behavior.  Below is the relevant portions of the Makefile.  I 
have been able to use this successfully if I enter in the full relative path 
to the source file but I'm trying to avoid that so I can make the rules more 
complex. Right now the way I have it setup below it will not parse the sgml 
files because it can't find the files.  Anyone see any glaring errors?  
Any help would be greatly appreaciated.


# parsing program
RENDER = sgmltools

# options for parsing program
ONE_HTML = -b onehtml -s metatools/newbiedoc-onehtml.dsl

# source files without extensions
SOURCES = glossary \
        help-system.en \

# create specific type source lists
SGML_SOURCE = $(addsuffix .sgml,$(SOURCES)) 
HTML_SOURCE = $(addsuffix .html,$(SOURCES)) 

# Keep the path and look in these subdirectories if it's not in "."
GPATH = general metadoc system text_editing utils tutorials

# Target is all the html source files.  pattern rule says every html file 
# depends on sgml file of the same name.  Then render each one with sgmltools 
# and move output to tutorials directory.  The problem seems to be here.  
# When $i is passed to sgmltools it only passes the filename, not the 
# path/filename.
onehtml: $(HTML_SOURCE)

$(HTML_SOURCE): %.html: %.sgml
        for i in $(SGML_SOURCE); do $(RENDER) $(ONE_HTML) $$i; done
        for j in $(HTML_SOURCE); do mv $$j tutorials/; done

Docs by & for Debian newbies
gpg key ID: 892D2057
ascii armored version at:

Reply to: