xref: /illumos-gate/usr/src/cmd/hal/tools/Makefile (revision 5801b0f0)
118c2aff7Sartem#
218c2aff7Sartem# CDDL HEADER START
318c2aff7Sartem#
418c2aff7Sartem# The contents of this file are subject to the terms of the
518c2aff7Sartem# Common Development and Distribution License (the "License").
618c2aff7Sartem# You may not use this file except in compliance with the License.
718c2aff7Sartem#
818c2aff7Sartem# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
918c2aff7Sartem# or http://www.opensolaris.org/os/licensing.
1018c2aff7Sartem# See the License for the specific language governing permissions
1118c2aff7Sartem# and limitations under the License.
1218c2aff7Sartem#
1318c2aff7Sartem# When distributing Covered Code, include this CDDL HEADER in each
1418c2aff7Sartem# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1518c2aff7Sartem# If applicable, add the following below this CDDL HEADER, with the
1618c2aff7Sartem# fields enclosed by brackets "[]" replaced with your own identifying
1718c2aff7Sartem# information: Portions Copyright [yyyy] [name of copyright owner]
1818c2aff7Sartem#
1918c2aff7Sartem# CDDL HEADER END
2018c2aff7Sartem#
2118c2aff7Sartem#
22d2ec54f7Sphitran# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2318c2aff7Sartem# Use is subject to license terms.
2418c2aff7Sartem#
2518c2aff7Sartem
26*5801b0f0SToomas SoomeSUBDIR =	sunos
27d2ec54f7Sphitran
2818c2aff7SartemHAL_PROG =	hal-device hal-find-by-capability hal-find-by-property \
2918c2aff7Sartem		hal-get-property hal-set-property lshal
3018c2aff7Sartem
31d2ec54f7SphitranHAL_LIB =	hal-is-caller-privileged
32d2ec54f7Sphitran
33d2ec54f7SphitranSCRIPT_BIN =	hal-fdi-validate
34d2ec54f7Sphitran
35d2ec54f7SphitranSCRIPT_LIB =	hal-system-lcd-set-brightness  hal-system-lcd-get-brightness \
36d2ec54f7Sphitran		hal-system-power-hibernate hal-system-power-suspend \
37d2ec54f7Sphitran		hal-system-power-reboot hal-system-power-shutdown hal-functions
3818c2aff7Sartem
3918c2aff7SartemSTORAGE_METHOD_PROG = hal-storage-closetray hal-storage-eject \
4018c2aff7Sartem		hal-storage-mount hal-storage-unmount \
4118c2aff7Sartem		hal-storage-zpool-export hal-storage-zpool-import
4218c2aff7Sartem
4318c2aff7SartemSTORAGE_PROG =	$(STORAGE_METHOD_PROG) \
4418c2aff7Sartem		hal-storage-cleanup-mountpoint \
4518c2aff7Sartem		hal-storage-cleanup-all-mountpoints
4618c2aff7Sartem
4718c2aff7SartemPROGSRCS =	$(PROG:%=%.c) $(STORAGE_PROG:%=%.c)
4818c2aff7Sartem
49a9da3307Snp
5018c2aff7SartemSTORAGE_OBJS =		$(STORAGE_PROG:%=%.o)
51eade8b27SnpSTORAGE_SHAREDOBJS =	hal-storage-shared.o adt_data.o
52eade8b27SnpSTORAGE_SHAREDSRCS =	$(STORAGE_SHAREDOBJS:%.o=%.c) $(STORAGE_SHAREDOBJS:%.o=../utils/%.c)
5318c2aff7Sartem
5418c2aff7SartemSRCS =		$(PROGSRCS) $(STORAGE_SHAREDSRCS)
5518c2aff7Sartem
56d2ec54f7SphitranCLOBBERFILES += $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB)
57b6805bf7SGordon RossCLEANFILES += $(STORAGE_SHAREDOBJS) $(STORAGE_OBJS) hal-storage-zpool.o
5818c2aff7Sartem
5918c2aff7Sarteminclude ../../Makefile.cmd
6018c2aff7Sarteminclude ../Makefile.hal
6118c2aff7Sartem
62*5801b0f0SToomas SoomeNATIVE_LIBS +=		libdbus-1.so libdbus-glib-1.so libglib-2.0.so
6318c2aff7Sartem$(HAL_PROG) :=		LDLIBS += -lc -ldbus-1 -lhal
6418c2aff7Sartem
6518c2aff7Sartemlshal :=		LDLIBS += -ldbus-glib-1 -lglib-2.0
6618c2aff7Sartem
67d2ec54f7Sphitran$(HAL_LIB) :=	LDLIBS += -lc -ldbus-1 -lpolkit $(ZIGNORE) -lglib-2.0
68d2ec54f7Sphitran
6918c2aff7Sartem$(STORAGE_PROG)	:=	LDLIBS += -lc -ldbus-1 -lglib-2.0 -lhal -lhal-storage -lbsm
7018c2aff7Sartem
7118c2aff7Sartem$(STORAGE_METHOD_PROG) := LDLIBS += -lpolkit
7218c2aff7Sartem
7318c2aff7SartemCPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
7418c2aff7SartemCPPFLAGS += -I$(ROOT)/usr/include/hal
7518c2aff7SartemCPPFLAGS += -I$(ROOT)/usr/include/libpolkit
76bd0ce624SYuri PankovCSTD = $(CSTD_GNU99)
7718c2aff7Sartem
78d2ec54f7SphitranROOTUSRSBINPROG =	$(HAL_PROG:%=$(ROOTUSRSBIN)/%) \
79d2ec54f7Sphitran			$(SCRIPT_BIN:%=$(ROOTUSRSBIN)/%)
8018c2aff7Sartem
8118c2aff7SartemROOTCMDDIR =		$(ROOTLIB_HAL)
82d2ec54f7SphitranROOTCMD =		$(STORAGE_PROG:%=$(ROOTCMDDIR)/%) \
83d2ec54f7Sphitran			$(HAL_LIB:%=$(ROOTCMDDIR)/%) \
84d2ec54f7Sphitran			$(SCRIPT_LIB:%=$(ROOTCMDDIR)/%)
85d2ec54f7Sphitran
86d2ec54f7Sphitranall :=          TARGET= all
87d2ec54f7Sphitraninstall :=      TARGET= install
88d2ec54f7Sphitranclean :=        TARGET= clean
89d2ec54f7Sphitranclobber :=      TARGET= clobber
9018c2aff7Sartem
9118c2aff7Sartem.KEEP_STATE:
9218c2aff7Sartem
93d2ec54f7Sphitranall: $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB) $(SUBDIR)
9418c2aff7Sartem
95a9da3307Snphal-storage-shared.o: hal-storage-shared.c
96a9da3307Snp	$(COMPILE.c) -o $@ hal-storage-shared.c
97a9da3307Snp
98a9da3307Snpadt_data.o: ../utils/adt_data.c
99a9da3307Snp	$(COMPILE.c) -o $@ ../utils/adt_data.c
100a9da3307Snp
10118c2aff7Sartemhal-storage-closetray: hal-storage-closetray.o $(STORAGE_SHAREDOBJS)
10218c2aff7Sartem	$(LINK.c) hal-storage-closetray.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
10318c2aff7Sartem	$(POST_PROCESS)
10418c2aff7Sartem
10518c2aff7Sartemhal-storage-eject: hal-storage-eject.o $(STORAGE_SHAREDOBJS)
10618c2aff7Sartem	$(LINK.c) hal-storage-eject.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
10718c2aff7Sartem	$(POST_PROCESS)
10818c2aff7Sartem
10918c2aff7Sartemhal-storage-mount: hal-storage-mount.o $(STORAGE_SHAREDOBJS)
11018c2aff7Sartem	$(LINK.c) hal-storage-mount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
11118c2aff7Sartem	$(POST_PROCESS)
11218c2aff7Sartem
11318c2aff7Sartemhal-storage-unmount: hal-storage-unmount.o $(STORAGE_SHAREDOBJS)
11418c2aff7Sartem	$(LINK.c) hal-storage-unmount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
11518c2aff7Sartem	$(POST_PROCESS)
11618c2aff7Sartem
11718c2aff7Sartemhal-storage-cleanup-mountpoint: hal-storage-cleanup-mountpoint.c \
11818c2aff7Sartem		$(STORAGE_SHAREDOBJS)
11918c2aff7Sartem	$(LINK.c) hal-storage-cleanup-mountpoint.c \
12018c2aff7Sartem		$(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
12118c2aff7Sartem	$(POST_PROCESS)
12218c2aff7Sartem
12318c2aff7Sartemhal-storage-cleanup-all-mountpoints: hal-storage-cleanup-all-mountpoints.c \
12418c2aff7Sartem		$(STORAGE_SHAREDOBJS)
12518c2aff7Sartem	$(LINK.c) hal-storage-cleanup-all-mountpoints.c \
12618c2aff7Sartem		$(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
12718c2aff7Sartem	$(POST_PROCESS)
12818c2aff7Sartem
12918c2aff7Sartemhal-storage-zpool-export: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
13018c2aff7Sartem	$(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"export\" hal-storage-zpool.c $(LDLIBS)
13118c2aff7Sartem	$(POST_PROCESS)
13218c2aff7Sartem
13318c2aff7Sartemhal-storage-zpool-import: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
13418c2aff7Sartem	$(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"import\" hal-storage-zpool.c $(LDLIBS)
13518c2aff7Sartem	$(POST_PROCESS)
13618c2aff7Sartem
13718c2aff7Sartemhal-device: hal-device.c
13818c2aff7Sartem	$(LINK.c) -o $@ hal-device.c $(LDLIBS)
13918c2aff7Sartem	$(POST_PROCESS)
14018c2aff7Sartem
14118c2aff7Sartemhal-find-by-capability: hal_find_by_capability.c
14218c2aff7Sartem	$(LINK.c) -o $@ hal_find_by_capability.c $(LDLIBS)
14318c2aff7Sartem	$(POST_PROCESS)
14418c2aff7Sartem
14518c2aff7Sartemhal-find-by-property: hal_find_by_property.c
14618c2aff7Sartem	$(LINK.c) -o $@ hal_find_by_property.c $(LDLIBS)
14718c2aff7Sartem	$(POST_PROCESS)
14818c2aff7Sartem
14918c2aff7Sartemhal-get-property: hal_get_property.c
15018c2aff7Sartem	$(LINK.c) -o $@ hal_get_property.c $(LDLIBS)
15118c2aff7Sartem	$(POST_PROCESS)
15218c2aff7Sartem
15318c2aff7Sartemhal-set-property: hal_set_property.c
15418c2aff7Sartem	$(LINK.c) -o $@ hal_set_property.c $(LDLIBS)
15518c2aff7Sartem	$(POST_PROCESS)
15618c2aff7Sartem
15718c2aff7Sartemlshal: lshal.c
15818c2aff7Sartem	$(LINK.c) -o $@ lshal.c $(LDLIBS)
15918c2aff7Sartem	$(POST_PROCESS)
16018c2aff7Sartem
161d2ec54f7Sphitraninstall: all $(ROOTUSRSBINPROG) $(ROOTCMD) $(SUBDIR)
16218c2aff7Sartem
163d2ec54f7Sphitranclean: $(SUBDIR)
16418c2aff7Sartem	$(RM) $(CLEANFILES)
16518c2aff7Sartem
166d2ec54f7Sphitran$(SUBDIR): FRC
167d2ec54f7Sphitran	@cd $@; pwd; $(MAKE) $(TARGET)
168d2ec54f7Sphitran
169d2ec54f7SphitranFRC:
170d2ec54f7Sphitran
17118c2aff7Sarteminclude ../../Makefile.targ
172