Import upstream 2.3.14
[packages/xinetd.git] / libs / src / portable / Makefile.in
1 # (c) Copyright 2001 by Rob Braun
2 # All rights reserved.  The file named COPYRIGHT specifies the terms 
3 # and conditions for redistribution.
4
5 NAME                    = portable
6 VPATH                   = @srcdir@
7 SRCDIR                  = @srcdir@
8
9 HEADERS                 = $(SRCDIR)/libportable.h 
10 SOURCES                 = difftime.c inet_aton.c strerror.c fake-getnameinfo.c \
11                           inet_ntop.c cvt.c
12 OBJECTS                 = difftime.o inet_aton.o strerror.o fake-getnameinfo.o \
13                           inet_ntop.o cvt.o
14
15 INCLUDEFILES            = $(HEADERS)
16
17 # The following variables are used by the 'install' entry and
18 # should be customized:
19 #     LIBDIR:     where the library will be placed
20 #     INCUDEDIR:  where the include files will be placed
21 #     MANDIR:     where the man pages will be placed
22 #
23 #LIBDIR                 = $(HOME)/.links/libraries/$(ARCH)
24 #MANDIR                 = $(HOME)/.links/manpages/man3
25 #INCLUDEDIR             = $(HOME)/.links/includes
26 LIBDIR                  = ../../lib
27 MANDIR                  = ../../man
28 INCLUDEDIR              = ../../include
29
30 #
31 # Possible flags:
32 #     -DOLD_DIR         : must include <sys/dir.h> instead of <dirent.h>
33 #
34
35 DEBUG                   = -g                            # -g or -O
36
37 CPP_DEFS                = 
38
39 #
40 # The following variables shouldn't need to be changed
41 #
42 CPP_FLAGS               = $(CPP_DEFS)
43 CC_FLAGS                = $(DEBUG)
44 CFLAGS                  = @CFLAGS@ $(CPP_FLAGS) $(CC_FLAGS) -I$(INCLUDEDIR)
45
46 INSTALL                 = @INSTALL@
47 FMODE                   = -m 640                # used by install
48 RANLIB                  = @RANLIB@
49
50 LIBNAME                 = lib$(NAME).a
51
52 lib: $(LIBNAME)
53
54 libopt: clean
55         make DEBUG=-O lib
56         mv $(LIBNAME) $(LIBDIR)/optimized
57
58
59 $(LIBNAME): $(OBJECTS)
60         ar r $@ $?
61         $(RANLIB) $@
62
63 install: $(LIBNAME)
64         @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
65         then \
66                 $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
67                 ${RANLIB} $(LIBDIR)/$(LIBNAME) ;\
68                 echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
69                 for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
70                 echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
71         else \
72                 echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
73         fi
74
75 uninstall:
76         a=`pwd` ; cd $(INCLUDEDIR) ;\
77         if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
78         a=`pwd` ; cd $(LIBDIR) ;\
79         if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
80
81 clean:
82         rm -f $(OBJECTS) $(LIBNAME) core
83         rm -f *.swp
84         rm -f *.?~ 
85
86 spotless: clean uninstall
87
88 distclean: clean
89         rm -f Makefile
90
91 #
92 # PUT HERE THE RULES TO MAKE THE OBJECT FILES
93 #
94 # None special