openldap/clients/tools/Make-template
Kurt Zeilenga d2ef362f99 Removed use of paths not defined in ldapconfig.h.edit.
Fixed Dependency Generation not to mess with Make-templates.
	side effect: depends are not carried forward after "make makefiles"
1998-08-20 03:56:19 +00:00

105 lines
3.2 KiB
Text

#----------------------------------------------------------------------------
# Copyright (c) 1994 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
# LDAP tools makefile
#
#-----------------------------------------------------------------------------
LDAPSRC = ../..
HDIR = $(LDAPSRC)/include
LDIR = $(LDAPSRC)/libraries
VERSIONFILE = $(LDAPSRC)/build/version
SRCS = ldapsearch.c ldapmodify.c ldapdelete.c ldapmodrdn.c
OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o
INCLUDES= -I$(HDIR)
DEFINES = $(DEFS)
CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS)
LIBS = -lldap -llber -lldif $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS)
all: ldapsearch ldapmodify ldapdelete ldapmodrdn ldapadd
ldapsearch: ldsversion.o
$(CC) $(ALDFLAGS) -o $@ ldapsearch.o ldsversion.o \
-L$(LDIR) $(LIBS)
ldapmodify: ldmversion.o
$(CC) $(ALDFLAGS) -o $@ ldapmodify.o ldmversion.o \
-L$(LDIR) $(LIBS)
ldapdelete: lddversion.o
$(CC) $(ALDFLAGS) -o $@ ldapdelete.o lddversion.o -L$(LDIR) $(LIBS)
ldapmodrdn: ldrversion.o
$(CC) $(ALDFLAGS) -o $@ ldapmodrdn.o ldrversion.o -L$(LDIR) $(LIBS)
ldapadd: ldapmodify
$(RM) $@
$(HARDLN) ldapmodify ldapadd
ldsversion.c: ldapsearch.o
$(RM) $@
(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
-e "s|%VERSION%|$${v}|" \
< Versionlds.c > $@)
ldmversion.c: ldapmodify.o
$(RM) $@
(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
-e "s|%VERSION%|$${v}|" \
< Versionldm.c > $@)
lddversion.c: ldapdelete.o
$(RM) $@
(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
-e "s|%VERSION%|$${v}|" \
< Versionldd.c > $@)
ldrversion.c: ldapmodrdn.o
$(RM) $@
(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
-e "s|%VERSION%|$${v}|" \
< Versionldr.c > $@)
install: ldapsearch ldapmodify ldapdelete ldapmodrdn ldapadd FORCE
-$(MKDIR) -p $(LDAP_BINDIR)
$(INSTALL) $(INSTALLFLAGS) -m 755 ldapsearch $(LDAP_BINDIR)
$(INSTALL) $(INSTALLFLAGS) -m 755 ldapmodify $(LDAP_BINDIR)
$(INSTALL) $(INSTALLFLAGS) -m 755 ldapdelete $(LDAP_BINDIR)
$(INSTALL) $(INSTALLFLAGS) -m 755 ldapmodrdn $(LDAP_BINDIR)
$(RM) $(LDAP_BINDIR)/ldapadd
$(HARDLN) $(LDAP_BINDIR)/ldapmodify $(LDAP_BINDIR)/ldapadd
lint: FORCE
$(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
5lint: FORCE
$(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)
clean: FORCE
$(RM) *.o core a.out ld*version.c ldapsearch ldapmodify ldapdelete \
ldapmodrdn ldapadd
depend: FORCE
$(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS)
links:
@$(LN) .src/*.[ch] .