# $Id: Makefile.in 3956 2010-01-05 20:56:56Z zacheiss $

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@
mrlibdir=@mrlibdir@
libdir=@mrlibdir@


SERVER_OBJS=	mr_main.lo mr_sauth.lo mr_scall.lo mr_shutdown.lo mr_util.lo \
		qvalidate.lo qaccess.lo qsetup.lo qsupport.lo qfollow.lo \
		queries2.lo qrtn.lo qsubs.lo increment.lo 
SCHEMA_OBJS=	../db/moira_schema.lo
START_OBJS=	startmoira.lo

CFILES=		qvalidate.c qaccess.c qsetup.c qsupport.c qfollow.c \
		qrtn.c increment.c

TARGET=moirad startmoira

.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 $(SERVER_OBJS) $(START_OBJS) $(CFILES) $(TARGET)

cleandir distclean: clean
	rm -f Makefile

depend: $(CFILES)

install:
	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) moirad $(DESTDIR)$(mrbindir)
	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) startmoira $(DESTDIR)$(mrbindir)

moirad: $(SERVER_OBJS) $(SCHEMA_OBJS) $(MR_LIBDEP)
	$(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(SERVER_OBJS) $(SCHEMA_OBJS) $(SQL_LIBS) $(LIBS)

startmoira: $(START_OBJS)
	$(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(START_OBJS) $(LIBS)
