1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 #
  22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23 # Use is subject to license terms.
  24 #
  25 # Copyright 2017 RackTop Systems.
  26 #
  27 # Makefile for policy testing code
  28 #
  29 
  30 PROG =  kmfcfg
  31 
  32 OBJS =  kmfcfg.o \
  33         list.o \
  34         delete.o \
  35         util.o \
  36         create.o \
  37         modify.o \
  38         export.o \
  39         import.o \
  40         install.o \
  41         uninstall.o
  42 
  43 include ../../Makefile.cmd
  44 
  45 KMFDIR          = $(SRC)/lib/libkmf
  46 SRCS            = $(OBJS:%.o=%.c)
  47 
  48 POFILES         = $(OBJS:%.o=%.po)
  49 POFILE          = $(PROG)_msg.po
  50 MSGFILES        = $(SRCS:%.c=%.i)
  51 
  52 CPPFLAGS        += -I$(ADJUNCT_PROTO)/usr/include/libxml2 \
  53                 -I$(KMFDIR)/include -I.
  54 LDLIBS          += -L$(ROOT)/usr/lib -lkmf -lcryptoutil
  55 XMLLIB          = -lxml2
  56 
  57 # Allow libxml2 to be taken from outside the proto area.
  58 $(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libxml2.so
  59 
  60 .KEEP_STATE:
  61 
  62 XMLDIR=         $(ROOT)/etc/security
  63 DTDDIR=         $(ROOT)/usr/share/lib/xml/dtd
  64 ROOTDTDS=       $(DTDDIR)/kmfpolicy.dtd
  65 ROOTXML=        $(XMLDIR)/kmfpolicy.xml
  66 
  67 $(ROOTDTDS) :=  FILEMODE = 444
  68 
  69 $(ROOTXML)  :=  FILEMODE = 644
  70 
  71 all:    $(PROG) $(ROOTDTDS)
  72 
  73 $(PROG): $(OBJS)
  74         $(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(XMLLIB)
  75         $(POST_PROCESS)
  76 
  77 $(POFILE):      $(POFILES)
  78         $(RM) $@; $(CAT) $(POFILES) > $@
  79 
  80 install:        all $(ROOTDTDS) $(ROOTXML) $(ROOTPROG)
  81 
  82 $(XMLDIR)/%: %
  83         $(INS.file)
  84 
  85 $(DTDDIR)/%: %
  86         $(INS.file)
  87 
  88 clean:
  89         $(RM) $(OBJS)
  90 
  91 lint : lint_SRCS
  92 
  93 include ../../Makefile.targ