1#
2# This file is a Makefile for Neo, the NeoSoft extensions to Tcl.
3# If it has the name "Makefile.in" then it is a template for a
4# Makefile;  to generate the actual Makefile, run "./configure",
5# which is a configuration script generated by the "autoconf" program
6# (constructs like "@foo@" will get replaced in the actual Makefile.
7#
8
9VERSION = @NEO_VERSION@
10LIBNAME = @NEO_SHARED_LIB_FILE@
11
12# Default top-level directories in which to install architecture-
13# specific files (exec_prefix) and machine-independent files such
14# as scripts (prefix).  The values specified here may be overridden
15# at configure-time with the --exec-prefix and --prefix options
16# to the "configure" script.
17
18prefix =        @prefix@
19exec_prefix =       @exec_prefix@
20
21# The following definition can be set to non-null for special systems
22# like AFS with replication.  It allows the pathnames used for installation
23# to be different than those used for actually reference files at
24# run-time.  DESTDIR is prepended to $prefix and $exec_prefix
25# when installing files.
26DESTDIR =
27
28# Directory in which to search for tcl libraries
29NEO_LIBRARY	= $(exec_prefix)/lib/ldaptcl$(VERSION)
30
31# Directory in which to install the ldaptcl binary:
32BIN_INSTALL_DIR = $(DESTDIR)$(exec_prefix)/bin
33
34# Directory in which to install the .a or .so binary for the Neo library:
35LIB_INSTALL_DIR = $(DESTDIR)$(exec_prefix)/lib
36
37# Path to use at runtime to refer to LIB_INSTALL_DIR:
38LIB_RUNTIME_DIR =	$(exec_prefix)/lib
39
40# Top-level directory for man entries:
41MANN_INSTALL_DIR =	$(DESTDIR)$(prefix)/man/mann
42
43
44# The symbols below provide support for dynamic loading and shared
45# libraries.  The values of the symbols are normally set by the
46# configure script.  You shouldn't normally need to modify any of
47# these definitions by hand.
48
49SHLIB_CFLAGS = @NEO_SHLIB_CFLAGS@
50
51NEO_LIB_FILE = @NEO_LIB_FILE@
52
53NEO_SHARED_LIB_FILE = @NEO_SHARED_LIB_FILE@
54
55# The directory containing the Tcl sources and headers appropriate
56# for this version of Neo ("srcdir" will be replaced or has already
57# been replaced by the configure script):
58TCL_GENERIC_DIR =   @TCL_SRC_DIR@/generic
59
60# The top of the TclX directory tree
61TCLX_TOP_DIR	=	@TCLX_TOP_DIR@
62
63# The directory where tclExtend.h will be:
64TCLX_TCL_GEN_DIR =	${TCLX_TOP_DIR}/tcl/generic
65
66# The directory where tclXunixPort.h will be:
67TCLX_TCL_UNIX_DIR =	${TCLX_TOP_DIR}/tcl/unix
68
69# The path to tclX the runtcl script:
70TCLX_RUNTCL	=	${TCLX_TOP_DIR}/unix/runtcl
71
72# The directory containing the Tcl library archive file appropriate
73# for this version of Neo:
74TCL_BIN_DIR =       @TCL_BIN_DIR@
75
76
77# The symbol below provides support for dynamic loading and shared
78# libraries.  See configure.in for a description of what it means.
79# The values of the symbolis normally set by the configure script.
80
81SHLIB_LD = @SHLIB_LD@
82
83# Set to the options to include libldap.a and liblber.a 
84# (eg. -L../tools/blah -lldap -llber)
85
86LDAP_LIBFLAGS	= @ldaplibflags@
87LDAP_CFLAGS	= @ldapinclude@
88LDAP_INCDIR	= @ldapincdir@
89LDAP_BUILD	= @ldapbuild@
90LDAP_DIR	= @ldapdir@
91
92
93#----------------------------------------------------------------
94# The information below is modified by the configure script when
95# Makefile is generated from Makefile.in.  You shouldn't normally
96# modify any of this stuff by hand.
97#----------------------------------------------------------------
98
99AC_FLAGS =      @DEFS@
100INSTALL=	@INSTALL@
101INSTALL_PROGRAM =   @INSTALL_PROGRAM@
102INSTALL_DATA =      @INSTALL_DATA@
103RANLIB =        @RANLIB@
104SRC_DIR =       @srcdir@/..
105TOP_DIR =       @srcdir@/..
106GENERIC_DIR =       $(TOP_DIR)/generic
107
108#----------------------------------------------------------------
109# The information below should be usable as is.  The configure
110# script won't modify it and you shouldn't need to modify it
111# either.
112#----------------------------------------------------------------
113
114
115OBJS= neoXldap.o
116
117LIBDIR=$(exec_prefix)/lib
118INCDIR=$(prefix)/include
119
120LIBS= @LIBS@ @TCLX_LIB_SPEC@ @TCL_LIB_SPEC@ @TCL_LIBS@ $(LDAP_LIBFLAGS) -lc
121TK_LIBS=@TKX_LIB_SPEC@ @TK_LIB_SPEC@ @TK_LIBS@
122TK_VERSION=@TK_VERSION@
123
124CC =        @CC@
125CC_SWITCHES =   ${CFLAGS} @NEO_SHLIB_CFLAGS@ -I. \
126-I@prefix@/include ${AC_FLAGS} ${PROTO_FLAGS} \
127${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \
128-DNEO_LIBRARY=\"${NEO_LIBRARY}\" -DVERSION=\"${VERSION}\" 
129
130TK_SWITCHES = ${CC_SWITCHES} @TK_XINCLUDES@
131
132.c.o:
133	$(CC) -c $(CC_SWITCHES) $<
134
135all:	@NEO_LIB_FILE@ ldaptclsh @LDAPWISH@
136
137@NEO_LIB_FILE@:	$(OBJS)
138	rm -f @NEO_LIB_FILE@
139	@MAKE_LIB@
140	$(RANLIB) @NEO_LIB_FILE@
141
142neoXldap.o: neoXldap.c ldaptclerr.h
143	$(CC) -c $(LDAP_CFLAGS) $(CC_SWITCHES) $<
144
145ldaptclerr.h: ldaperr.tcl
146	tcl ldaperr.tcl $(LDAP_INCDIR)/ldap.h > ldaptclerr.h
147
148
149clean:
150	-rm -f ldaptclsh ldapwish
151	-rm -f *.o *.a *.so*
152
153distclean: clean
154	rm -f Makefile pkgIndex.tcl config.cache config.log config.status \
155		ldaptclerr.h
156
157install: install-binaries install-man
158
159install-binaries: @NEO_LIB_FILE@ ldaptclsh @LDAPWISH@
160	@-mkdir -p $(BIN_INSTALL_DIR)
161	$(INSTALL_PROGRAM) ldaptclsh $(BIN_INSTALL_DIR)/ldaptclsh
162	@if [ -n "@LDAPWISH@" ] ; then \
163	    echo $(INSTALL_PROGRAM) ldapwish $(BIN_INSTALL_DIR)/ldapwish; \
164	    $(INSTALL_PROGRAM) ldapwish $(BIN_INSTALL_DIR)/ldapwish; \
165	fi
166	$(INSTALL_DATA) @NEO_LIB_FILE@ $(LIB_INSTALL_DIR)
167	@if [ "$(NEO_LIB_FILE)" = "$(NEO_SHARED_LIB_FILE)" ] ; then \
168		echo Installing pkgIndex.tcl in $(NEO_LIBRARY); \
169		mkdir -p $(NEO_LIBRARY); \
170		$(INSTALL_DATA) pkgIndex.tcl $(NEO_LIBRARY); \
171	fi
172
173
174install-man:
175	@for i in ldap.n; \
176	    do \
177	    echo "Installing $$i"; \
178	    rm -f $(MANN_INSTALL_DIR)/$$i; \
179	    sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
180		    $$i > $(MANN_INSTALL_DIR)/$$i; \
181	    chmod 444 $(MANN_INSTALL_DIR)/$$i; \
182	done;
183
184
185TCLOFILES= tclAppInit.o
186
187ldaptclsh:$(TCLOFILES) @NEO_LIB_FILE@
188	$(CC) @LD_FLAGS@ $(TCLOFILES) @NEO_BUILD_LIB_SPEC@ $(LIBS) \
189	@TCL_LD_SEARCH_FLAGS@ -o ldaptclsh
190
191tkAppInit.o: tkAppInit.c
192	$(CC) -c ${TK_SWITCHES} tkAppInit.c
193
194ldapwish:tkAppInit.o @NEO_LIB_FILE@
195	$(CC) @LD_FLAGS@ tkAppInit.o @NEO_BUILD_LIB_SPEC@ $(TK_LIBS) $(LIBS) \
196	@TCL_LD_SEARCH_FLAGS@ -o ldapwish
197