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 
  26 PROG= priocntl
  27 
  28 PRIOCNTLOBJ=    $(PROG).o subr.o
  29 
  30 PRIOCNTLSRC= $(PRIOCNTLOBJ:%.o=%.c)
  31 OBJS= $(PRIOCNTLOBJ) rt$(PROG).o ts$(PROG).o ia$(PROG).o fss$(PROG).o \
  32         fx$(PROG).o sdc$(PROG).o
  33 SRCS= $(OBJ:%.o=%.c)
  34 
  35 include ../Makefile.cmd
  36 
  37 LDLIBS += -lcontract
  38 CERRWARN += -_gcc=-Wno-parentheses
  39 CERRWARN += -_gcc=-Wno-uninitialized
  40 
  41 CLASSD = $(ROOTLIB)/class
  42 RTD = $(CLASSD)/RT
  43 SDCD = $(CLASSD)/SDC
  44 TSD = $(CLASSD)/TS
  45 IAD = $(CLASSD)/IA
  46 FSSD = $(CLASSD)/FSS
  47 FXD = $(CLASSD)/FX
  48 DIRS = $(CLASSD) $(RTD) $(SDCD) $(TSD) $(IAD) $(FSSD) $(FXD)
  49 
  50 RTPROG = RT$(PROG)
  51 SDCPROG = SDC$(PROG)
  52 TSPROG = TS$(PROG)
  53 IAPROG = IA$(PROG)
  54 FSSPROG = FSS$(PROG)
  55 FXPROG = FX$(PROG)
  56 
  57 ROOTRTPROG = $(RTD)/$(RTPROG)
  58 ROOTSDCPROG = $(SDCD)/$(SDCPROG)
  59 ROOTTSPROG = $(TSD)/$(TSPROG)
  60 ROOTIAPROG = $(IAD)/$(IAPROG)
  61 ROOTFSSPROG = $(FSSD)/$(FSSPROG)
  62 ROOTFXPROG = $(FXD)/$(FXPROG)
  63 
  64 $(ROOTUSRSBINPROG) := FILEMODE = 04555
  65 $(DIRS) := FILEMODE = 0775
  66 CLOBBERFILES += $(RTPROG) $(SDCPROG) $(TSPROG) $(IAPROG) $(FSSPROG) $(FXPROG)
  67 
  68 # installation rules
  69 $(RTD)/% : %
  70         $(INS.file)
  71 
  72 $(SDCD)/% : %
  73         $(INS.file)
  74 
  75 $(TSD)/% : %
  76         $(INS.file)
  77 
  78 $(IAD)/% : %
  79         $(INS.file)
  80 
  81 $(FSSD)/% : %
  82         $(INS.file)
  83 
  84 $(FXD)/% : %
  85         $(INS.file)
  86 
  87 .KEEP_STATE:
  88 
  89 all: $(PROG) $(RTPROG) $(SDCPROG) $(TSPROG) $(IAPROG) $(FSSPROG) $(FXPROG)
  90 
  91 $(PROG): $(PRIOCNTLOBJ)
  92         $(LINK.c) $(PRIOCNTLOBJ) -o $@ $(LDLIBS)
  93         $(POST_PROCESS)
  94 
  95 $(RTPROG): rt$(PRIOCNTLOBJ)
  96         $(LINK.c) rt$(PRIOCNTLOBJ) -o $@ $(LDLIBS)
  97         $(POST_PROCESS)
  98 
  99 $(SDCPROG): sdc$(PRIOCNTLOBJ)
 100         $(LINK.c) sdc$(PRIOCNTLOBJ) -o $@ $(LDLIBS)
 101         $(POST_PROCESS)
 102 
 103 $(TSPROG): ts$(PRIOCNTLOBJ)
 104         $(LINK.c) ts$(PRIOCNTLOBJ) -o $@ $(LDLIBS)
 105         $(POST_PROCESS)
 106 
 107 $(IAPROG): ia$(PRIOCNTLOBJ)
 108         $(LINK.c) ia$(PRIOCNTLOBJ) -o $@ $(LDLIBS)
 109         $(POST_PROCESS)
 110 
 111 $(FSSPROG): fss$(PRIOCNTLOBJ)
 112         $(LINK.c) fss$(PRIOCNTLOBJ) -o $@ $(LDLIBS)
 113         $(POST_PROCESS)
 114 
 115 $(FXPROG): fx$(PRIOCNTLOBJ)
 116         $(LINK.c) fx$(PRIOCNTLOBJ) -o $@ $(LDLIBS)
 117         $(POST_PROCESS)
 118 
 119 install: all $(DIRS)    \
 120         $(ROOTPROG)     \
 121         $(ROOTRTPROG)   \
 122         $(ROOTSDCPROG)  \
 123         $(ROOTTSPROG)   \
 124         $(ROOTIAPROG)   \
 125         $(ROOTFSSPROG)  \
 126         $(ROOTFXPROG)
 127 
 128 $(DIRS):
 129         $(INS.dir)
 130 
 131 clean:
 132         $(RM) $(OBJS)
 133 
 134 lint:
 135         $(LINT.c) $(PRIOCNTLSRC) $(LDLIBS)
 136         $(LINT.c) rt$(PRIOCNTLSRC) $(LDLIBS)
 137         $(LINT.c) sdc$(PRIOCNTLSRC) $(LDLIBS)
 138         $(LINT.c) ts$(PRIOCNTLSRC) $(LDLIBS)
 139         $(LINT.c) ia$(PRIOCNTLSRC) $(LDLIBS)
 140         $(LINT.c) fss$(PRIOCNTLSRC) $(LDLIBS)
 141         $(LINT.c) fx$(PRIOCNTLSRC) $(LDLIBS)
 142 
 143 include ../Makefile.targ