]> git.sur5r.net Git - openldap/blob - clients/ud/Make-template
Check LOCK_ID() return
[openldap] / clients / ud / 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 #       ud makefile
13 #
14 #       Use -DUOFM for University of Michigan specifics like:
15 #               if ud should know about noBatchUpdates
16 #       Use -DDOS if building for a DOS machine
17 #       Use -DNOTERMCAP if there is no termcap library
18 #               also need to redefine/undefine the Makefile TERMLIB variable
19 #-----------------------------------------------------------------------------
20 LDAPSRC = ../..
21 HDIR    = $(LDAPSRC)/include
22 LDIR    = $(LDAPSRC)/libraries
23 VERSIONFILE = $(LDAPSRC)/build/version
24
25 SRCS=   main.c find.c mod.c print.c auth.c util.c help.c\
26         string_to_key.c group.c edit.c globals.c
27 OBJS=   main.o find.o mod.o print.o auth.o util.o help.o\
28         string_to_key.o group.o globals.o edit.o
29 HDRS=   ud.h
30
31 INCLUDES= -I$(HDIR) $(KRBINCLUDEFLAG)
32 DEFINES= $(DEFS) -DDEBUG -DCONFIG_FILE=\"$(RUNTIMEETCDIR)/ud.conf\" \
33                 -DLDAP_FRIENDLY_MAP_FILE=\"$(RUNTIMEETCDIR)/ldapfriendly\"
34 TERMLIB= -ltermcap
35
36 CFLAGS= ${INCLUDES} ${DEFINES} ${ACFLAGS}
37 LIBS= ${TERMLIB} -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS)
38
39 PURIFY=
40 #PURIFY=purify
41
42 all: ud
43
44 ud : version.o
45         $(PURIFY) ${CC} $(ALDFLAGS) -o $@ version.o ${OBJS} -L${LDIR} ${LIBS}
46
47 version.c: ${OBJS} $(LDIR)/libldap/libldap.a
48         $(RM) $@
49         (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
50             t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
51             -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
52             -e "s|%VERSION%|$${v}|" \
53             < Version.c > $@)
54
55 install: ud FORCE
56         -$(MKDIR) -p $(BINDIR)
57         -mv -f ${BINDIR}/ud ${BINDIR}/ud-
58         $(INSTALL) $(INSTALLFLAGS) -m 775 ud ${BINDIR}
59
60 depend: FORCE
61         $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS)
62
63 clean: FORCE
64         $(RM) $(OBJS) core ud tags version.o version.c
65         $(RM) *_pure_*.o ud.pure_hardlink ud.pure_linkinfo
66
67 tags: FORCE
68         $(CTAGS) $(SRCS) ${HDRS}
69
70 lint: FORCE
71         $(LINT) -Dlint $(INCLUDES) $(DEFINES) $(SRCS) version.c | \
72                 egrep -v "string_to_key|but not defined"
73
74 5lint:  FORCE
75         $(5LINT) -Dlint $(INCLUDES) $(DEFINES) $(SRCS) version.c
76
77 links:
78         @$(LN) .src/README .src/etc.ud.conf .src/*.[ch] .
79
80 # DO NOT DELETE THIS LINE -- mkdep uses it.
81 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
82
83 main.o: main.c ../../include/lber.h ../../include/ldap.h
84 main.o: ../../include/ldapconfig.h ../../include/portable.h ud.h
85 find.o: find.c ../../include/lber.h ../../include/ldap.h ud.h
86 mod.o: mod.c ../../include/lber.h ../../include/ldap.h ud.h
87 print.o: print.c ../../include/lber.h ../../include/ldap.h ud.h
88 auth.o: auth.c ../../include/lber.h ../../include/ldap.h
89 auth.o: ../../include/ldapconfig.h ud.h
90 util.o: util.c ../../include/lber.h ../../include/ldap.h
91 util.o: ../../include/ldapconfig.h ../../include/portable.h ud.h
92 help.o: help.c ../../include/lber.h ../../include/ldap.h ud.h
93 string_to_key.o: string_to_key.c
94 group.o: group.c ../../include/lber.h ../../include/ldap.h
95 group.o: ../../include/ldapconfig.h ud.h
96 edit.o: edit.c ../../include/lber.h ../../include/ldap.h
97 edit.o: ../../include/ldapconfig.h ud.h
98 globals.o: globals.c ud.h
99
100 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY