1 #-----------------------------------------------------------------------------
2 # Copyright (c) 1994 Regents of the University of Michigan.
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.
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 #-----------------------------------------------------------------------------
21 HDIR = $(LDAPSRC)/include
22 LDIR = $(LDAPSRC)/libraries
23 VERSIONFILE = $(LDAPSRC)/build/version
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
31 INCLUDES= -I$(HDIR) $(KRBINCLUDEFLAG)
32 DEFINES= $(DEFS) -DDEBUG -DCONFIG_FILE=\"$(RUNTIMEETCDIR)/ud.conf\" \
33 -DLDAP_FRIENDLY_MAP_FILE=\"$(RUNTIMEETCDIR)/ldapfriendly\"
36 CFLAGS= ${INCLUDES} ${DEFINES} ${ACFLAGS}
37 LIBS= ${TERMLIB} -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS)
45 $(PURIFY) ${CC} $(ALDFLAGS) -o $@ version.o ${OBJS} -L${LDIR} ${LIBS}
47 version.c: ${OBJS} $(LDIR)/libldap/libldap.a
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}|" \
56 -$(MKDIR) -p $(BINDIR)
57 -mv -f ${BINDIR}/ud ${BINDIR}/ud-
58 $(INSTALL) $(INSTALLFLAGS) -m 775 ud ${BINDIR}
61 $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS)
64 $(RM) $(OBJS) core ud tags version.o version.c
65 $(RM) *_pure_*.o ud.pure_hardlink ud.pure_linkinfo
68 $(CTAGS) $(SRCS) ${HDRS}
71 $(LINT) -Dlint $(INCLUDES) $(DEFINES) $(SRCS) version.c | \
72 egrep -v "string_to_key|but not defined"
75 $(5LINT) -Dlint $(INCLUDES) $(DEFINES) $(SRCS) version.c
78 @$(LN) .src/README .src/etc.ud.conf .src/*.[ch] .
80 # DO NOT DELETE THIS LINE -- mkdep uses it.
81 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
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
100 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY