Home | History | Annotate | Line # | Download | only in lloadd
      1 # Makefile.in for standalone Load Balancer
      2 # $OpenLDAP$
      3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
      4 ##
      5 ## Copyright 1998-2024 The OpenLDAP Foundation.
      6 ## All rights reserved.
      7 ##
      8 ## Redistribution and use in source and binary forms, with or without
      9 ## modification, are permitted only as authorized by the OpenLDAP
     10 ## Public License.
     11 ##
     12 ## A copy of this license is available in the file LICENSE in the
     13 ## top-level directory of the distribution or, alternatively, at
     14 ## <http://www.OpenLDAP.org/license.html>.
     15 
     16 PROGRAMS = lloadd
     17 XPROGRAMS = slloadd
     18 
     19 NT_SRCS = ../slapd/nt_svc.c
     20 NT_OBJS = ../slapd/nt_svc.o ../../libraries/liblutil/slapdmsg.res
     21 
     22 SRCS	+= main.c value.c \
     23 		  ../slapd/ch_malloc.c ../slapd/logging.c ../slapd/proxyp.c \
     24 		  ../slapd/sl_malloc.c ../slapd/user.c ../slapd/verbs.c
     25 
     26 OBJS	+= main.o value.o \
     27 		  ../slapd/ch_malloc.o ../slapd/logging.o ../slapd/proxyp.o \
     28 		  ../slapd/sl_malloc.o ../slapd/user.o ../slapd/verbs.o \
     29 		  $(@PLAT@_OBJS)
     30 
     31 BUILD_OPT = "--enable-balancer"
     32 BUILD_SRV = @BUILD_BALANCER@
     33 
     34 all-local-srv: 	$(PROGRAMS) all-cffiles
     35 
     36 lloadd:	$(LLOADD_DEPENDS) version.o
     37 	$(LTLINK) -o $@ $(OBJS) version.o $(LIBS)
     38 
     39 slloadd:	version.o
     40 	$(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS)
     41 
     42 version.c: Makefile
     43 	@-$(RM) $@
     44 	$(MKVERSION) -s -n Versionstr lloadd > $@
     45 
     46 version.o: version.c $(OBJS) $(LLOADD_L)
     47 
     48 all-cffiles:
     49 	@if test -n "$(systemdsystemunitdir)"; then \
     50 		$(SED) -e "s;%LIBEXECDIR%;$(libexecdir);" \
     51 			$(srcdir)/lloadd.service > lloadd.service.tmp ; \
     52 	fi
     53 	touch all-cffiles
     54 
     55 clean-local-srv: FORCE
     56 	$(RM) *.tmp all-cffiles
     57 
     58 install-local-srv: install-lloadd install-conf
     59 
     60 install-lloadd: FORCE
     61 	-$(MKDIR) $(DESTDIR)$(libexecdir)
     62 	@-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-lloadd
     63 	@(								\
     64 	    for prg in $(PROGRAMS); do					\
     65 		$(LTINSTALL) $(INSTALLFLAGS) $(STRIP_OPTS) -m 755 $$prg$(EXEEXT)	\
     66 		    $(DESTDIR)$(libexecdir);				\
     67 	    done							\
     68 	)
     69 
     70 install-conf: FORCE
     71 	@-$(MKDIR) $(DESTDIR)$(sysconfdir)
     72 	if test -n "$(systemdsystemunitdir)" && test ! -f $(DESTDIR)$(systemdsystemunitdir)/lloadd.service; then \
     73 		$(MKDIR) $(DESTDIR)$(systemdsystemunitdir); \
     74 		echo "installing lloadd.service in $(systemdsystemunitdir)"; \
     75 		echo "$(INSTALL) $(INSTALLFLAGS) -m 644 lloadd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/lloadd.service"; \
     76 		$(INSTALL) $(INSTALLFLAGS) -m 644 lloadd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/lloadd.service; \
     77 	fi
     78