#
# Get values from configure script.
#
VERSION=@VERSION@
LIBVERSION=@LIBVERSION@

#
# Enable really all warnings. This, though, gives
# a warning due to pthread.h and unistd.h.
#
# -Wredundant-decls
#
CXX      = @CXX@
CXXFLAGS = @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \
           -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
           -Wmissing-declarations -Wnested-externs

CXXINCLUDES = -I. -I../nxcomp

CC         = @CC@
CCFLAGS    = $(CXXFLAGS)
CCINCLUDES = -I. -I../nxcomp
CCDEFINES  =

LDFLAGS = @LDFLAGS@
LIBS    = @LIBS@

#
# Only if THREADS is defined.
#
# LIBS = $(LIBS) -lpthread
#

srcdir      = @srcdir@
prefix      = @prefix@
exec_prefix = @exec_prefix@
bindir      = @bindir@
man1dir     = @mandir@/man1
VPATH       = @srcdir@

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

#
# This should be autodetected.
#

MAKEDEPEND     = @MAKEDEPEND@
DEPENDINCLUDES = -I/usr/include/g++ -I/usr/include/g++-3 

.SUFFIXES: .cpp.c

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(CXXINCLUDES) $(CXXDEFINES) $<
.c.o:
	$(CC) -c $(CCFLAGS) $(CCINCLUDES) $(CCDEFINES) $<

PROGRAM = nxproxy

all: depend $(PROGRAM)

MSRC   = Main.c

CSRC   =

CXXSRC =

MOBJ   = $(MSRC:.c=.o)
COBJ   = $(CSRC:.c=.o)
CXXOBJ = $(CXXSRC:.cpp=.o)

$(PROGRAM):	$(MOBJ) $(COBJ) $(CXXOBJ)
		$(CXX) $(CXXFLAGS) -o $@ $(MOBJ) $(LDFLAGS) $(LIBS)

depends:	depend.status

depend:		depend.status

depend.status:	
		if [ -x $(MAKEDEPEND) ] ; then \
			$(MAKEDEPEND) $(CXXINCLUDES) $(CCINCLUDES) \
                        $(DEPENDINCLUDES) -f Makefile $(MSRC) $(CSRC) $(CXXSRC) 2>/dev/null; \
		fi
		touch depend.status

install:	install.bin install.man

install.bin:	$(PROGRAM)
		$(srcdir)/mkinstalldirs $(bindir)
		$(INSTALL) $(PROGRAM) $(bindir)/$(PROGRAM)

install.man:
		$(srcdir)/mkinstalldirs $(man1dir)

clean:
		-rm -f *~ *.o *.bak st?????? core core.* *.out.* \
		$(PROGRAM) $(PROGRAM).exe $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE)

distclean:	clean
		-rm -f config.status config.log config.cache depend.status Makefile tags