1# (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
2# All rights reserved.  The file named COPYRIGHT specifies the terms
3# and conditions for redistribution.
4
5#
6# $Id: Makefile.in,v 1.1.1.1 2003-02-19 17:29:27 bbraun Exp $
7#
8# Based on Library makefile template: *Revision: 1.15 *
9#
10
11NAME			= sio
12VPATH			= @srcdir@
13SRCDIR			= @srcdir@
14
15HEADERS			= sio.h impl.h sioconf.h
16SOURCES			= sprint.c sio.c siosup.c
17OBJECTS			= sprint.o sio.o siosup.o
18
19MANFILES		= $(SRCDIR)/sio.3 $(SRCDIR)/Sprint.3
20INCLUDEFILES		= $(SRCDIR)/sio.h
21
22# The following variables are used by the 'install' entry and
23# should be customized:
24#     LIBDIR:     where the library will be placed
25#     INCUDEDIR:  where the include files will be placed
26#     MANDIR:     where the man pages will be placed
27LIBDIR			= ../../lib
28MANDIR			= ../../man
29INCLUDEDIR		= ../../include
30
31DEBUG		= -g			# -g or -O
32
33CPP_DEFS	=
34
35#
36# The following variables shouldn't need to be changed
37#
38CPP_FLAGS		= $(CPP_DEFS)
39CC_FLAGS		= $(DEBUG)
40CFLAGS			= @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) -I$(INCLUDEDIR)
41
42INSTALL			= @INSTALL@
43FMODE			= -m 640			# used by install
44RANLIB			= @RANLIB@
45
46LIBNAME			= lib$(NAME).a
47
48lib: $(LIBNAME)
49
50libopt: clean
51	make DEBUG=-O lib
52	$(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
53
54$(LIBNAME): $(OBJECTS)
55	ar r $@ $?
56	$(RANLIB) $@
57
58install: $(LIBNAME)
59	@if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
60	then \
61		$(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
62		$(RANLIB) $(LIBDIR)/$(LIBNAME) ;\
63		echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
64		for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
65		echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
66		for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
67		echo Installed $(MANFILES) to $(MANDIR) ;\
68	else \
69		echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
70	fi
71
72uninstall:
73	a=`pwd` ; cd $(INCLUDEDIR) ;\
74	if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
75	a=`pwd` ; cd $(LIBDIR) ;\
76	if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
77	a=`pwd` ; cd $(MANDIR) ;\
78	if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
79
80clean:
81	rm -f $(OBJECTS) $(LIBNAME) core
82	rm -f *.swp
83	rm -f *.?~
84
85spotless: clean uninstall
86
87distclean: clean
88	rm -f Makefile
89
90#
91# PUT HERE THE RULES TO MAKE THE OBJECT FILES
92#
93sprint.o:   sio.h impl.h sioconf.h
94sio.o:      sio.h impl.h sioconf.h
95siosup.o:   sio.h impl.h sioconf.h
96
97