]> git.sur5r.net Git - openldap/blob - include/Make-template
Fixed ldapconfig.h.edit/Make-template to generate ldapconfig.h correctly.
[openldap] / include / Make-template
1 #-----------------------------------------------------------------------------
2 # Copyright (c) 1994 Regents of the University of Michigan.
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms are permitted
6 # provided that this notice is preserved and that due credit is given
7 # to the University of Michigan at Ann Arbor. The name of the University
8 # may not be used to endorse or promote products derived from this
9 # software without specific prior written permission. This software
10 # is provided ``as is'' without express or implied warranty.
11 #
12 #       LDAP include file makefile
13 #
14 #-----------------------------------------------------------------------------
15
16 LDAPSRC=..
17
18 all:    ldapconfig.h FORCE
19         @if [ ! -z "$(SYSEXITSPATH)" -a ! -r sysexits.h ]; then \
20             echo "$(LN) $(SYSEXITSPATH) sysexits.h"; \
21             $(LN) $(SYSEXITSPATH) sysexits.h; \
22         else \
23             exit 0; \
24         fi
25
26 ldapconfig.h:   ldapconfig.h.edit Makefile
27         @$(RM) $@
28         @echo "/*" > $@;  \
29         echo " * This file was automatically generated.  Do not edit it." >> $@; \
30         echo " * Instead, edit the file ldapconfig.h.edit.  See the LDAP" >> $@; \
31         echo " * INSTALL file for more information." >> $@; \
32         echo " */ " >> $@; \
33         echo "" >> $@; \
34         $(SED) -e 's;%ETCDIR%;$(LDAP_ETCDIR);' \
35                         -e 's;%BINDIR%;$(LDAP_BINDIR);' \
36                         -e 's;%SBINDIR%;$(LDAP_SBINDIR);' \
37                         -e 's;%LIBEXECDIR%;$(LDAP_LIBEXECDIR);' \
38                         -e 's;%RUNDIR%;$(LDAP_RUNDIR);' \
39                         -e 's;%EDITOR%;$(LDAP_EDITOR);' \
40                         -e 's;%FINGER%;$(LDAP_FINGER);' \
41                         -e 's;%SENDMAIL%;$(LDAP_SENDMAIL);' \
42                          ldapconfig.h.edit >> $@; \
43         $(CHMOD) 444 $@
44
45 install: all FORCE
46                 -$(MKDIR) -p $(INCLUDEDIR)
47                 $(INSTALL) $(INSTALLFLAGS) -m 644 ldap.h $(LDAP_INCDIR)
48                 $(INSTALL) $(INSTALLFLAGS) -m 644 lber.h $(LDAP_INCDIR)
49                 $(INSTALL) $(INSTALLFLAGS) -m 644 proto-lber.h $(LDAP_INCDIR)
50                 $(INSTALL) $(INSTALLFLAGS) -m 644 proto-ldap.h $(LDAP_INCDIR)
51                 $(INSTALL) $(INSTALLFLAGS) -m 644 disptmpl.h $(LDAP_INCDIR)
52                 $(INSTALL) $(INSTALLFLAGS) -m 644 srchpref.h $(LDAP_INCDIR)
53
54 depend: FORCE
55
56 clean:  FORCE
57
58 veryclean:      clean
59         $(RM) ldapconfig.h
60         @if [ ! -z "$(SYSEXITSPATH)" ]; then \
61             echo "$(RM) sysexits.h"; \
62             $(RM) sysexits.h; \
63         else \
64             exit 0; \
65         fi
66
67 links:
68         @echo "making links in `$(PWD)`
69         @$(LN) .src/*.h .
70         @cp .src/ldapconfig.h.edit .
71         @-$(RM) ldapconfig.h