summaryrefslogtreecommitdiffstats
path: root/sesman/Makefile
blob: 8a8915c2dd7606218e1ccb88fb598fe37cd96df4 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# sesman makefile
LIBSCPOBJ = libscp_vX.o libscp_v0.o libscp_v1s.o

SESMANOBJ = sesman.o config.o sig.o session.o env.o \
            os_calls.o d3des.o list.o file.o log.o access.o \
            scp.o scp_v0.o scp_v1.o thread.o lock.o

SESSVCOBJ = sessvc.o os_calls.o

DESTDIR = /usr/local/xrdp
CFGDIR = /etc/xrdp
PIDDIR = /var/run
MANDIR = /usr/local/man
DOCDIR = /usr/doc/xrdp

DEFINES = -DSESMAN_CFG_FILE=\"$(CFGDIR)/sesman.ini\" \
          -DSESMAN_PID_FILE=\"$(PIDDIR)/sesman.pid\" \
          -DSESMAN_SESSVC_FILE=\"$(DESTDIR)/sessvc\" \
	  -DDEBUG

CFLAGS = -Wall -O2 -I../common -I/usr/include/nptl -I./libscp $(DEFINES)
LDFLAGS = -L /usr/gnu/lib -I/usr/include/nptl -L/usr/lib/nptl -lpthread -ldl -Wl,-rpath,./libscp -L./libscp -lscp $(DEFINES)
C_OS_FLAGS = $(CFLAGS) -c
CC = gcc

all: libscp pam tools

nopam: libscp no-pam tools

kerberos: libscp kerberos-base tools

no-pam: $(SESMANOBJ) verify_user.o
	make -C libscp
	$(CC) $(LDFLAGS) -o sesman $(SESMANOBJ) verify_user.o -lcrypt

pam: $(SESMANOBJ) verify_user_pam.o
	$(CC) $(LDFLAGS) -o sesman $(SESMANOBJ) verify_user_pam.o -lpam

pam_userpass: $(SESMANOBJ) verify_user_pam_userpass.o
	$(CC) $(LDFLAGS) -o sesman $(SESMANOBJ) verify_user_pam_userpass.o -lpam -lpam_userpass

kerberos-base: $(SESMANOBJ) verify_user_kerberos.o
	$(CC) $(LDFLAGS) -o sesman $(SESMANOBJ) verify_user_kerberos.o -lkrb5

sessvc: $(SESSVCOBJ)
	$(CC) $(LDFLAGS) -o sessvc $(SESSVCOBJ) 

tools: sessvc
	make -C tools

libscp:
	make -C libscp

clean:
	rm -f $(SESMANOBJ) verify_user.o verify_user_pam.o verify_user_pam_userpass.o sesman sesrun.o sesrun sessvc.o sessvc
	make -C tools clean
	make -C libscp clean

install:
	install sesman $(DESTDIR)/sesman
	install startwm.sh $(DESTDIR)/startwm.sh
	install sesman.ini $(CFGDIR)/sesman.ini
	install sessvc $(DESTDIR)/sessvc
	make -C tools install
	make -C libscp install

installdeb:
	install sesman $(DESTDIRDEB)/usr/lib/xrdp/sesman
	install startwm.sh $(DESTDIRDEB)/usr/lib/xrdp/startwm.sh
	install sesman.ini $(DESTDIRDEB)/etc/xrdp/sesman.ini

os_calls.o: ../common/os_calls.c
	$(CC) $(C_OS_FLAGS) ../common/os_calls.c

d3des.o: ../common/d3des.c
	$(CC) $(C_OS_FLAGS) ../common/d3des.c

list.o: ../common/list.c
	$(CC) $(C_OS_FLAGS) ../common/list.c

file.o: ../common/file.c
	$(CC) $(C_OS_FLAGS) ../common/file.c

log.o: ../common/log.c
	$(CC) $(C_OS_FLAGS) -DLOG_ENABLE_THREAD ../common/log.c