/**************************************************************************/
/*                                                                        */
/* Copyright (c) 2001,2005 NoMachine, http://www.nomachine.com.           */
/*                                                                        */
/* NXVIEWER, NX protocol compression and NX extensions to this software   */
/* are copyright of NoMachine. Redistribution and use of the present      */
/* software is allowed according to terms specified in the file LICENSE   */
/* which comes in the source distribution.                                */
/*                                                                        */
/* Check http://www.nomachine.com/licensing.html for applicability.       */
/*                                                                        */
/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
/*                                                                        */
/* All rights reserved.                                                   */
/*                                                                        */
/**************************************************************************/

#ifdef SunArchitecture
EXTRA_DEFINES = -D__EXTENSIONS__
#endif

XCOMM Shared memory support works OK on x86 linux, not tested elsewhere but
XCOMM seems to cause problems on Digital Unix.

#if defined(i386Architecture) && defined(LinuxArchitecture)
DEFINES = -DMITSHM
#endif

NX_INC = -I../../nxcomp -I../../nxcompext -I../../nx-X11/exports/include
NX_LIB = -L../../nxcomp -lXcomp -L../../nxcompext -lXcompext

#ifdef SunArchitecture
NX_INC += -I/usr/sfw/include -I/usr/include
NX_LIB += ../../nx-X11/exports/lib/libXpm.a -L../../nx-X11/exports/lib
ZLIB_INC = -I/usr/local/include
JPEG_INC = -I/usr/local/include
#endif


INCLUDES = -I../include -I. $(ZLIB_INC) $(JPEG_INC) -I/usr/include/X11 $(NX_INC)
VNCAUTH_LIB = ./libvncauth.a
ZLIB_LIB = -L/usr/local/lib -lz
JPEG_LIB = -L/usr/local/lib -ljpeg

USRLIBDIR = ../../nx-X11/exports/lib

#ifdef SunArchitecture
USRLIBDIR = /usr/NX/lib
SUN_LIB = -lX11 -lXext -L/usr/openwin/lib
JPEG_LIB = ../../jpeg-6b/.libs/libjpeg.a
#endif

DEPLIBS = XawClientDepLibs $(VNCAUTH_LIB)

LOCAL_LIBRARIES =  XawClientLibs $(VNCAUTH_LIB) $(ZLIB_LIB) $(JPEG_LIB) $(NX_LIB)

#ifdef SunArchitecture
LOCAL_LIBRARIES = $(NX_LIB) $(SUN_LIB) XawClientLibs $(VNCAUTH_LIB) $(ZLIB_LIB) $(JPEG_LIB)
#endif

AUTH_SRCS = \
  vncauth.c \
  d3des.c

AUTH_OBJS = $(AUTH_SRCS:.c=.o)

NormalLibraryTarget(vncauth,$(AUTH_OBJS))

DependTarget()

SRCS = \
  argsresources.c \
  colour.c \
  cursor.c \
  desktop.c \
  dialogs.c \
  fullscreen.c \
  listen.c \
  misc.c \
  popup.c \
  rfbproto.c \
  selection.c \
  shm.c \
  sockets.c \
  tunnel.c \
  vncviewer.c

OBJS = $(SRCS:.c=.o)

ComplexProgramTarget(nxviewer)
