CFLAGS	= -O2
LDFLAGS	= -s -N

LDLIBS	= 

PROG    = from to
VERSION	= 1.0.3

BIN_OWNER	= bin
BIN_GROUP	= bin
ROOTDIR		=
INSTALL		= /usr/bin/install

all:		$(PROG)

from:		from.c
		$(CC) -o $@ $(LDFLAGS) $(CFLAGS) from.c $(LDLIBS)

to:		to.c
		$(CC) -o $@ $(LDFLAGS) $(CFLAGS) to.c $(LDLIBS)

install:	$(PROG)
		$(INSTALL) -s -o $(BIN_OWNER) -g $(BIN_GROUP) -m 511 $(PROG) $(ROOTDIR)/usr/bin
		$(INSTALL) -o $(BIN_OWNER) -g $(BIN_GROUP) -m 644 *.1 $(ROOTDIR)/usr/man/man1
		(cd $(ROOTDIR)/usr/man/man1 ; ln -sf fromto.1 from.1)
		(cd $(ROOTDIR)/usr/man/man1 ; ln -sf fromto.1 to.1)

clean:
		$(RM) -rf *.o *.a *.s

clobber:
		$(RM) -rf *.o *.a *.s $(PROG)

dist:
		@tar cfv - * | gzip -9 >../fromto-$(VERSION).tar.gz

