home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / xinetd / xlog.1.0.9 / Makefile < prev    next >
Encoding:
Makefile  |  1993-01-07  |  3.6 KB  |  147 lines

  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,v 1.13 1993/01/08 01:38:55 panos Exp $
  7. #
  8. # Based on Library makefile template: *Revision: 1.15 *
  9. #
  10.  
  11. # Available entries:
  12. #         lib             --> creates the library
  13. #        install        --> installs the library (archive, man page(s), header(s))
  14. #        uninstall    --> uninstall the library
  15. #        clean            --> removes all .o and .a files
  16. #        spotless        --> clean + uninstall
  17. #         lint            --> lints a file (usage: make lint MODULE=foo.c)
  18. #        tags            --> creates a tags file (from the SOURCES and HEADERS)
  19. #        checkout     --> checkout all files
  20. #        dist            --> distribution support
  21. #
  22.  
  23. NAME                = xlog
  24. VERSION            = 1.0.9
  25.  
  26. HEADERS            = xlog.h impl.h slog.h filelog.h
  27. SOURCES            = xlog.c filelog.c slog.c util.c
  28. OBJECTS            = xlog.o filelog.o slog.o util.o
  29.  
  30. MANFILES            = xlog.3
  31. INCLUDEFILES    = xlog.h
  32.  
  33. # The following variables are used by the 'install' entry and
  34. # should be customized:
  35. #     LIBDIR:     where the library will be placed
  36. #     INCUDEDIR:  where the include files will be placed
  37. #     MANDIR:     where the man pages will be placed
  38. #
  39. LIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  40. MANDIR            = $(HOME)/.links/manpages/man3
  41. INCLUDEDIR        = $(HOME)/.links/includes
  42.  
  43. #
  44. # Flags:
  45. #     -DNO_SYSLOG
  46. #
  47. DEFS                =                # used for command line defined flags
  48.  
  49. DEBUG                = -g            # -g or -O
  50. VERSION_DEF        = -DVERSION=\"XLOG\ Version\ $(VERSION)\"
  51.  
  52. CPP_DEFS            = $(VERSION_DEF) $(DEFS)
  53.  
  54. #
  55. # The following variables shouldn't need to be changed
  56. #
  57. LINT_FLAGS        = -hbux
  58. CPP_FLAGS        = $(CPP_DEFS) -I$(INCLUDEDIR)
  59. CC_FLAGS            = $(DEBUG)
  60. CFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  61.  
  62. INSTALL            = install -c
  63. FMODE                = -m 640            # used by install
  64. RANLIB            = ranlib
  65.  
  66. PAGER                = less
  67.  
  68.  
  69. LIBNAME            = lib$(NAME).a
  70.  
  71. lib: $(LIBNAME)
  72.  
  73. libopt: clean
  74.     make DEBUG=-O lib
  75.     $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
  76.  
  77. $(LIBNAME): $(OBJECTS)
  78.     ar r $@ $?
  79.     $(RANLIB) $@
  80.  
  81. lint:
  82.     lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | $(PAGER)
  83.  
  84. install: $(LIBNAME)
  85.     @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  86.     then \
  87.         $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  88.         echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  89.         for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  90.         echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  91.         for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  92.         echo Installed $(MANFILES) to $(MANDIR) ;\
  93.     else \
  94.         echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  95.     fi
  96.  
  97. uninstall:
  98.     a=`pwd` ; cd $(INCLUDEDIR) ;\
  99.     if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  100.     a=`pwd` ; cd $(LIBDIR) ;\
  101.     if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  102.     a=`pwd` ; cd $(MANDIR) ;\
  103.     if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  104.  
  105. clean:
  106.     rm -f $(OBJECTS) $(LIBNAME) core
  107.  
  108. spotless: clean uninstall
  109.  
  110. tags: $(SOURCES) $(HEADERS)
  111.     ctags -w $(SOURCES) $(HEADERS)
  112.  
  113. checkout:
  114.     co $(SOURCES) $(HEADERS) $(MANFILES)
  115.  
  116. #
  117. # Distribution section
  118. # This section contains the 2 targets for distribution support: dist, dirs
  119. # "dist" checks out all files to be distributed
  120. # "dirs" prints a list of directories to be included in the distribution.
  121. # These directories should have a Makefile with a "dist" target
  122. #
  123. DISTRIBUTION_FILES    = $(SOURCES) $(HEADERS) $(MANFILES)
  124. DIRS                        =
  125.  
  126. dist:
  127.     -co -q $(DISTRIBUTION_FILES)
  128.  
  129. dirs:
  130.     @echo $(DIRS)
  131.  
  132. #
  133. # PUT HERE THE RULES TO MAKE THE OBJECT FILES
  134. #
  135. xlog.o:            xlog.h impl.h
  136. filelog.o:        xlog.h impl.h filelog.h
  137. slog.o:            xlog.h impl.h slog.h
  138.  
  139. #
  140. # Test program
  141. #
  142. xlt: xlt.c $(LIBNAME)
  143.     $(CC) -g -o $@ xlt.c $(LIBNAME) -L$(LIBDIR) -lstr -lsio
  144.  
  145.  
  146.