# Generated automatically from Makefile.in by configure.

srcdir = ../src
includedir = $(srcdir)/include

#----------------------------------------------------------------
# IMPORTANT!!!!!
# if you edit the install directory (INSTALL_DIR), 
# make sure it ends with rtf2latex2e!!!!
INSTALL_DIR = /usr/local/rtf2latex2e
#----------------------------------------------------------------


CC = cc
CFLAGS = -g -O2 -DINSTALL_DIR=\"$(INSTALL_DIR)\" -I$(includedir)

VPATH = .:$(srcdir)/common:$(srcdir)/common/cole

INSTALL = /usr/bin/install -c
MKINSTALLDIRS = ./mkinstalldirs

OBJ = rtf2LaTeX2e-driver.o \
      reader.o \
      tokenscan.o \
      LaTeX2e-writer.o \
      eqn.o \
      cole.o \
      olecod.o \
      oledecod.o	\
      support.o \
      version.o \
      internal.o \
	  figure2eps.o \
	  jpeg2eps.o

      
rtf2latex2e.bin : $(OBJ)
	$(CC) $(CFLAGS) -o ../$@ $(OBJ)
	
all : rtf2latex2e.bin

clean : 
	rm -f $(OBJ) config.log config.cache

installdirs:
	@if test -d $(INSTALL_DIR);then \
		echo; \
		echo "old distribution of rtf2latex2e found!"; \
		echo "renaming directory to $(INSTALL_DIR).old"; \
		rm -rf $(INSTALL_DIR).old; \
		mv -bf $(INSTALL_DIR) $(INSTALL_DIR).old; \
		echo; \
		$(MKINSTALLDIRS) $(INSTALL_DIR); \
	else $(MKINSTALLDIRS) $(INSTALL_DIR); fi

install : rtf2latex2e.bin clean installdirs
	cp ../rtf2latex2e.bin $(INSTALL_DIR)/
	cp ../INSTALL $(INSTALL_DIR)/
	cp ../README $(INSTALL_DIR)/
	cp -r ../doc $(INSTALL_DIR)/
	cp -r ../examples $(INSTALL_DIR)/
	cp -r ../pref $(INSTALL_DIR)/
	cp -r ../src $(INSTALL_DIR)/
	cp -r ../Unix $(INSTALL_DIR)/
	ln -sf $(INSTALL_DIR)/rtf2latex2e.bin /usr/bin/rtf2latex2e
	@echo
	@echo "rtf2latex2e has been installed in $(INSTALL_DIR)"
	@echo "A symbolic link /usr/bin/rtf2latex2e has been created"
	@echo
	@echo "Please set the environment variable RTF2LATEX2E_DIR to $(INSTALL_DIR)."
	@echo
