# $Id: Makefile,v 1.5 1997/03/31 23:14:18 dps Exp $
#
#Makefile for word2x
#Test system is
# Linux 2.1.28, gcc 2.7.2, libc 5.4.27
#
# My demo of it actually compiling is in compile-log

CPPFLAGS=-g -Wall
LIBOBJS=wordwrap.o nullproc.o tblock.o scan_num.o map_chars.o col-align.o \
	ukdate.o usdate.o
AR=ar
RANLIB=ranlib
LD=ld
MYLIBS=liboutfmt.a
READER=reader.o
FMTS=fmt-text.o fmt-latex.o
CPP=g++
PROGOBJS=$(READER) $(FMTS) word2x.o $(MYLIBS) 

all:	word2x rtest2

clean:
	rm -f *.o
	rm $(MYLIBS)

liboutfmt.a: $(LIBOBJS)
	$(AR) rc $@ $(LIBOBJS)
	$(RANLIB) $@

rtest2:	rtest2.o reader.o tblock.o
	g++ -o rtest2 rtest2.o reader.o tblock.o

fmt-text.o: text-fmt.o text-table.o
	$(LD) -r -o $@ text-fmt.o text-table.o

fmt-latex.o: latex-fmt.o latex-table.o latex-embed.o
	$(LD) -r -o $@ latex-fmt.o latex-table.o latex-embed.o

word2x: $(PROGOBJS)
	$(CPP) -o $@ $(PROGOBJS)
