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 2008 Sun Microsystems, Inc.  All rights reserved.
  23 # Use is subject to license terms.
  24 #
  25 
  26 SUBDIR =        sunos   
  27 
  28 HAL_PROG =      hal-device hal-find-by-capability hal-find-by-property \
  29                 hal-get-property hal-set-property lshal
  30 
  31 HAL_LIB =       hal-is-caller-privileged
  32 
  33 SCRIPT_BIN =    hal-fdi-validate
  34 
  35 SCRIPT_LIB =    hal-system-lcd-set-brightness  hal-system-lcd-get-brightness \
  36                 hal-system-power-hibernate hal-system-power-suspend \
  37                 hal-system-power-reboot hal-system-power-shutdown hal-functions
  38 
  39 STORAGE_METHOD_PROG = hal-storage-closetray hal-storage-eject \
  40                 hal-storage-mount hal-storage-unmount \
  41                 hal-storage-zpool-export hal-storage-zpool-import
  42 
  43 STORAGE_PROG =  $(STORAGE_METHOD_PROG) \
  44                 hal-storage-cleanup-mountpoint \
  45                 hal-storage-cleanup-all-mountpoints
  46 
  47 PROGSRCS =      $(PROG:%=%.c) $(STORAGE_PROG:%=%.c)
  48 
  49 
  50 STORAGE_OBJS =          $(STORAGE_PROG:%=%.o)
  51 STORAGE_SHAREDOBJS =    hal-storage-shared.o adt_data.o
  52 STORAGE_SHAREDSRCS =    $(STORAGE_SHAREDOBJS:%.o=%.c) $(STORAGE_SHAREDOBJS:%.o=../utils/%.c)
  53 
  54 SRCS =          $(PROGSRCS) $(STORAGE_SHAREDSRCS)
  55 
  56 CLOBBERFILES += $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB)
  57 CLEANFILES += $(STORAGE_SHAREDOBJS) $(STORAGE_OBJS) hal-storage-zpool.o
  58 
  59 include ../../Makefile.cmd
  60 include ../Makefile.hal
  61 
  62 $(HAL_PROG) :=          LDLIBS += -lc -ldbus-1 -lhal
  63 
  64 lshal :=                LDLIBS += -ldbus-glib-1 -lglib-2.0
  65 
  66 $(HAL_LIB) :=   LDLIBS += -lc -ldbus-1 -lpolkit $(ZIGNORE) -lglib-2.0
  67 
  68 $(STORAGE_PROG) :=      LDLIBS += -lc -ldbus-1 -lglib-2.0 -lhal -lhal-storage -lbsm
  69 
  70 $(STORAGE_METHOD_PROG) := LDLIBS += -lpolkit
  71 
  72 CPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
  73 CPPFLAGS += -I$(ROOT)/usr/include/hal
  74 CPPFLAGS += -I$(ROOT)/usr/include/libpolkit
  75 C99MODE = $(C99_ENABLE)
  76 
  77 ROOTUSRSBINPROG =       $(HAL_PROG:%=$(ROOTUSRSBIN)/%) \
  78                         $(SCRIPT_BIN:%=$(ROOTUSRSBIN)/%)
  79 
  80 ROOTCMDDIR =            $(ROOTLIB_HAL)
  81 ROOTCMD =               $(STORAGE_PROG:%=$(ROOTCMDDIR)/%) \
  82                         $(HAL_LIB:%=$(ROOTCMDDIR)/%) \
  83                         $(SCRIPT_LIB:%=$(ROOTCMDDIR)/%)
  84 
  85 all :=          TARGET= all
  86 install :=      TARGET= install
  87 clean :=        TARGET= clean
  88 clobber :=      TARGET= clobber
  89 
  90 .KEEP_STATE:
  91 
  92 all: $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB) $(SUBDIR)
  93 
  94 hal-storage-shared.o: hal-storage-shared.c
  95         $(COMPILE.c) -o $@ hal-storage-shared.c
  96 
  97 adt_data.o: ../utils/adt_data.c
  98         $(COMPILE.c) -o $@ ../utils/adt_data.c
  99 
 100 hal-storage-closetray: hal-storage-closetray.o $(STORAGE_SHAREDOBJS)
 101         $(LINK.c) hal-storage-closetray.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
 102         $(POST_PROCESS)
 103 
 104 hal-storage-eject: hal-storage-eject.o $(STORAGE_SHAREDOBJS)
 105         $(LINK.c) hal-storage-eject.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
 106         $(POST_PROCESS)
 107 
 108 hal-storage-mount: hal-storage-mount.o $(STORAGE_SHAREDOBJS)
 109         $(LINK.c) hal-storage-mount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
 110         $(POST_PROCESS)
 111 
 112 hal-storage-unmount: hal-storage-unmount.o $(STORAGE_SHAREDOBJS)
 113         $(LINK.c) hal-storage-unmount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
 114         $(POST_PROCESS)
 115 
 116 hal-storage-cleanup-mountpoint: hal-storage-cleanup-mountpoint.c \
 117                 $(STORAGE_SHAREDOBJS)
 118         $(LINK.c) hal-storage-cleanup-mountpoint.c \
 119                 $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
 120         $(POST_PROCESS)
 121 
 122 hal-storage-cleanup-all-mountpoints: hal-storage-cleanup-all-mountpoints.c \
 123                 $(STORAGE_SHAREDOBJS)
 124         $(LINK.c) hal-storage-cleanup-all-mountpoints.c \
 125                 $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
 126         $(POST_PROCESS)
 127 
 128 hal-storage-zpool-export: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
 129         $(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"export\" hal-storage-zpool.c $(LDLIBS)
 130         $(POST_PROCESS)
 131 
 132 hal-storage-zpool-import: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
 133         $(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"import\" hal-storage-zpool.c $(LDLIBS)
 134         $(POST_PROCESS)
 135 
 136 hal-device: hal-device.c
 137         $(LINK.c) -o $@ hal-device.c $(LDLIBS)
 138         $(POST_PROCESS)
 139 
 140 hal-find-by-capability: hal_find_by_capability.c
 141         $(LINK.c) -o $@ hal_find_by_capability.c $(LDLIBS)
 142         $(POST_PROCESS)
 143 
 144 hal-find-by-property: hal_find_by_property.c
 145         $(LINK.c) -o $@ hal_find_by_property.c $(LDLIBS)
 146         $(POST_PROCESS)
 147 
 148 hal-get-property: hal_get_property.c
 149         $(LINK.c) -o $@ hal_get_property.c $(LDLIBS)
 150         $(POST_PROCESS)
 151 
 152 hal-set-property: hal_set_property.c
 153         $(LINK.c) -o $@ hal_set_property.c $(LDLIBS)
 154         $(POST_PROCESS)
 155 
 156 lshal: lshal.c
 157         $(LINK.c) -o $@ lshal.c $(LDLIBS)
 158         $(POST_PROCESS)
 159 
 160 install: all $(ROOTUSRSBINPROG) $(ROOTCMD) $(SUBDIR)
 161 
 162 clean: $(SUBDIR)
 163         $(RM) $(CLEANFILES)
 164 
 165 $(SUBDIR): FRC
 166         @cd $@; pwd; $(MAKE) $(TARGET)
 167 
 168 FRC:
 169 
 170 include ../../Makefile.targ