# $Id: Makefile.in,v 1.15 2009-06-30 16:31:13 zacheiss Exp $

SHELL=/bin/sh
@SET_MAKE@

CC=@CC@
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@
DEFS=@DEFS@
ALL_CFLAGS=$(CPPFLAGS) $(CFLAGS) $(DEFS)
LIBTOOL=@LIBTOOL@
PRO_C=@PRO_C@
PRO_C_DEFS=@PRO_C_DEFS@
PRO_C_INCLUDES=@PRO_C_INCLUDES@
PRO_C_OPTS=@PRO_C_OPTS@
PRO_C_FLAGS=$(PRO_C_OPTS) $(PRO_C_DEFS) $(PRO_C_INCLUDES)
LDFLAGS=@LDFLAGS@
SQL_LIBS=@SQL_LIBS@
LIBS=@LIBS@
MR_LIBDEP=@MR_LIBDEP@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@

srcdir=@srcdir@
VPATH=@srcdir@
SRCTOP=@top_srcdir@
top_builddir=@top_builddir@
BUILDTOP=..
mrbindir=@mrbindir@

STUDENT_OBJS=student.lo common.lo
STAFF_OBJS=staff.lo common.lo
VOTE_OBJS=vote.lo

CFILES=student.c staff.c common.c vote.c

TARGET=student staff vote
SCRIPTS=grouper.pl staff.sql stellar.pl student.sql

.SUFFIXES: .pc .lo

.pc.c:
	$(PRO_C) $(PRO_C_FLAGS) INAME=$< ONAME=$@

.c.lo:
	$(LIBTOOL) --mode=compile $(CC) -c $(ALL_CFLAGS) $<

all: $(TARGET)

clean:
	$(LIBTOOL) --mode=clean rm -f $(STUDENT_OBJS) $(STAFF_OBJS) $(VOTE_OBJS)
	$(LIBTOOL) --mode=clean rm -f $(CFILES) $(TARGET)

cleandir distclean: clean
	rm -f Makefile

depend: $(CFILES)

install:
	@set -x; for p in $(TARGET); do $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(mrbindir); done
	@set -x; for p in $(SCRIPTS); do $(INSTALL_PROGRAM) $$p $(DESTDIR)$(mrbindir); done

student: $(STUDENT_OBJS) $(MR_LIBDEP)
	$(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(STUDENT_OBJS) $(SQL_LIBS) $(LIBS)

staff: $(STAFF_OBJS) $(MR_LIBDEP)
	$(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(STAFF_OBJS) $(SQL_LIBS) $(LIBS)

vote: $(VOTE_OBJS) $(MR_LIBDEP)
	$(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(VOTE_OBJS) $(SQL_LIBS) $(LIBS)
