
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
pixdir = ${libdir}/pix
includedir = @includedir@
mandir = @mandir@/man1
srcdir = @srcdir@
VPATH = @srcdir@

top_builddir = ..

PURELINK =
PURIFY =

# Libraries needed to link with Tcl & (optionally) Tk
TCLTK_LIBS = @TCLTKLIBS@
# Include directives needed to compile with Tcl & Tk, and
# -DTCL if Tcl is available, and
# -DTK if Tk is available.
TCLTK_FLAGS = @TCLTKFLAGS@

# Libraries needed to link with GNU readline
RLLIBS = @RLLIBS@
# Include directives needed to compile with GNU readline, and
# -DREADLINE_2_0 if GNU readline 2.0 is available, or 
# -DREADLINE_2_1 if GNU readline 2.1 (or later) is available.
RLDEFS = @RLDEFS@

PERL5 = @PERL5@

CC = @CC@
CXX = @CXX@
CDEFS = -DLIBDIR=\"$(libdir)\" 
# -DDEBUG
CFLAGS = -I../include -I$(srcdir)/include @CFLAGS@ @CWFLAG@ $(RLDEFS) $(CDEFS) $(TCLTK_FLAGS)
CXXFLAGS = -I../include -I$(srcdir)/include @CXXFLAGS@ @CWFLAG@ $(RLDEFS) $(CDEFS) $(TCLTK_FLAGS)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
# -lefence
CXXLIBS = @CXXLIBS@

libcclib = @libcclib@
cclib = @cclib@

INSTALL = $(LIBTOOL) @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
YACC = @YACC@
RANLIB = @RANLIB@
RM = rm -f
STRIP = strip
SHELL = /bin/sh
CPLIB = @CPLIB@
EXT = @EXT@
SUBMAKE_COMM = @SUBMAKE_COMM@
SUBMAKE_COMM_CC = @SUBMAKE_COMM_CC@

LIBTOOL = @LIBTOOL@
LIBTOOLLINK = $(LIBTOOL) --mode=link

CCLINK = $(LIBTOOLLINK)  $(PURELINK) $(PURIFY) $(CC) $(LDFLAGS) $(CFLAGS)
CXXLINK = $(LIBTOOLLINK) $(PURELINK) $(PURIFY) $(CXX) $(LDFLAGS) $(CXXFLAGS)

.SUFFIXES: .out .o .cc .c .e .r .f .y .l .s .p

.c.o:
	$(CC) $(CFLAGS) -c $<

.cc.o:
	$(CXX) $(CXXFLAGS) -c $<


WITHTCL = $(TCLEXECS)
WITHCXX = $(CXXEXECS)
WITHPERL5 = $(PERLEXECS)

CEXECS = sync-memodir$(EXT) sync-ical$(EXT) \
		test-connector$(EXT) test-acceptor$(EXT)

EXECS = $(CEXECS) $(@WITHTCL@) $(@WITHCXX@) $(@WITHPERL5@)

PILIB = ../libsock/libpisock.la

all: $(EXECS)

$(PILIB): FORCE
	$(SUBMAKE_COMM) libpisock.la

sync-memodir$(EXT): $(PILIB) sync-memodir.o
	$(CCLINK) sync-memodir.o $(PILIB) -o $@ $(LIBS)

sync-ical$(EXT): $(PILIB) sync-ical.o
	$(CCLINK) sync-ical.o $(PILIB) -o $@ $(LIBS)

test-connector$(EXT): $(PILIB) test-connector.o
	$(CCLINK) test-connector.o $(PILIB) -o $@ $(LIBS)

test-acceptor$(EXT): $(PILIB) test-acceptor.o
	$(CCLINK) test-acceptor.o $(PILIB) -o $@ $(LIBS)


FORCE:

depend:
	perl -i~ -ne 'print if 1../^#Depend/' Makefile.in ; gcc -MM -I../include *.c >> Makefile.in

distclean: clean
	$(RM) Makefile *~

clean:
	$(RM) *.o *.a *.lo *.la core a.out
	$(RM) -rf .libs _libs
	$(RM) $(CEXECS) $(TCLEXECS) $(CXXEXECS) $(PERLEXECS) validate 

#Depend information starts here. Do not edit the text beyond this point!
sync-ical.o: sync-ical.c ../include/pi-source.h ../include/pi-config.h \
 ../include/pi-socket.h ../include/pi-args.h ../include/pi-macros.h \
 ../include/pi-sync.h ../include/pi-datebook.h ../include/pi-appinfo.h \
 ../include/pi-todo.h ../include/pi-dlp.h
sync-memodir.o: sync-memodir.c ../include/pi-source.h \
 ../include/pi-config.h ../include/pi-socket.h ../include/pi-args.h \
 ../include/pi-macros.h ../include/pi-datebook.h \
 ../include/pi-appinfo.h ../include/pi-todo.h ../include/pi-dlp.h \
 ../include/pi-sync.h
test-acceptor.o: test-acceptor.c ../include/pi-source.h \
 ../include/pi-config.h ../include/pi-socket.h ../include/pi-args.h \
 ../include/pi-macros.h ../include/pi-dlp.h
test-connector.o: test-connector.c ../include/pi-source.h \
 ../include/pi-config.h ../include/pi-socket.h ../include/pi-args.h \
 ../include/pi-macros.h ../include/pi-dlp.h
