1
############################################################################
3
# Copyright (c) 2001, 2005 NoMachine, http://www.nomachine.com. #
5
# NXCOMP, NX protocol compression and NX extensions to this software #
6
# are copyright of NoMachine. Redistribution and use of the present #
7
# software is allowed according to terms specified in the file LICENSE #
8
# which comes in the source distribution. #
10
# Check http://www.nomachine.com/licensing.html for applicability. #
12
# NX and NoMachine are trademarks of Medialogic S.p.A. #
14
# All rights reserved. #
16
############################################################################
19
# Get values from configure script.
23
LIBVERSION=@LIBVERSION@
26
# We would really like to enable all warnings, -Wredundant-decls,
27
# though, gives a warning caused by pthread.h and unistd.h and
28
# GCC 3.4 was changed in a way that it now complains about some
29
# of the -W directives we used before (-Wmissing-declarations,
30
# -Wnested-externs, -Wstrict-prototypes and -Wmissing-prototypes).
34
CXXFLAGS = @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \
40
# C programs don't share the C++ flags. They should
41
# have their own @CCFLAGS@.
45
CCFLAGS = @X_CFLAGS@ @DEFS@ \
51
LIBS = @LIBS@ -L/usr/X11R6/lib -lX11
54
# Only if THREADS is defined.
56
# LIBS = $(LIBS) -lpthread
60
# Only if you want ElectricFence.
62
# LIBS = $(LIBS) -lefence
66
# Only if you want mpatrol.
68
# LIBS = $(LIBS) -lmpatrol -lbfd -liberty
73
exec_prefix = @exec_prefix@
75
man1dir = @mandir@/man1
79
INSTALL_PROGRAM = @INSTALL_PROGRAM@
80
INSTALL_DATA = @INSTALL_DATA@
83
# This should be autodetected.
86
MAKEDEPEND = @MAKEDEPEND@
87
DEPENDINCLUDES = -I/usr/include/g++ -I/usr/include/g++-3
92
$(CXX) -c $(CXXFLAGS) $(CXXINCLUDES) $(CXXDEFINES) $<
94
$(CC) -c $(CCFLAGS) $(CCINCLUDES) $(CCDEFINES) $<
98
LIBNAME = lib$(LIBRARY)
99
LIBFULL = lib$(LIBRARY).so.$(VERSION)
100
LIBLOAD = lib$(LIBRARY).so.$(LIBVERSION)
101
LIBSHARED = lib$(LIBRARY).so
102
LIBARCHIVE = lib$(LIBRARY).a
117
MOBJ = $(MSRC:.c.cpp=.o)
119
CXXOBJ = $(CXXSRC:.cpp=.o)
121
MLIBS = -L. -lXShadow
123
ifeq ($(findstring -lgdi32,$(LIBS)),-lgdi32)
125
# We need a smarter way to detect windows
128
LIBDLL = cyg$(LIBRARY).dll
129
LIBDLLSTATIC = lib${LIBRARY}.dll.a
131
all: depend $(LIBARCHIVE) $(LIBDLL)
135
EXTRALIBS = -lXtst -lXrandr -lXdamage
137
all: depend $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE)
141
$(LIBFULL): $(CXXOBJ) $(COBJ)
142
$(CXX) -o $@ $(LDFLAGS) $(CXXOBJ) $(COBJ) $(LIBS) $(EXTRALIBS)
144
$(LIBLOAD): $(LIBFULL)
146
ln -s $(LIBFULL) $(LIBLOAD)
148
$(LIBSHARED): $(LIBFULL)
150
ln -s $(LIBFULL) $(LIBSHARED)
152
$(LIBARCHIVE): $(CXXOBJ) $(COBJ)
154
ar clq $(LIBARCHIVE) $(CXXOBJ) $(COBJ)
157
$(LIBDLL): $(LIBARCHIVE)
160
-Wl,--out-implib=$(LIBDLLSTATIC) \
161
-Wl,--export-all-symbols \
162
-Wl,--enable-auto-import \
163
-Wl,--whole-archive ${LIBARCHIVE} \
164
-Wl,--no-whole-archive \
165
${LIBS} -L/usr/X11R6/lib
167
$(PROGRAM): $(MOBJ) $(COBJ) $(CXXOBJ) $(LIBDLL)
168
# $(CC) $(CCFLAGS) -o $@ $(MOBJ) $(MLIBS)
170
depends: depend.status
172
depend: depend.status
175
if [ -x $(MAKEDEPEND) ] ; then \
176
$(MAKEDEPEND) $(CXXINCLUDES) $(CCINCLUDES) \
177
$(DEPENDINCLUDES) -f Makefile $(MSRC) $(CSRC) $(CXXSRC) 2>/dev/null; \
181
install: install.bin install.man
188
-rm -f *~ *.o *.bak st?????? core core.* *.out.* *.exe.stackdump \
189
$(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe
192
-rm -rf config.status config.log config.cache depend.status Makefile tags autom4te.cache