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