xref: /titanic_51/usr/src/cmd/avs/rdc/Makefile (revision a31148363f598def767ac48c5d82e1572e44b935)
1# CDDL HEADER START
2#
3# The contents of this file are subject to the terms of the
4# Common Development and Distribution License (the "License").
5# You may not use this file except in compliance with the License.
6#
7# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8# or http://www.opensolaris.org/os/licensing.
9# See the License for the specific language governing permissions
10# and limitations under the License.
11#
12# When distributing Covered Code, include this CDDL HEADER in each
13# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14# If applicable, add the following below this CDDL HEADER, with the
15# fields enclosed by brackets "[]" replaced with your own identifying
16# information: Portions Copyright [yyyy] [name of copyright owner]
17#
18# CDDL HEADER END
19#
20#
21# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24#
25
26DYNPROG = sndrd sndradm sndrboot sndrsyncd
27
28include ../../Makefile.cmd
29include ../Makefile.com
30
31PROG = $(DYNPROG)
32
33SUBDIRS=	etc
34
35sndradm		:= POBJS = sndradm.o rdc_ioctl.o sndrsubr.o
36sndrboot	:= POBJS = sndrboot.o rdc_ioctl.o sndrsubr.o
37sndrd		:= POBJS = sndrd.o
38sndrsyncd	:= POBJS = sndrsyncd.o rdc_ioctl.o sndrsubr.o
39
40OBJS=	\
41	sndrboot.o \
42	sndradm.o \
43	sndrd.o \
44	sndrsyncd.o \
45	rdc_ioctl.o \
46	sndrsubr.o
47
48XTRA_OBJS= \
49	sdbc_ioctl.o
50
51SRCS=	$(OBJS:%.o=%.c) ../sdbc/sdbc_ioctl.c
52
53sndradm		:= LDLIBS += -lrdc -lunistat -ldscfg -lnsctl -lnsl
54sndrboot	:= LDLIBS += -lrdc -lunistat -ldscfg
55sndrd		:= LDLIBS += -lrdc -lnsl
56sndrsyncd	:= LDLIBS += -lrdc -ldscfg -lunistat
57
58CFLAGS += -v -D_RDC_ -D_SYSCALL32
59LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_RDC_ -D_SYSCALL32
60LINTFLAGS += -DDEBUG
61LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
62LINTFLAGS += -erroff=E_SEC_SCANF_UNBOUNDED_COPY
63LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT
64LINTFLAGS += -erroff=E_FUNC_SET_NOT_USED
65POFILE = rdc_all.po
66POFILES = sndradm.po sndrboot.po
67ROOTLIBLINKS = $(ROOTLIB)/sndrd $(ROOTLIB)/sndrsyncd
68ROOTUSRSBINLINKS = $(ROOTUSRSBIN)/sndradm $(ROOTUSRSBIN)/sndrboot
69
70all	:=	TARGET= all
71install	:=	TARGET= install
72clean	:=	TARGET= clean
73clobber	:=	TARGET= clobber
74lint	:=	TARGET= lint
75
76.KEEP_STATE:
77
78.PARALLEL: $(OBJS) $(XTRA_OBJS)
79
80all: $(SUBDIRS) $(PROG) $(POFILES)
81
82install: $(SUBDIRS) all $(ROOTPROG) $(ROOTLIBLINKS) $(ROOTUSRSBINLINKS)
83
84lint:	$(SUBDIRS) lint_SRCS
85
86clean:	$(SUBDIRS)
87	$(RM) *.o $(POFILES)
88
89$(PROG):	$$(POBJS)
90	$(LINK.c) $(POBJS) -o $@ $(LDLIBS)
91	$(POST_PROCESS)
92
93$(POFILE): $(POFILES)
94	$(RM) $@
95	$(CAT) $(POFILES) > $@
96
97sdbc_ioctl.o: ../sdbc/sdbc_ioctl.c
98	$(COMPILE.c) ../sdbc/sdbc_ioctl.c
99
100$(SUBDIRS):	FRC
101	@cd $@; pwd; $(MAKE) $(TARGET)
102
103$(ROOTLIBLINKS): $(ROOTLIB) $(ROOTPROG)
104	-$(RM) $(ROOTLIBLINKS);
105	$(LN) $(ROOTBIN)/sndrd $(ROOTLIB)/sndrd;
106	$(LN) $(ROOTBIN)/sndrsyncd $(ROOTLIB)/sndrsyncd
107
108$(ROOTUSRSBINLINKS): $(ROOTUSRSBIN) $(ROOTPROG)
109	-$(RM) $(ROOTUSRSBINLINKS);
110	$(LN) $(ROOTBIN)/sndradm $(ROOTUSRSBIN)/sndradm;
111	$(LN) $(ROOTBIN)/sndrboot $(ROOTUSRSBIN)/sndrboot
112
113FRC:
114
115include	../../Makefile.targ
116