1 #
   2 # Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
   3 #
   4 
   5 PROG=           in.ftpd ftpcount ftpshut ftprestart privatepw
   6 SCRIPTS=        ftpaddhost ftpconfig
   7 MANIFEST=       ftp.xml
   8 SVCMETHOD=      svc-ftp
   9 
  10 include         ../../../Makefile.cmd
  11 
  12 COMMON_OBJS=    COPYRIGHT.o vers.o
  13 FTPD_OBJS=      $(COMMON_OBJS) ftpd.o ftpcmd.o glob.o logwtmp.o popen.o \
  14                 access.o extensions.o realpath.o acl.o private.o \
  15                 authenticate.o conversions.o rdservers.o paths.o hostacc.o \
  16                 routevector.o restrict.o domain.o wu_fnmatch.o timeout.o \
  17                 getpwnam.o inet.o xferlog.o gssutil.o privs.o
  18 FTPCOUNT_OBJS=  $(COMMON_OBJS) ftpcount.o rdservers.o inet.o
  19 FTPSHUT_OBJS=   $(COMMON_OBJS) ftpshut.o rdservers.o inet.o
  20 FTPREST_OBJS=   $(COMMON_OBJS) ftprestart.o rdservers.o inet.o
  21 CKCONFIG_OBJS=  $(COMMON_OBJS) ckconfig.o rdservers.o inet.o
  22 PRIVATE_OBJS=   $(COMMON_OBJS) privatepw.o
  23 OBJS=           $(FTPD_OBJS) ftpcount.o ftpshut.o ftprestart.o ckconfig.o \
  24                 privatepw.o
  25 SRCS=           $(OBJS:%.o=%.c)
  26 CONFIGFILES=    ftpaccess ftpconversions ftpgroups ftphosts ftpservers ftpusers
  27 ETCFTPDDIR=     $(ROOTETC)/ftpd
  28 ETCFTPDFILES=   $(CONFIGFILES:%=$(ETCFTPDDIR)/%)
  29 $(ETCFTPDFILES):=       FILEMODE= 0644
  30 ROOTUSRSBINSCRIPTS=     $(SCRIPTS:%=$(ROOTUSRSBIN)/%)
  31 ROOTFTPCOUNT=   $(ROOTUSRSBIN)/ftpcount
  32 ROOTFTPWHO=     $(ROOTUSRSBIN)/ftpwho
  33 
  34 ROOTMANIFESTDIR=        $(ROOTSVCNETWORK)
  35 
  36 # I18n
  37 POFILE=         in.ftpd_all.po
  38 POFILES=        $(SCRIPTS:%=%.po)
  39 
  40 # When building for Solaris 8 add to CPPFLAGS:
  41 # -Ddn_skipname=__dn_skipname -DSOLARIS_NO_AUDIT_FTPD_LOGOUT
  42 CLOBBERFILES += ckconfig ftpwho $(SCRIPTS)
  43 CPPFLAGS +=     -DBSD_COMP -D_FILE_OFFSET_BITS=64 -DINET6 -DSOLARIS_BSM_AUDIT \
  44                 -DSOLARIS_ETC_FTPUSERS -DSENDFILE -DCLOSEFROM -DUSE_GSS \
  45                 -DSOLARIS_GSS_USEROK -DSOLARIS_PRIVS
  46 LDLIBS +=       -lsocket -lnsl -lpam -lbsm -lsendfile -lgss
  47 YFLAGS +=       -d
  48 
  49 CERRWARN +=     -_gcc=-Wno-implicit-function-declaration
  50 CERRWARN +=     -_gcc=-Wno-parentheses
  51 CERRWARN +=     -_gcc=-Wno-unused-variable
  52 CERRWARN +=     -_gcc=-Wno-uninitialized
  53 CERRWARN +=     -_gcc=-Wno-unused-label
  54 CERRWARN +=     -_gcc=-Wno-clobbered
  55 CERRWARN +=     -_gcc=-Wno-address
  56 
  57 in.ftpd :=      LDFLAGS += $(MAPFILE.NGB:%=-M%)
  58 
  59 # tcov output relies on atexit(3C) registered functions being called, so stop
  60 # _exit() from being used. Passing -l to yacc stops it generating #line
  61 # directives which don't work with tcov.
  62 tcov :=         CFLAGS += -xa
  63 tcov :=         CPPFLAGS += -D_exit=exit
  64 tcov :=         YFLAGS += -l
  65 
  66 .KEEP_STATE:
  67 
  68 all tcov:       $(PROG) ckconfig ftpwho $(CONFIGFILES) $(SCRIPTS)
  69 
  70 in.ftpd:        $(FTPD_OBJS) $(MAPFILE.NGB)
  71                 $(LINK.c) $(FTPD_OBJS) -o $@ $(LDLIBS)
  72                 $(POST_PROCESS)
  73 
  74 ftpcount:       $(FTPCOUNT_OBJS)
  75                 $(LINK.c) $(FTPCOUNT_OBJS) -o $@ -lsocket -lnsl
  76                 $(POST_PROCESS)
  77 
  78 ftpwho:         ftpcount
  79                 $(RM) $@
  80                 $(LN) ftpcount $@
  81 
  82 ftpshut:        $(FTPSHUT_OBJS)
  83                 $(LINK.c) $(FTPSHUT_OBJS) -o $@ -lsocket -lnsl
  84                 $(POST_PROCESS)
  85 
  86 ftprestart:     $(FTPREST_OBJS)
  87                 $(LINK.c) $(FTPREST_OBJS) -o $@ -lsocket -lnsl
  88                 $(POST_PROCESS)
  89 
  90 ckconfig:       $(CKCONFIG_OBJS)
  91                 $(LINK.c) $(CKCONFIG_OBJS) -o $@ -lsocket -lnsl
  92                 $(POST_PROCESS)
  93 
  94 privatepw:      $(PRIVATE_OBJS)
  95                 $(LINK.c) $(PRIVATE_OBJS) -o $@
  96                 $(POST_PROCESS)
  97 
  98 # This causes y.tab.c to be renamed to ftpcmd.c, needed by tcov.
  99 ftpcmd.c:       ftpcmd.y
 100 
 101 $(ETCFTPDDIR)/%: %
 102                 $(INS.file)
 103 
 104 $(POFILE):      $(POFILES)
 105                 $(RM) $@
 106                 cat $(POFILES) >$@
 107 
 108 $(ROOTFTPWHO):  $(ROOTFTPCOUNT)
 109                 $(RM) $@
 110                 $(LN) $(ROOTFTPCOUNT) $@
 111 
 112 install:        all $(ROOTUSRSBINPROG) $(ROOTFTPWHO) $(ROOTUSRSBINSCRIPTS) \
 113                 $(ETCFTPDFILES) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
 114 
 115 check:          $(CHKMANIFEST)
 116 
 117 clean:
 118                 $(RM) $(OBJS) *.d *.tcov y.tab.h y.tab.c ftpcmd.c
 119 
 120 lint:           lint_SRCS
 121 
 122 include         ../../../Makefile.targ