Home | History | Annotate | Line # | Download | only in samba4
      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_RDNVAL=SLAPD_MOD_DYNAMIC \
     30 	-DSLAPD_OVER_PGUID=SLAPD_MOD_DYNAMIC \
     31 	-DSLAPD_OVER_VERNUM=SLAPD_MOD_DYNAMIC
     32 INCS = $(LDAP_INC)
     33 LIBS = $($(PLAT)_LIB) $(LDAP_LIB)
     34 LD_FLAGS = $(LDFLAGS) $($(PLAT)_LDFLAGS) -rpath $(moduledir) -module
     35 
     36 PROGRAMS = pguid.la rdnval.la vernum.la
     37 LTVER = 0:0:0
     38 
     39 prefix=/usr/local
     40 exec_prefix=$(prefix)
     41 ldap_subdir=/openldap
     42 
     43 libdir=$(exec_prefix)/lib
     44 libexecdir=$(exec_prefix)/libexec
     45 moduledir = $(libexecdir)$(ldap_subdir)
     46 
     47 .SUFFIXES: .c .o .lo
     48 
     49 .c.lo:
     50 	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $<
     51 
     52 all: $(PROGRAMS)
     53 
     54 pguid.la: pguid.lo
     55 	$(LIBTOOL) --mode=link $(CC) $(LD_FLAGS) -o $@ $? $(LIBS)
     56 
     57 rdnval.la: rdnval.lo
     58 	$(LIBTOOL) --mode=link $(CC) $(LD_FLAGS) -o $@ $? $(LIBS)
     59 
     60 vernum.la: vernum.lo
     61 	$(LIBTOOL) --mode=link $(CC) $(LD_FLAGS) -o $@ $? $(LIBS)
     62 
     63 clean:
     64 	rm -rf *.o *.lo *.la .libs
     65 
     66 install: $(PROGRAMS)
     67 	mkdir -p $(DESTDIR)$(moduledir)
     68 	for p in $(PROGRAMS) ; do \
     69 		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
     70 	done
     71 
     72