01ef3fd93cf784281d777dbd66cbd26366e56c73
[nivanova/openldap.git] / contrib / slapd-modules / samba4 / Makefile
1 # $OpenLDAP$
2 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
3 #
4 # Copyright 1998-2014 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 = ../../..
17 LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
18 LDAP_LIB = $(LDAP_BUILD)/libraries/libldap_r/libldap_r.la \
19         $(LDAP_BUILD)/libraries/liblber/liblber.la
20
21 LIBTOOL = $(LDAP_BUILD)/libtool
22 CC = gcc
23 OPT = -g -O2 -Wall
24 DEFS = -DSLAPD_OVER_RDNVAL=SLAPD_MOD_DYNAMIC \
25         -DSLAPD_OVER_PGUID=SLAPD_MOD_DYNAMIC \
26         -DSLAPD_OVER_VERNUM=SLAPD_MOD_DYNAMIC \
27         -DSLAPD_OVER_INSTANCETYPE=SLAPD_MOD_DYNAMIC \
28         -DSLAPD_OVER_SYNTAXCHECKS=SLAPD_MOD_DYNAMIC
29
30 INCS = $(LDAP_INC)
31 LIBS = $(LDAP_LIB)
32
33 PROGRAMS = pguid.la rdnval.la vernum.la instancetype.la syntax_checks.la
34 LTVER = 0:0:0
35
36 prefix=/usr/local
37 exec_prefix=$(prefix)
38 ldap_subdir=/openldap
39
40 libdir=$(exec_prefix)/lib
41 libexecdir=$(exec_prefix)/libexec
42 moduledir = $(libexecdir)$(ldap_subdir)
43
44 .SUFFIXES: .c .o .lo
45
46 .c.lo:
47         $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $<
48
49 all: $(PROGRAMS)
50
51 pguid.la: pguid.lo
52         $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
53         -rpath $(moduledir) -module -o $@ $? $(LIBS)
54
55 rdnval.la: rdnval.lo
56         $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
57         -rpath $(moduledir) -module -o $@ $? $(LIBS)
58
59 vernum.la: vernum.lo
60         $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
61         -rpath $(moduledir) -module -o $@ $? $(LIBS)
62
63 instancetype.la: instancetype.lo
64         $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
65         -rpath $(moduledir) -module -o $@ $? $(LIBS)
66
67 syntax_checks.la: syntax_checks.lo
68         $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
69         -rpath $(moduledir) -module -o $@ $? $(LIBS)
70
71
72 clean:
73         rm -rf *.o *.lo *.la .libs
74
75 install: $(PROGRAMS)
76         mkdir -p $(DESTDIR)$(moduledir)
77         for p in $(PROGRAMS) ; do \
78                 $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
79         done
80