File: Makefile

package info (click to toggle)
prayer 1.3.5-dfsg1-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,596 kB
  • sloc: ansic: 43,163; makefile: 817; sh: 445; perl: 166
file content (105 lines) | stat: -rw-r--r-- 2,873 bytes parent folder | download | duplicates (6)
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
# $Cambridge: hermes/src/prayer/utils/Makefile,v 1.9 2009/03/19 17:30:03 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-ssl-prune prayer-cyclog prayer-sem-prune

# Enable SYSV mutex
ifeq ($(strip $(MUTEX_SEMAPHORE)), true)
  MUTEX_DEF = -DMUTEX_SEMAPHORE
endif

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

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

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

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

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

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

PRUNE_OBJS = ssl_prune_main.o ../shared/shared.a
PRUNE_LIBS = $(BASE_LIBS)

ifeq ($(strip $(SSL_ENABLE)), true)
  PRUNE_OBJS += ../lib/lib_withssl.a
  PRUNE_LIBS += $(SSL_LIBS)
  ifeq ($(strip $(SESSION_CACHE_ENABLE)), true)
    # Berkeley DB required for SSL session cache.
    PRUNE_LIBS  += $(DB_LIBS)
  endif
else
  PRUNE_OBJS += ../lib/lib_nossl.a
endif

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

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-ssl-prune $(BROOT)$(BIN_DIR)
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_EXEC) \
	  prayer-sem-prune $(BROOT)$(BIN_DIR)
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_EXEC) \
	  prayer-db-prune $(BROOT)$(BIN_DIR)
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_EXEC) \
	  prayer-cyclog    $(BROOT)$(BIN_DIR)

prayer-ssl-prune: $(PRUNE_OBJS)
	$(CC) $(MYLDFLAGS) -o prayer-ssl-prune $(PRUNE_OBJS) $(PRUNE_LIBS)

prayer-cyclog: prayer-cyclog.SRC
	perl -pe "s&__PREFIX__&${PREFIX}&; s&__VAR_PREFIX__&${VAR_PREFIX}&; s&__BIN_DIR__&${BIN_DIR}&;" < prayer-cyclog.SRC > prayer-cyclog

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

prayer-sem-prune: prayer-sem-prune.o
	$(CC) $(MYLDFLAGS) -o prayer-sem-prune prayer-sem-prune.o

prayer-sem-prune.o: prayer-sem-prune.c
	$(CC) $(MYCFLAGS) $(MUTEX_DEF) -c $<

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