Home | History | Annotate | Line # | Download | only in dupent
      1 # $OpenLDAP$
      2 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
      3 #
      4 # Copyright 1998-2024 The OpenLDAP Foundation.
      5 # Copyright 2004 Howard Chu, Symas Corp. All Rights Reserved.
      6 #
      7 # Redistribution and use in source and binary forms, with or without
      8 # modification, are permitted only as authorized by the OpenLDAP
      9 # Public License.
     10 #
     11 # A copy of this license is available in the file LICENSE in the
     12 # top-level directory of the distribution or, alternatively, at
     13 # <http://www.OpenLDAP.org/license.html>.
     14 
     15 LDAP_SRC = ../../..
     16 LDAP_BUILD = $(LDAP_SRC)
     17 LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
     18 LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \
     19 	$(LDAP_BUILD)/libraries/liblber/liblber.la
     20 
     21 PLAT = UNIX
     22 NT_LIB = -L$(LDAP_BUILD)/servers/slapd -lslapd
     23 NT_LDFLAGS = -no-undefined -avoid-version
     24 UNIX_LDFLAGS = -version-info $(LTVER)
     25 
     26 LIBTOOL = $(LDAP_BUILD)/libtool
     27 CC = gcc
     28 OPT = -g -O2
     29 DEFS = -DSLAPD_OVER_DUPENT=SLAPD_MOD_DYNAMIC
     30 INCS = $(LDAP_INC)
     31 LIBS = $($(PLAT)_LIB) $(LDAP_LIB)
     32 LD_FLAGS = $(LDFLAGS) $($(PLAT)_LDFLAGS) -rpath $(moduledir) -module
     33 
     34 PROGRAMS = dupent.la
     35 LTVER = 0:0:0
     36 
     37 prefix=/usr/local
     38 exec_prefix=$(prefix)
     39 ldap_subdir=/openldap
     40 
     41 libdir=$(exec_prefix)/lib
     42 libexecdir=$(exec_prefix)/libexec
     43 moduledir = $(libexecdir)$(ldap_subdir)
     44 
     45 .SUFFIXES: .c .o .lo
     46 
     47 .c.lo:
     48 	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $<
     49 
     50 all: $(PROGRAMS)
     51 
     52 dupent.la: dupent.lo
     53 	$(LIBTOOL) --mode=link $(CC) $(LD_FLAGS) -o $@ $? $(LIBS)
     54 
     55 clean:
     56 	rm -rf *.o *.lo *.la .libs
     57 
     58 install: $(PROGRAMS)
     59 	mkdir -p $(DESTDIR)$(moduledir)
     60 	for p in $(PROGRAMS) ; do \
     61 		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
     62 	done
     63 
     64