Makefile_server.in 2.59 KB
Newer Older
1
2
3
4
# Makefile.in for Load Balancer
# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
5
## Copyright 1998-2021 The OpenLDAP Foundation.
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
##
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.

PROGRAMS = lloadd
XPROGRAMS = slloadd

XSRCS	= version.c

21
22
NT_SRCS = ../slapd/nt_svc.c
NT_OBJS = ../slapd/nt_svc.o ../../libraries/liblutil/slapdmsg.res
23

Ondřej Kuzník's avatar
Ondřej Kuzník committed
24
SRCS	+= main.c value.c \
25
		  ../slapd/ch_malloc.c ../slapd/proxyp.c ../slapd/sl_malloc.c ../slapd/user.c
26
27
28
29
30
31

OBJS	= $(patsubst %.c,%.o,$(SRCS)) $(@PLAT@_OBJS)

BUILD_OPT = "--enable-balancer"
BUILD_SRV = @BUILD_BALANCER@

32
all-local-srv: 	$(PROGRAMS) all-cffiles
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

# $(LTHREAD_LIBS) must be last!
XLIBS = $(LLOADD_L)
XXLIBS = $(LLOADD_LIBS) $(SECURITY_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS)

NT_DEPENDS = slapd.exp
NT_OBJECTS = slapd.exp symdummy.o $(LLOADD_OBJS) version.o

UNIX_DEPENDS = version.o $(LLOADD_L)
UNIX_OBJECTS = $(OBJS) version.o

LLOADD_DEPENDS = $(@PLAT@_DEPENDS)
LLOADD_OBJECTS = $(@PLAT@_OBJECTS)


lloadd:	$(LLOADD_DEPENDS) version.o
	$(LTLINK) -o $@ $(OBJS) version.o $(LIBS)

slloadd:	version.o
	$(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS)

version.c: Makefile
	@-$(RM) $@
	$(MKVERSION) -s -n Versionstr lloadd > $@

version.o: version.c $(OBJS) $(LLOADD_L)

61
62
63
64
65
66
67
68
69
70
71
72
73
all-cffiles:
	@if test -n "$(systemdsystemunitdir)"; then \
		$(SED) -e "s;%LIBEXECDIR%;$(libexecdir);" \
			$(srcdir)/lloadd.service > lloadd.service.tmp ; \
	fi
	touch all-cffiles

clean-local-srv: FORCE
	$(RM) *.tmp all-cffiles

install-local-srv: install-lloadd install-conf

install-lloadd: FORCE
74
75
76
77
	-$(MKDIR) $(DESTDIR)$(libexecdir)
	@-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-lloadd
	@(								\
	    for prg in $(PROGRAMS); do					\
78
		$(LTINSTALL) $(INSTALLFLAGS) $(STRIP_OPTS) -m 755 $$prg$(EXEEXT)	\
79
80
81
		    $(DESTDIR)$(libexecdir);				\
	    done							\
	)
82
83
84
85
86
87
88
89
90

install-conf: FORCE
	@-$(MKDIR) $(DESTDIR)$(sysconfdir)
	if test -n "$(systemdsystemunitdir)" && test ! -f $(DESTDIR)$(systemdsystemunitdir)/lloadd.service; then \
		$(MKDIR) $(DESTDIR)$(systemdsystemunitdir); \
		echo "installing lloadd.service in $(systemdsystemunitdir)"; \
		echo "$(INSTALL) $(INSTALLFLAGS) -m 644 lloadd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/lloadd.service"; \
		$(INSTALL) $(INSTALLFLAGS) -m 644 lloadd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/lloadd.service; \
	fi