1 #
   2 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   3 # Use is subject to license terms.
   4 #
   5 # cmd/cmd-inet/usr.bin/pppd/Makefile
   6 #
   7 
   8 include         ../../../Makefile.cmd
   9 include         Makefile.def
  10 
  11 PROG=           pppd
  12 SUBDIRS=        plugins
  13 OBJS=           auth.o ccp.o chap.o demand.o fsm.o ipcp.o ipv6cp.o \
  14                 lcp.o magic.o main.o options.o sys-solaris.o upap.o utils.o \
  15                 multilink.o cbcp.o
  16 
  17 # Object tdb.o used only for Multilink; not supported yet.
  18 
  19 all:=           TARGET= all
  20 install:=       TARGET= install
  21 clean:=         TARGET= clean
  22 clobber:=       TARGET= clobber
  23 lint:=          TARGET= lint
  24 
  25 LDLIBS +=       -lpam -lmd -lsocket -lnsl -ldlpi
  26 
  27 #
  28 # We need absolute path to /etc/ppp/plugins and /usr/lib/inet/ppp, not
  29 # that of the proto area
  30 #
  31 LDFLAGS +=      -R$(ETCPPPPLUGINDIR_ABS) -R$(LIBPPPPLUGINDIR_ABS)
  32 
  33 CPPFLAGS +=     -DPLUGIN -DSVR4 -DSOL2 -DINET6
  34 CPPFLAGS +=     -D_PATH_VARRUN='"/var/run/"'
  35 CPPFLAGS +=     -DNEGOTIATE_FCS -DCBCP_SUPPORT -DALLOW_PAM -DHAS_SHADOW
  36 CPPFLAGS +=     -DHAVE_MMAP -DCOMP_TUNE -DMUX_FRAME
  37 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
  38 
  39 .KEEP_STATE:
  40 
  41 .PARALLEL:      $(SUBDIRS)
  42 
  43 all:            $(PROG) $(SUBDIRS)
  44 
  45 # MS-CHAP support
  46 CPPFLAGS +=     -DHAVE_CRYPT_H -DUSE_CRYPT -DHAVE_LIBMD
  47 CPPFLAGS +=     -DCHAPMS -DMSLANMAN
  48 CPPFLAGS +=     -DCHAPMSV2
  49 OBJS +=         chap_ms.o
  50 EXOBJS +=       mschap_test.o
  51 CLOBBERFILES += mschap_test
  52 
  53 CERRWARN +=     -_gcc=-Wno-uninitialized
  54 
  55 # This is used *only* for testing the portability of the libraries
  56 # required for MS-CHAPv1.  It is not needed in any normal system and
  57 # is not built by default.
  58 mschap_test:    mschap_test.o chap_ms.o
  59         $(LINK.c) -o mschap_test mschap_test.o chap_ms.o $(LDFLAGS) -lmd
  60         @echo "Run with 'mschap_test 00000000000000000000000000000000 hello'"
  61         @echo
  62         @echo "Output should be:"
  63         @echo
  64         @echo " MS-CHAPv1 with LAN Manager -- 49 bytes:"
  65         @echo "  C9 CA EE 9B 1C A7 87 04"
  66         @echo "  79 36 8C 55 AB 88 EC 5A"
  67         @echo "  57 E9 A1 B7 95 40 C3 74"
  68         @echo "  F4 D9 9D AF 82 64 DC 3C"
  69         @echo "  53 F9 BC 92 14 B5 5D 9E"
  70         @echo "  78 C4 21 48 9D B7 A8 B4"
  71         @echo "  01"
  72         @echo "  MS-CHAPv2 -- 49 bytes:"
  73         @echo "  xx xx xx xx xx xx xx xx"
  74         @echo "  xx xx xx xx xx xx xx xx"
  75         @echo "  00 00 00 00 00 00 00 00"
  76         @echo "  xx xx xx xx xx xx xx xx"
  77         @echo "  xx xx xx xx xx xx xx xx"
  78         @echo "  xx xx xx xx xx xx xx xx"
  79         @echo "  00"
  80 
  81 LINTFLAGS +=    -erroff=E_NAME_DEF_NOT_USED2
  82 
  83 SRCS=           $(OBJS:%.o=%.c)
  84 
  85 .PARALLEL:      $(OBJS)
  86 
  87 $(PROG):        $(OBJS)
  88         $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
  89         $(POST_PROCESS)
  90 
  91 $(ROOTPROG):=   FILEMODE = 04555
  92 
  93 ASPPP2PPPD=     $(ROOTUSRSBIN)/asppp2pppd
  94 $(ASPPP2PPPD):= FILEMODE = 0550
  95 
  96 install:        $(PROG) .WAIT $(SUBDIRS) $(ROOTPROG) $(ETCPPPDIR) $(ASPPP2PPPD)
  97 
  98 $(ETCPPPDIR)/%: %
  99         $(INS.file)
 100 
 101 $(ETCPPPDIR):
 102         $(INS.dir)
 103 
 104 $(SUBDIRS):     FRC
 105         @cd $@; pwd; $(MAKE) $(TARGET)
 106 
 107 FRC:
 108 
 109 LINTOBJS=$(OBJS:%.o=%.ln)
 110 CLOBBERFILES += $(LINTOBJS)
 111 
 112 clean:          $(SUBDIRS)
 113         $(RM) $(OBJS) $(EXOBJS)
 114 
 115 sha1.ln:=       LINTFLAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
 116 
 117 # Not using the default lint target here so that we can disable
 118 # warnings per module as needed.
 119 lint:           $(SUBDIRS) $(LINTOBJS)
 120         $(LINT.c) $(LINTOBJS) $(LDLIBS)
 121 
 122 clobber:        $(SUBDIRS)
 123 
 124 include         ../../../Makefile.targ