#	$Id: Makefile.in,v 1.6 2001/07/13 19:35:00 sandro Exp $

srcdir = @srcdir@
VPATH = $(srcdir)

DESTDIR =
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = @bindir@
mandir = @mandir@/man1

INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL = @INSTALL@

CC = @CC@
CFLAGS = -I../.. -I$(srcdir)/../.. -I$(srcdir)/../../lib @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = ../../lib/libcutils.a @LIBS@

LEX = @LEX@
YACC = @YACC@

PROG = cunloop
OBJS = cunloop.o lexer.o

.c.o:
	$(CC) -c -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) $<

all: $(PROG)

$(PROG): $(OBJS)
	$(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)

lexer.c: lexer.l
	$(LEX) $(srcdir)/lexer.l
	mv lex.yy.c lexer.c

.PHONY: install uninstall clean realclean distclean mostlyclean

install: $(PROG)
	$(srcdir)/../../mkinsdir.sh $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)
	$(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/$(PROG).1

uninstall:
	rm -f $(DESTDIR)$(bindir)/$(PROG)
	rm -f $(DESTDIR)$(mandir)/$(PROG).1

clean:
	-rm -f $(PROG) *.o
	-rm -f lexer.c

distclean: clean
	-rm -f Makefile

realclean: distclean

mostlyclean: clean
