summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 0154b720ba0ab356e5aaf35ab1a926f089678ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
CC=gcc
CFLAGS=-g -Wall
#CFLAGS=-O2 -Wall
RANLIB=ranlib

INCLUDES=-I. -Ilibvncauth -Iinclude -Iinclude/X11 -Iinclude/Xserver
VNCAUTHLIB=-Llibvncauth -lvncauth
VNCSERVERLIB=-L. -lvncserver -lz -ljpeg

# These two lines enable useage of PThreads
#CFLAGS += -DHAVE_PTHREADS
#VNCSERVERLIB += -lpthread

LIBS=$(LDFLAGS) $(VNCSERVERLIB) $(VNCAUTHLIB)

# for Mac OS X
OSX_LIBS = -framework ApplicationServices -framework Carbon

# for Example

SOURCES=main.c rfbserver.c miregion.c auth.c sockets.c xalloc.c \
	stats.c corre.c hextile.c rre.c translate.c cutpaste.c \
	zlib.c tight.c httpd.c
OBJS=main.o rfbserver.o miregion.o auth.o sockets.o xalloc.o \
	stats.o corre.o hextile.o rre.o translate.o cutpaste.o \
	zlib.o tight.o httpd.o

all: example pnmshow storepasswd

install_OSX: OSXvnc-server
	cp OSXvnc-server storepasswd ../OSXvnc/build/OSXvnc.app/Contents/MacOS

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

libvncserver.a: $(OBJS)
	$(AR) cru $@ $(OBJS)
	$(RANLIB) $@

example: example.o libvncauth/libvncauth.a libvncserver.a
	$(CC) -o example example.o $(LIBS)

pnmshow: pnmshow.o libvncauth/libvncauth.a libvncserver.a
	$(CC) -o pnmshow pnmshow.o $(LIBS)

OSXvnc-server: mac.o libvncauth/libvncauth.a libvncserver.a
	$(CC) -o OSXvnc-server mac.o $(LIBS) $(OSX_LIBS)

storepasswd: storepasswd.o libvncauth/libvncauth.a
	$(CC) -o storepasswd storepasswd.o $(VNCAUTHLIB)

libvncauth/libvncauth.a:
	(cd libvncauth; make)

clean:
	rm -f $(OBJS) *~ core "#"* *.bak *.orig storepasswd.o *.a example.o \
		libvncauth/*.o libvncauth/*~ libvncauth/*.a

realclean: clean
	rm -f OSXvnc-server storepasswd

depend:
	$(CC) -M $(INCLUDES) $(SOURCES) >.depend

#include .depend