# Makefile for yodlfixlabels
            
# objects
OBJ = yodlfixlabels.o usage.o parseflags.o runpass.o handletag.o \
      handleline.o lastnumber.o label.o ref.o dumptable.o \
      tableofcontents.o tocentry.o handlenotag.o roffcmd.o \
      \
      ../lib/openfile.o ../lib/closefile.o ../lib/error.o \
      ../lib/errorsetprogname.o ../lib/xstrdup.o ../lib/strtabadd.o \
      ../lib/strtabfind.o ../lib/strtabfree.o ../lib/warning.o \
      ../lib/xrealloc.o ../lib/output.o ../lib/strconcat.o \
      ../lib/straddchar.o

# entry makerule
all: yodlfixlabels

# how to make program
yodlfixlabels: $(OBJ)
	$(CC) -o yodlfixlabels $(OBJ)

# generic compilation rule
.c.o:
	$(CC) -c $(CFLAGS) -o $@ -DVER=\"$(VER)\" -DYEARS=\"$(YEARS)\" \
	-DTAGSTART=\"$(TAGSTART)\" -DTAGEND=\"$(TAGEND)\" \
	-DTOCCOMMAND=\"$(TOCCOMMAND)\" $<
        
# cleanup
clean::
	rm -f $(OBJ) yodlfixlabels core
        
# installation
install: yodlfixlabels
	-mkdir -p $(STD_INCLUDE)
	$(INSTALL) yodlfixlabels $(STD_INCLUDE)
	

# extra deps
usage.o: usage.c ../../Makefile
hastag.o: hastag.c yodlfixlabels.h
handleline.o: handleline.c ../../Makefile yodlfixlabels.h 
yodlfixlabels.o: yodlfixlabels.c yodlfixlabels.h 
