1# Makefile for LDAP tools
2# $OpenLDAP$
3## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4##
5## Copyright 1998-2021 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
16SRCS	= ldapsearch.c ldapmodify.c ldapdelete.c ldapmodrdn.c \
17		ldappasswd.c ldapwhoami.c ldapcompare.c \
18		ldapexop.c ldapurl.c common.c
19OBJS	= ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o \
20		ldappasswd.o ldapwhoami.o ldapcompare.o \
21		ldapexop.o ldapurl.o common.o
22
23LDAP_INCDIR= ../../include
24LDAP_LIBDIR= ../../libraries
25
26MKVOPTS = -s
27
28XLIBS =  $(LDAP_L)
29XXLIBS	= $(SECURITY_LIBS) $(LUTIL_LIBS)
30
31XSRCS	= ldsversion.c ldmversion.c lddversion.c ldrversion.c \
32	ldpversion.c ldwversion.c ldcversion.c ldeversion.c lduversion.c
33
34PROGRAMS = ldapsearch ldapmodify ldapdelete ldapmodrdn \
35	ldappasswd ldapwhoami ldapcompare ldapexop ldapurl
36
37
38ldapsearch:	ldsversion.o
39	$(LTLINK) -o $@ ldapsearch.o common.o ldsversion.o $(LIBS)
40
41ldapmodify:	ldmversion.o
42	$(LTLINK) -o $@ ldapmodify.o common.o ldmversion.o $(LIBS)
43
44ldapdelete:	lddversion.o
45	$(LTLINK) -o $@ ldapdelete.o common.o lddversion.o $(LIBS)
46
47ldapmodrdn:	ldrversion.o
48	$(LTLINK) -o $@ ldapmodrdn.o common.o ldrversion.o $(LIBS)
49
50ldappasswd:	ldpversion.o
51	$(LTLINK) -o $@ ldappasswd.o common.o ldpversion.o $(LIBS)
52
53ldapwhoami:	ldwversion.o
54	$(LTLINK) -o $@ ldapwhoami.o common.o ldwversion.o $(LIBS)
55
56ldapcompare: ldcversion.o
57	$(LTLINK) -o $@ ldapcompare.o common.o ldcversion.o $(LIBS)
58
59ldapexop: ldeversion.o
60	$(LTLINK) -o $@ ldapexop.o common.o ldeversion.o $(LIBS)
61
62ldapurl: lduversion.o
63	$(LTLINK) -o $@ ldapurl.o lduversion.o $(LIBS)
64
65ldsversion.c: Makefile
66	@-$(RM) $@
67	$(MKVERSION) $(MKVOPTS) ldapsearch > $@
68
69ldsversion.o: ldapsearch.o common.o $(XLIBS)
70
71ldmversion.c: Makefile
72	@-$(RM) $@
73	$(MKVERSION) $(MKVOPTS) ldapmodify > $@
74
75ldmversion.o: ldapmodify.o common.o $(XLIBS)
76
77lddversion.c: Makefile
78	@-$(RM) $@
79	$(MKVERSION) $(MKVOPTS) ldapdelete > $@
80
81lddversion.o: ldapdelete.o common.o $(XLIBS)
82
83ldpversion.c: Makefile
84	@-$(RM) $@
85	$(MKVERSION) $(MKVOPTS) ldappasswd > $@
86
87ldpversion.o: ldappasswd.o common.o $(XLIBS)
88
89ldrversion.c: Makefile
90	@-$(RM) $@
91	$(MKVERSION) $(MKVOPTS) ldapmodrdn > $@
92
93ldrversion.o: ldapmodrdn.o common.o $(XLIBS)
94
95ldwversion.c: Makefile
96	@-$(RM) $@
97	$(MKVERSION) $(MKVOPTS) ldapwhoami > $@
98
99ldwversion.o: ldapwhoami.o common.o $(XLIBS)
100
101ldcversion.c: Makefile
102	@-$(RM) $@
103	$(MKVERSION) $(MKVOPTS) ldapcompare > $@
104
105ldcversion.o: ldapcompare.o common.o $(XLIBS)
106
107ldeversion.c: Makefile
108	@-$(RM) $@
109	$(MKVERSION) $(MKVOPTS) ldapexop > $@
110
111ldeversion.o: ldapexop.o common.o $(XLIBS)
112
113lduversion.c: Makefile
114	@-$(RM) $@
115	$(MKVERSION) $(MKVOPTS) ldapurl > $@
116
117lduversion.o: ldapurl.o $(XLIBS)
118
119install-local:	FORCE
120	-$(MKDIR) $(DESTDIR)$(bindir)
121	@(								\
122	    for prg in $(PROGRAMS); do					\
123		$(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 $$prg$(EXEEXT)	\
124		    $(DESTDIR)$(bindir);				\
125	    done							\
126	)
127	$(RM) $(DESTDIR)$(bindir)/ldapadd$(EXEEXT)
128	$(LN_S) $(DESTDIR)$(bindir)/ldapmodify$(EXEEXT) $(DESTDIR)$(bindir)/ldapadd$(EXEEXT)
129
130