File: Makefile

package info (click to toggle)
prayer 1.3.5-dfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 6,576 kB
  • sloc: ansic: 43,161; makefile: 817; sh: 445; perl: 166
file content (145 lines) | stat: -rw-r--r-- 3,999 bytes parent folder | download | duplicates (3)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# $Cambridge: hermes/src/prayer/servers/Makefile,v 1.20 2012/06/30 14:30:08 dpc22 Exp $
# Prayer - a Webmail Interface
#
# Copyright (c) University of Cambridge 2000 - 2008
# See the file NOTICE for conditions of use and distribution.

ifeq ($(strip $(RPM_BUILD)), true)
include ../Config-RPM
else
include ../Config
endif

BASECFLAGS += -I../lib -I../shared -I../session

# Default list of things to build
BIN = prayer prayer-session prayer-chroot

# Enable on the fly compression
ifeq ($(strip $(GZIP_ENABLE)), true)
  BASE_LIBS  += $(Z_LIBS)
endif

# Enable LDAP
ifeq ($(strip $(LDAP_ENABLE)), true)
  BASE_LIBS  += $(LDAP_LIBS)
endif

# Enable Electric Fence
ifeq ($(strip $(FENCE_ENABLE)), true)
  BASECFLAGS += $(FENCE_INCLUDE)
  BASE_LIBS  += $(FENCE_LIBS)
endif

# Enable libtidy
ifeq ($(strip $(TIDY_ENABLE)), true)
  BASECFLAGS += $(TIDY_INCLUDE)
  BASE_LIBS  += $(TIDY_LIBS)
endif

ifeq ($(strip $(SSL_ENABLE)), true)
  ifeq ($(strip $(RAVEN_ENABLE)), true)
    RAVEN_ENABLE_DEFS     = -DRAVEN_ENABLE
  endif
  SERVER_SSL_DEFS       = -DSSL_ENABLE
  SERVER_SSL_INCLUDE    = $(SSL_INCLUDE)
  SERVER_SSL_LIBS       = $(SSL_LIBS)
  ifeq ($(strip $(SESSION_CACHE_ENABLE)), true)
    # Berkeley DB required for SSL session cache.
    SERVER_SSL_DEFS    += -DSESSION_CACHE_ENABLE
    SERVER_SSL_LIBS    += $(DB_LIBS)
  endif
  LIB=../lib/lib_withssl.a
else
  LIB=../lib/lib_nossl.a
endif

ifeq ($(strip $(ACCOUNTD_ENABLE)), true)
  ifeq ($(strip $(ACCOUNTD_USE_BSD_PTY)), true)
    BASE_LIBS += -lutil
  endif
endif

PRAYER_LIBS   = $(BASE_LIBS) $(SERVER_SSL_LIBS) -ldl
SESSION_LIBS  = $(CCLIENT_LIBS) $(BASE_LIBS) -ldl

# Add SSL if c-client needs SSL
ifeq ($(strip $(CCLIENT_SSL_ENABLE)), true)
  SESSION_LIBS += $(SSL_LIBS)
endif

# Add PAM if backend needs pam
ifeq ($(strip $(CCLIENT_PAM_ENABLE)), true)
  SESSION_LIBS += $(PAM_LIBS)
endif

# Add Kerberos if backend needs Kerberos
ifeq ($(strip $(CCLIENT_KERB_ENABLE)), true)
  SESSION_LIBS += $(KERB_LIBS)
endif

MYCFLAGS  = $(BASECFLAGS) $(SERVER_SSL_INCLUDE) $(CCLIENT_INCLUDE)
MYLDFLAGS = $(BASELDFLAGS)

TEMPLATES= ../templates/index.o \
 ../templates/old/templates.a \
 ../templates/cam/templates.a \

TEMPLATES_FRONTEND= ../templates/index.o \
 ../templates/old/templates_frontend.a \
 ../templates/cam/templates_frontend.a

PRAYER_OBJS= prayer.o prayer_login.o prayer_server.o portlist.o \
  ../shared/shared.a $(LIB)

SESSION_OBJS= \
   session_config.o session_exchange.o session_unix.o session_server.o \
   session_main.o portlist.o ../cmd/cmd.a ../session/session.a \
   ../shared/shared.a ../lib/lib_nossl.a

#########################################################################

all:	$(BIN)

clean:
	-rm -f $(BIN) core *.o *.flc *~ \#*\#

install: all
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_DIR) -d \
	  $(BROOT)$(BIN_DIR)
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_EXEC) \
	  prayer           $(BROOT)$(BIN_DIR)
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_EXEC) \
	  prayer-chroot           $(BROOT)$(BIN_DIR)
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_EXEC) \
	  prayer-session   $(BROOT)$(BIN_DIR)

prayer: $(PRAYER_OBJS) prayer_main.o
	$(CC) $(MYLDFLAGS) -o prayer prayer_main.o $(PRAYER_OBJS) $(PRAYER_LIBS)

prayer-chroot: $(PRAYER_OBJS) prayer_chroot.o
	$(CC) $(MYLDFLAGS) -o prayer-chroot prayer_chroot.o $(PRAYER_OBJS) $(PRAYER_LIBS)

prayer-session: $(SESSION_OBJS)
	$(CC) $(MYLDFLAGS) -o prayer-session \
		$(SESSION_OBJS) $(SESSION_LIBS)

prayer_login.o: prayer_login.c *.h Makefile
	$(CC) $(MYCFLAGS) -c $(RAVEN_ENABLE_DEFS) $<

prayer_main.o: prayer_main.c *.h Makefile
	$(CC) $(MYCFLAGS) -c \
	  -DPRAYER_CONFIG_FILE=\"$(PRAYER_CONFIG_FILE)\" $<

prayer_chroot.o: prayer_chroot.c *.h Makefile
	$(CC) $(MYCFLAGS) -c \
	  -DPRAYER_CONFIG_FILE=\"$(PRAYER_CONFIG_FILE)\" $<

session_main.o: session_main.c *.h Makefile
	$(CC) $(MYCFLAGS) -c \
	  -DPRAYER_CONFIG_FILE=\"$(PRAYER_CONFIG_FILE)\" $<

# Default build rule
%.o: %.c *.h Makefile
	$(CC) $(MYCFLAGS) -c $<