added lint targets for Makefiles and a configure test to find whether lclint or lint...
[mmh] / uip / Makefile.in
index c292bd2..b1e3950 100644 (file)
@@ -30,9 +30,13 @@ HESIOD_LIBS = @HESIOD_LIBS@
 LOCALLIBS = ../config/version.o ../config/config.o ../sbr/libmh.a ../$(MTSLIB) ../zotnet/libzot.a
 LINKLIBS = $(LOCALLIBS) $(KRB4_LIBS) $(HESIOD_LIBS) $(LIBS)
 
+LINT   = @LINT@
+LINTFLAGS = @LINTFLAGS@
+
 TERMLIB = @TERMLIB@
 LEXLIB  = @LEXLIB@
-POPLIB  = @POPLIB@
+APOPLIB = @APOPLIB@
+POPLIB  = @POPLIB@ $(APOPLIB)
 
 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
 LINK    = $(CC) $(LDFLAGS) -o $@
@@ -41,6 +45,9 @@ LN = ln
 INSTALL         = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 
+MAIL_SPOOL_GRP = @MAIL_SPOOL_GRP@
+SETGID_MAIL    = @SETGID_MAIL@
+
 .SUFFIXES:
 .SUFFIXES: .c .o
 
@@ -48,10 +55,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
        $(COMPILE) $<
 
 # commands to build
-CMDS = ali anno burst comp dist flist folder forw inc mark mhbuild \
-       mhlist mhmail mhn mhparam mhpath mhshow mhstore mhtest msgchk \
+CMDS = ali anno burst comp dist flist folder forw mark mhbuild \
+       mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk \
        msh packf pick prompter refile repl rmf rmm scan send show \
-       sortm viamail whatnow whom
+       sortm whatnow whom
 
 ## removed this from CMDS until I can fix it
 ## OTHERCMDS = vmh
@@ -61,7 +68,10 @@ LCMDS = flists folders next prev
 
 # misc support binaries
 MISC = ap conflict dp fmtdump install-mh mhl post rcvdist rcvpack \
-       rcvstore rcvtty slocal spost
+       rcvstore rcvtty slocal spost viamail mhtest
+
+# commands with 'S'pecial installation needs
+SCMDS = inc
 
 # source files
 SRCS = ali.c aliasbr.c anno.c annosbr.c ap.c burst.c comp.c \
@@ -84,7 +94,7 @@ DIST = $(SRCS) $(AUX)
 
 # ========== DEFAULT TARGET ==========
 
-all: $(CMDS) $(MISC)
+all: $(CMDS) $(MISC) $(SCMDS)
 
 # ========= DEPENDENCIES FOR BUILDING ==========
 
@@ -238,7 +248,7 @@ whom: whom.o distsbr.o $(LOCALLIBS)
 # ========== DEPENDENCIES FOR INSTALLING ==========
 
 # install everything
-install: install-cmds install-lcmds install-misc
+install: install-cmds install-lcmds install-misc install-scmds
 
 # install commands
 install-cmds:
@@ -265,6 +275,14 @@ install-misc:
          $(INSTALL_PROGRAM) $$misc $(libdir)/$$misc; \
        done
 
+# install commands with special installation needs (thus no $(SCMDS) use here)
+install-scmds:
+       if test x$(SETGID_MAIL) != x; then \
+         $(INSTALL_PROGRAM) -g $(MAIL_SPOOL_GRP) -m 2755 inc $(bindir)/$$cmd; \
+       else \
+         $(INSTALL_PROGRAM)                 inc $(bindir)/$$cmd; \
+       fi
+
 uninstall:
        for cmd in $(CMDS); do \
          rm -f $(bindir)/$$cmd; \
@@ -275,6 +293,9 @@ uninstall:
        for misc in $(MISC); do \
          rm -f $(libdir)/$$misc; \
        done
+       for cmd in $(SCMDS); do \
+         rm -f $(bindir)/$$cmd; \
+       done
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
 
@@ -282,7 +303,7 @@ mostlyclean:
        rm -f *.o *~
 
 clean: mostlyclean
-       rm -f $(CMDS) $(MISC)
+       rm -f $(CMDS) $(MISC) $(SCMDS)
 
 distclean: clean
        rm -f Makefile
@@ -291,6 +312,11 @@ realclean: distclean
 
 superclean: realclean
 
+# ========== DEPENDENCIES FOR LINT  ================
+
+lint: 
+       $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
+
 # ========== DEPENDENCIES FOR MAINTENANCE ==========
 
 subdir = uip