Import upstream 2.3.14
[packages/xinetd.git] / libs / src / misc / Makefile.in
1 # (c) Copyright 1992 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
11 NAME                    = misc
12 VPATH                   = @srcdir@
13 SRCDIR                  = @srcdir@
14
15 HEADERS                 = $(SRCDIR)/misc.h $(SRCDIR)/m_env.h
16 SOURCES                 = misc.c m_env.c
17 OBJECTS                 = misc.o m_env.o
18
19 MANFILES                = $(SRCDIR)/misc.3 $(SRCDIR)/m_env.3
20 INCLUDEFILES            = $(HEADERS)
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
27 #
28 #LIBDIR                 = $(HOME)/.links/libraries/$(ARCH)
29 #MANDIR                 = $(HOME)/.links/manpages/man3
30 #INCLUDEDIR             = $(HOME)/.links/includes
31 LIBDIR                  = ../../lib
32 MANDIR                  = ../../man
33 INCLUDEDIR              = ../../include
34
35 #
36 # Possible flags:
37 #     -DOLD_DIR         : must include <sys/dir.h> instead of <dirent.h>
38 #
39
40 DEBUG                   = -g                            # -g or -O
41
42 CPP_DEFS                = 
43
44 #
45 # The following variables shouldn't need to be changed
46 #
47 CPP_FLAGS               = $(CPP_DEFS)
48 CC_FLAGS                = $(DEBUG)
49 CFLAGS                  = @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) -I$(INCLUDEDIR)
50
51 INSTALL                 = @INSTALL@
52 FMODE                   = -m 640                # used by install
53 RANLIB                  = @RANLIB@
54
55 LIBNAME                 = lib$(NAME).a
56
57 lib: $(LIBNAME)
58
59 libopt: clean
60         make DEBUG=-O lib
61         mv $(LIBNAME) $(LIBDIR)/optimized
62
63
64 $(LIBNAME): $(OBJECTS)
65         ar r $@ $?
66         $(RANLIB) $@
67
68 install: $(LIBNAME)
69         @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
70         then \
71                 $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
72                 ${RANLIB} $(LIBDIR)/$(LIBNAME) ;\
73                 echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
74                 for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
75                 echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
76                 for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
77                 echo Installed $(MANFILES) to $(MANDIR) ;\
78         else \
79                 echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
80         fi
81
82 uninstall:
83         a=`pwd` ; cd $(INCLUDEDIR) ;\
84         if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
85         a=`pwd` ; cd $(LIBDIR) ;\
86         if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
87         a=`pwd` ; cd $(MANDIR) ;\
88         if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
89
90 clean:
91         rm -f $(OBJECTS) $(LIBNAME) core
92         rm -f *.swp
93         rm -f *.?~ 
94
95 spotless: clean uninstall
96
97 distclean: clean
98         rm -f Makefile
99
100 #
101 # PUT HERE THE RULES TO MAKE THE OBJECT FILES
102 #
103 misc.o:         misc.h
104 m_env.o:        m_env.h misc.h
105