Debian Codegraph @

xpa/Makefile

raw symbols SCIP
1 #
2 # This file is a Makefile for XPA. If it has the name "Makefile.in"
3 # then it is a template for a Makefile; to generate the actual Makefile,
4 # run "./configure", which is a configuration script generated by the
5 # "autoconf" program (constructs like "@foo@" will get replaced in the
6 # actual Makefile.
7 #
8
9 PACKAGE = xpa
10 VERSION = 2.1.15
11
12 DISTNAME = xpa-${VERSION}
13 DISTDIR = ../export/${DISTNAME}
14 FTPDIR = ../ftp
15
16 #----------------------------------------------------------------
17 # Things you can change to personalize the Makefile for your own
18 # site (you can make these changes in either Makefile.in or
19 # Makefile, but changes to Makefile will get lost if you re-run
20 # the configuration script).
21 #----------------------------------------------------------------
22
23 # Default top-level directories in which to install architecture-
24 # specific files (exec_prefix) and machine-independent files such
25 # as scripts (prefix). The values specified here may be overridden
26 # at configure-time with the --exec-prefix and --prefix options
27 # to the "configure" script.
28
29 prefix = /usr/local
30 exec_prefix = ${prefix}
31
32 # The following definition can be set to non-null for special systems
33 # like AFS with replication. It allows the pathnames used for installation
34 # to be different than those used for actually reference files at
35 # run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix
36 # when installing files.
37 INSTALL_ROOT =
38
39 # Directory in which to install the .a or .so binary for the XPA library:
40 LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib
41
42 # Directory in which to install the program wish:
43 BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
44
45 # Directory in which to install the include file xpa.h:
46 INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include
47
48 # Top-level directory for manual entries:
49 MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man
50
51 # Top-level directory for share entries:
52 MAN_SHARE_DIR = $(INSTALL_ROOT)$(prefix)/share/xpa
53
54 # Platform-specific X compiler flags (include file specifications)
55 X_CFLAGS =
56 # Platform-specific link directive for X libraries (-L specification)
57 X_LIBS =
58 # Platform-specific libraries that must go before -lXt
59 X_PRE_LIBS = -lSM -lICE
60 # Platform-specific libraries that must go after -lXt
61 X_EXTRA_LIBS =
62
63 # Platform-specific include files for Tcl
64 TCL_CFLAGS =
65 # Platform-specific libraries for Tcl
66 TCL_LIBS =
67
68 # Platform-specific include files for Gtk
69 GTK_CFLAGS =
70 # Platform-specific libraries for Gtk
71 GTK_LIBS =
72
73 # combine package cflags
74 PKG_CFLAGS = $(X_CFLAGS) $(TCL_CFLAGS) $(GTK_CFLAGS)
75
76 # extra Libs required to link (e.g. socket libraries)
77 LIBS =
78
79 # pthread lib needed to xpans
80 TLIB =
81
82 # To change the compiler switches, for example to change from -O
83 # to -g, change the following line:
84 CFLAGS = -g -O2 -fPIC
85
86 # To add ld switches, change the following line:
87 LDFLAGS =
88
89 # Some versions of make, like SGI's, use the following variable to
90 # determine which shell to use for executing commands:
91 SHELL = /bin/sh
92
93 # if enabled-shared was specified, this will exand to "shlib" and trigger
94 # building of the shared library
95 DOSHARED = shlib
96
97 # There are just too many different versions of "install" around;
98 # better to use the install-sh script that comes with the distribution,
99 # which is slower but guaranteed to work.
100
101 INSTALL = ./install-sh -c
102 INSTALL_PROGRAM = ${INSTALL}
103 INSTALL_DATA = ${INSTALL} -m 644
104
105 #----------------------------------------------------------------
106 # The information below is modified by the configure script when
107 # Makefile is generated from Makefile.in. You shouldn't normally
108 # modify any of this stuff by hand.
109 #----------------------------------------------------------------
110
111 AC_FLAGS = -DHAVE_CONFIG_H
112 RANLIB = ranlib
113 EXE =
114
115 #----------------------------------------------------------------
116 # The information below should be usable as is. The configure
117 # script won't modify it and you shouldn't need to modify it
118 # either.
119 #----------------------------------------------------------------
120 RM = rm -f
121
122 CC = gcc
123
124 CC_SWITCHES = -I. ${CFLAGS} ${AC_FLAGS}
125
126 DEPEND_SWITCHES = -I. ${CFLAGS} ${PKG_CFLAGS} ${AC_FLAGS}
127
128 SRCS = xpa.c xpaio.c command.c acl.c remote.c clipboard.c port.c \
129 tcp.c client.c word.c xalloc.c find.c xlaunch.c timedconn.c \
130 tclloop.c tcl.c xtloop.c gtkloop.c \
131 xpaset.c xpaget.c xpainfo.c xpaaccess.c xpans.c xpamb.c
132
133 BASE_OBJS = xpa.o xpaio.o command.o acl.o remote.o clipboard.o port.o \
134 tcp.o client.o word.o xalloc.o find.o xlaunch.o timedconn.o
135
136 TCL_OBJS = tclloop.o tcl.o
137
138 XT_OBJS = xtloop.o
139
140 GTK_OBJS = gtkloop.o
141
142 INCL = xpa.h xpap.h
143
144 # these are all the modules going into the "normal" xpa library
145 LIBOBJS = ${BASE_OBJS} ${TCL_OBJS} ${XT_OBJS} ${GTK_OBJS}
146 LIB = libxpa.a
147
148 # used in link line
149 # LLIB= $(LIB)
150 LLIB= $(LIB)
151
152 PROGS = xpaset xpaget xpainfo xpaaccess xpans xpamb
153
154 TESTPROGS = ctest stest rtest
155
156 all: xpa.h lib $(PROGS)
157
158 testall: $(TESTPROGS)
159
160 All: all testall
161
162 install:: install-binaries
163
164 install:: $(DOSHARED)_install
165
166 install:: install-man
167
168 install:: install-share
169
170 lib: $(LIB) $(DOSHARED)
171
172 $(LIB): $(LIBOBJS)
173 $(RM) $(LIB)
174 ar crv $(LIB) $(LIBOBJS)
175 $(RANLIB) $(LIB)
176
177 shlib: $(LIB)
178 @(rm -rf lib$(PACKAGE).tmp; mkdir lib$(PACKAGE).tmp; \
179 (cd lib$(PACKAGE).tmp && ar x ../lib$(PACKAGE).a); \
180 rm -f lib$(PACKAGE).tmp/xt*.o; \
181 rm -f lib$(PACKAGE).tmp/tcl*.o; \
182 CC='$(CC)' CXX=$(CXX) \
183 ./mklib -o $(PACKAGE) lib$(PACKAGE).tmp/*.o; \
184 rm -rf lib$(PACKAGE).tmp)
185
186 mingw-dll: $(LIBOBJS)
187 $(CC) -I. -DHAVE_CONFIG_H -shared port.c tcp.c acl.c find.c \
188 remote.c timedconn.c client.c word.c xpaio.c clipboard.c \
189 xlaunch.c xalloc.c command.c xpa.c \
190 -Wl,--output-def,libxpa.def,--out-implib,libxpa_dll.a,-no-undefined,--enable-runtime-pseudo-reloc -o libxpa.dll \
191 -lwsock32
192
193 tclxpa: $(LIB)
194 @(rm -rf libtclxpa.tmp; mkdir libtclxpa.tmp; \
195 (cd libtclxpa.tmp && ar x ../lib$(PACKAGE).a); \
196 rm -f libtclxpa.tmp/xt*.o; \
197 CC='$(CC)' CXX=$(CXX) \
198 ./mklib -o tclxpa libtclxpa.tmp/*.o $(TCL_LIBS); \
199 test -r libtclxpa.dylib && cp -p libtclxpa.dylib libtclxpa.so && echo "copying libtclxpa.dylib to libtclxpa.so"; \
200 rm -rf libtclxpa.tmp)
201
202 diff:
203 -(for f in `ls *.c`; \
204 do \
205 echo $$f; \
206 diff /soft/saord/xpa-2.1.[0-9]*/$$f .; \
207 done);
208
209 index: $(LIB)
210 @(test -r pkgIndex.tcl && mv pkgIndex.tcl pkgIndex.tcl-old; \
211 echo "pkg_mkIndex -direct -verbose . libtclxpa.so; exit"| tclsh)
212
213 xpaset: $(LIB) xpaset.o
214 $(CC) $(LDFLAGS) xpaset.o -o xpaset $(LLIB) $(LIBS)
215
216 xpaget: $(LIB) xpaget.o
217 $(CC) $(LDFLAGS) xpaget.o -o xpaget $(LLIB) $(LIBS)
218
219 xpainfo: $(LIB) xpainfo.o
220 $(CC) $(LDFLAGS) xpainfo.o -o xpainfo $(LLIB) $(LIBS)
221
222 xpaaccess: $(LIB) xpaaccess.o
223 $(CC) $(LDFLAGS) xpaaccess.o -o xpaaccess $(LLIB) $(LIBS)
224
225 xpans: $(LIB) xpans.o
226 $(CC) $(LDFLAGS) xpans.o -o xpans $(LLIB) $(LIBS) $(TLIB)
227
228 xpamb: $(LIB) xpamb.o
229 $(CC) $(LDFLAGS) xpamb.o -o xpamb $(LLIB) $(LIBS)
230
231 ctest: $(LIB) ctest.o
232 $(CC) $(LDFLAGS) ctest.o -o ctest $(LLIB) $(LIBS)
233
234 stest: $(LIB) stest.o
235 $(CC) $(LDFLAGS) stest.o -o stest $(LIB) $(LIBS)
236
237 rtest: $(LIB) rtest.o
238 $(CC) $(LDFLAGS) rtest.o -o rtest $(LIB) $(LIBS)
239
240 stestx: $(LIB) stest.o
241 $(CC) $(LDFLAGS) stest.o -o stest $(LIB) \
242 $(X_LIBS) -lXt $(X_PRE_LIBS) -lXext -lX11 $(LIBS)
243
244 # Smoke test: allows end-users to quickly discern basic usability
245 smoke: ctest stest
246 ./stest smoke &
247 sleep 3
248 ./ctest -e -b -l 1000 smoke
249 ./xpaset -p smoke exit
250
251 # Note: before running ranlib below, must cd to target directory because
252 # some ranlibs write to current directory, and this might not always be
253 # possible (e.g. if installing as root).
254
255 # this nop-op gets executed if we are not building shared libraries
256 _install:
257
258 shlib_install:
259 @-(for i in `ls *.so* *.dylib *.sl 2>/dev/null` ; \
260 do \
261 if [ -h $$i ] ; then \
262 echo "Installing link $$i" ; \
263 tar cf - $$i | (cd $(LIB_INSTALL_DIR); tar xf -) ; \
264 else \
265 echo "Installing $$i" ; \
266 $(INSTALL_DATA) $$i $(LIB_INSTALL_DIR)/$$i ; \
267 chmod 555 $(LIB_INSTALL_DIR)/$$i; \
268 fi; \
269 done;)
270
271 install-binaries: $(LIB) $(PROGS)
272 @for i in $(LIB_INSTALL_DIR) $(INCLUDE_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
273 do \
274 if [ ! -d $$i ] ; then \
275 echo "Making directory $$i"; \
276 mkdir $$i; \
277 chmod 755 $$i; \
278 else true; \
279 fi; \
280 done;
281 @echo "Installing $(LIB)";
282 @$(INSTALL_DATA) $(LIB) $(LIB_INSTALL_DIR)/$(LIB);
283 @(cd $(LIB_INSTALL_DIR); $(RANLIB) $(LIB));
284 @chmod 555 $(LIB_INSTALL_DIR)/$(LIB);
285 @echo "Installing xpa.h"
286 @$(INSTALL_DATA) xpa.h $(INCLUDE_INSTALL_DIR)/xpa.h
287 @echo "Installing prsetup.h"
288 @$(INSTALL_DATA) prsetup.h $(INCLUDE_INSTALL_DIR)/prsetup.h
289 @for i in $(PROGS) ; \
290 do \
291 echo "Installing $$i$(EXE)" ; \
292 $(INSTALL_PROGRAM) $$i$(EXE) $(BIN_INSTALL_DIR)/$$i$(EXE) ; \
293 done;
294
295 install-man:
296 @if [ ! -d $(MAN_INSTALL_DIR) ] ; then \
297 echo "Making directory $(MAN_INSTALL_DIR)"; \
298 mkdir $(MAN_INSTALL_DIR); \
299 chmod 755 $(MAN_INSTALL_DIR); \
300 else true; \
301 fi;
302 @-(for i in `ls ./man/man?/*.?` ; \
303 do \
304 B=`basename $$i`; \
305 E=`echo $$i | awk -F. '{print $$NF}'`; \
306 M="$(MAN_INSTALL_DIR)/man$$E"; \
307 if [ ! -d $$M ] ; then \
308 echo "Making directory $$M"; \
309 mkdir $$M; \
310 chmod 755 $$M; \
311 else true; \
312 fi; \
313 echo "Installing $$B" ; \
314 $(INSTALL_DATA) $$i $$M/$$B; \
315 done;)
316
317 install-share:
318 @if [ ! -d $(MAN_SHARE_DIR) ] ; then \
319 echo "Making directory $(MAN_SHARE_DIR)"; \
320 mkdir -p $(MAN_SHARE_DIR); \
321 chmod 755 $(MAN_SHARE_DIR); \
322 else true; \
323 fi;
324 @-(for i in `ls ./doc/sman/xpa?.*` ; \
325 do \
326 B=`basename $$i`; \
327 echo "Installing $$B" ; \
328 $(INSTALL_DATA) $$i $(MAN_SHARE_DIR)/$$B; \
329 done;)
330
331 Makefile: Makefile.in
332 $(SHELL) config.status
333
334 clean:
335 $(RM) *.a *.so *.so.* *.dylib *.o *.exe core \
336 errs *pure* .nfs* \
337 foo* *~ *.log \#* TAGS *.E a.out errors \
338 $(PROGS) $(TESTPROGS) \
339 gmon.out *.pg *.bak \
340 config.info config.log \
341 doc/*~ doc/*.bak man/*~
342 $(RM) -r autom4te.cache a.out.dSYM
343
344 distclean: clean
345 $(RM) Makefile config.status config.cache config.log
346
347 maintainer-clean:: clean
348 $(RM) config.status config.cache config.log
349
350 depend:
351 makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
352
353 acl.o: acl.c $(INCL)
354 $(CC) -c $(CC_SWITCHES) acl.c
355
356 remote.o: remote.c $(INCL)
357 $(CC) -c $(CC_SWITCHES) remote.c
358
359 clipboard.o: clipboard.c $(INCL)
360 $(CC) -c $(CC_SWITCHES) clipboard.c
361
362 client.o: client.c $(INCL)
363 $(CC) -c $(CC_SWITCHES) client.c
364
365 command.o: command.c $(INCL)
366 $(CC) -c $(CC_SWITCHES) command.c
367
368 find.o: find.c
369 $(CC) -c $(CC_SWITCHES) find.c
370
371 xlaunch.o: xlaunch.c
372 $(CC) -c $(CC_SWITCHES) xlaunch.c
373
374 timedconn.o: timedconn.c
375 $(CC) -c $(CC_SWITCHES) timedconn.c
376
377 port.o: port.c $(INCL)
378 $(CC) -c $(CC_SWITCHES) port.c
379
380 tcl.o: tcl.c $(INCL)
381 $(CC) -c $(CC_SWITCHES) $(TCL_CFLAGS) tcl.c
382
383 tclloop.o: tclloop.c $(INCL)
384 $(CC) -c $(CC_SWITCHES) $(TCL_CFLAGS) tclloop.c
385
386 gtkloop.o: gtkloop.c $(INCL)
387 $(CC) -c $(CC_SWITCHES) $(GTK_CFLAGS) gtkloop.c
388
389 tcp.o: tcp.c
390 $(CC) -c $(CC_SWITCHES) tcp.c
391
392 word.o: word.c
393 $(CC) -c $(CC_SWITCHES) word.c
394
395 xalloc.o: xalloc.c
396 $(CC) -c $(CC_SWITCHES) xalloc.c
397
398 xpa.o: xpa.c $(INCL)
399 $(CC) -c $(CC_SWITCHES) xpa.c
400
401 xpaio.o: xpaio.c $(INCL)
402 $(CC) -c $(CC_SWITCHES) xpaio.c
403
404 xtloop.o: xtloop.c $(INCL)
405 $(CC) -c $(CC_SWITCHES) $(X_CFLAGS) xtloop.c
406
407 xpaaccess.o: xpaaccess.c $(INCL)
408 $(CC) -c $(CC_SWITCHES) xpaaccess.c
409
410 xpaget.o: xpaget.c $(INCL)
411 $(CC) -c $(CC_SWITCHES) xpaget.c
412
413 xpainfo.o: xpainfo.c $(INCL)
414 $(CC) -c $(CC_SWITCHES) xpainfo.c
415
416 xpans.o: xpans.c $(INCL)
417 $(CC) -c $(CC_SWITCHES) xpans.c
418
419 xpamb.o: xpamb.c $(INCL)
420 $(CC) -c $(CC_SWITCHES) xpamb.c
421
422 xpaset.o: xpaset.c $(INCL)
423 $(CC) -c $(CC_SWITCHES) xpaset.c
424
425 ctest.o: ctest.c
426 $(CC) -c $(CC_SWITCHES) ctest.c
427
428 stest.o: stest.c
429 $(CC) -c $(CC_SWITCHES) $(X_CFLAGS) stest.c
430
431 rtest.o: rtest.c
432 $(CC) -c $(CC_SWITCHES) $(X_CFLAGS) rtest.c
433
434 stestx.o: stest.c
435 $(CC) -o stest.o -c $(CC_SWITCHES) $(X_CFLAGS) \
436 -DBUILD_WITH_XT stest.c
437
438 strstr.o: ./compat/strstr.c
439 $(CC) -c $(CC_SWITCHES) -o strstr.o ./compat/strstr.c
440
441 xpa.h: configure.ac
442 @($(RM) -r oxpa.h; \
443 MAJOR=`echo "${VERSION}" | awk -F. '{print $$1}'`; \
444 MINOR=`echo "${VERSION}" | awk -F. '{print $$2}'`; \
445 PATCH=`echo "${VERSION}" | awk -F. '{print $$3}'`; \
446 sed "s/^#define XPA_VERSION.*/#define XPA_VERSION \"$(VERSION)\"/;s/^#define XPA_MAJOR_VERSION.*/#define XPA_MAJOR_VERSION $${MAJOR}/;s/^#define XPA_MINOR_VERSION.*/#define XPA_MINOR_VERSION $${MINOR}/;s/^#define XPA_PATCH_LEVEL.*/#define XPA_PATCH_LEVEL $${PATCH}/;" < xpa.h > nxpa.h; \
447 mv xpa.h oxpa.h; \
448 mv nxpa.h xpa.h)
449
450 configure: configure.ac
451 autoconf
452
453 dist: configure
454 ($(RM) -r $(DISTDIR); \
455 mkdir $(DISTDIR); \
456 cp -p *.[ch] *.tcl $(DISTDIR)/.; \
457 cp -p pkgIndex.tcl $(DISTDIR)/.; \
458 cp -p Makefile.in $(DISTDIR)/.; \
459 chmod 664 $(DISTDIR)/Makefile.in; \
460 cp -p conf.h.in $(DISTDIR)/.; \
461 chmod 664 $(DISTDIR)/conf.h.in; \
462 cp -p configure.ac $(DISTDIR)/.; \
463 chmod 644 $(DISTDIR)/configure.ac; \
464 cp -p *.m4 $(DISTDIR)/.; \
465 chmod 644 $(DISTDIR)/*.m4; \
466 cp -p configure $(DISTDIR)/.; \
467 chmod 755 $(DISTDIR)/configure; \
468 cp -p config.sub config.guess $(DISTDIR)/.; \
469 chmod 755 $(DISTDIR)/config.sub $(DISTDIR)/config.guess; \
470 cp -p saoconfig $(DISTDIR)/.; \
471 chmod 755 $(DISTDIR)/saoconfig; \
472 cp -p mklib $(DISTDIR)/.; \
473 chmod 755 $(DISTDIR)/mklib; \
474 cp -p install-sh $(DISTDIR)/install-sh; \
475 chmod 755 $(DISTDIR)/install-sh; \
476 cp -p README INSTALL COPYING $(DISTDIR)/.; \
477 mkdir $(DISTDIR)/doc; \
478 cp -p ./doc/*.html $(DISTDIR)/doc/.; \
479 cp -p ./doc/*.ps ./doc/*.pdf $(DISTDIR)/doc/.; \
480 cp -p ./doc/Makefile $(DISTDIR)/doc/.; \
481 mkdir $(DISTDIR)/doc/sman; \
482 cp -p ./doc/sman/* $(DISTDIR)/doc/sman/.; \
483 mkdir $(DISTDIR)/man; \
484 cp -p -R ./man/* $(DISTDIR)/man/.)
485
486 release: dist
487 (cd $(DISTDIR); cd ..; \
488 tar cf - $(DISTNAME) | \
489 gzip -9 -c > $(FTPDIR)/$(DISTNAME).tar.gz)
490
491 tar:
492 ($(RM) config.cache; \
493 cd ..; \
494 tar cf - $(DISTNAME) | gzip -9 -c > $(DISTNAME).tar.gz)
495
496 errcheck:
497 @-egrep 'error|warning' foo
498
499 itar:
500 (cd doc/sman; \
501 tar cf - . | gzip -9 -c > ../../../$(DISTNAME)-iman.tar.gz)
502
503 sman:
504 @(cd doc && $(MAKE) index)
505
506 docs:
507 @(cd doc; $(MAKE))
508
509 pure: xpaset.pure xpaget.pure xpainfo.pure xpaaccess.pure \
510 xpans.pure xpamb.pure ctest.pure stest.pure rtest.pure
511
512 xpaset.pure: $(LIB) xpaset.o
513 purify $(CC) $(LDFLAGS) xpaset.o -o xpaset.pure \
514 $(LLIB) $(LIBS)
515
516 xpaget.pure: $(LIB) xpaget.o
517 purify $(CC) $(LDFLAGS) xpaget.o -o xpaget.pure \
518 $(LLIB) $(LIBS)
519
520 xpainfo.pure: $(LIB) xpainfo.o
521 purify $(CC) $(LDFLAGS) xpainfo.o -o xpainfo.pure \
522 $(LLIB) $(LIBS)
523
524 xpaaccess.pure: $(LIB) xpaaccess.o
525 purify $(CC) $(LDFLAGS) xpaaccess.o -o xpaaccess.pure \
526 $(LLIB) $(LIBS)
527
528 xpans.pure: $(LIB) xpans.o
529 purify $(CC) $(LDFLAGS) xpans.o -o xpans.pure \
530 $(LLIB) $(LIBS) $(TLIB)
531
532 xpamb.pure: $(LIB) xpamb.o
533 purify $(CC) $(LDFLAGS) xpamb.o -o xpamb.pure \
534 $(LLIB) $(LIBS)
535
536 ctest.pure: $(LIB) ctest.o
537 purify $(CC) $(LDFLAGS) ctest.o -o ctest.pure \
538 $(LLIB) $(LIBS)
539
540 stest.pure: $(LIB) stest.o
541 purify $(CC) $(LDFLAGS) stest.o -o stest.pure $(LIB) \
542 $(X_LIBS) -lXt $(X_PRE_LIBS) -lXext -lX11 $(LIBS)
543
544 rtest.pure: $(LIB) rtest.o
545 purify $(CC) $(LDFLAGS) rtest.o -o rtest.pure \
546 $(LLIB) $(LIBS)
547
548 # DO NOT DELETE THIS LINE -- make depend depends on it.