xref: /titanic_52/usr/src/cmd/backup/lib/Makefile (revision 3c112a2b34403220c06c3e2fcac403358cfba168)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBRARY=	libdump.a
29
30# Has to be before include of Makefile.backup
31# This should be POFILE=libdump.po, but that causes make to
32# fall over due to some seriously weird interactions in the
33# various indirectly-included makefiles.  So, since this works
34# and is otherwise harmless, we fake it.
35PROG=		libdump
36
37# Include library definitions, then backup definitions, as in general
38# we want the flags and such from our tree.
39
40include ../../../lib/Makefile.lib
41include ../Makefile.backup
42
43SRCDIR =	.
44
45# Specifically request the construction of a static library.
46# This library is not installed in the proto area.
47LIBS=	$(LIBRARY)
48
49HDRS=		../include/byteorder.h \
50	../include/memutils.h ../include/myrcmd.h \
51	../../../head/protocols/dumprestore.h \
52	../include/rmt.h
53
54YFILE=		getdate.y
55YSRC=		getdate.c
56
57CLOBBERFILES=	$(YSRC) $(GLIB) *.ln
58
59LOBJS=		rmtlib.o myrcmd.o \
60		$(YSRC:%.c=%.o) \
61		byteorder.o memutils.o $(RPC_CLNT:%.c=%.o) $(RPC_XDR:%.c=%.o)
62
63OBJECTS=	$(LOBJS)
64POFILES=	$(OBJECTS:.o=.po)
65GENERAL=	../include
66GLOBAL=		../../../head
67CPPFLAGS=	-I$(GENERAL) -I$(GLOBAL) $(CPPFLAGS.master)
68LINTOUT=	lint.out
69CLEANFILES=	$(OBJECTS) $(LINTOUT) $(LINTLIB) $(DEBUGS) *.ln \
70		$(YSRC) $(LIBRARY)
71LINTFLAGS +=	-y
72
73# support for -g library
74GLIB=		libdump_g.a
75DEBUGS=		$(OBJECTS:%=.debug/%)
76$(GLIB):=	AROBJS = $(DEBUGS)
77$(GLIB):=	DIR = .debug
78$(GLIB):=	CFLAGS= -g $(XESS) -DDEBUG -DYYDEBUG ${SBFLAGS}
79
80.KEEP_STATE:
81
82all:	$(LIBS)
83
84debug:	$(LIBS) $(GLIB)
85
86.debug:
87	-@mkdir -p $@
88
89.debug/%.o: %.c
90	$(COMPILE.c) -o $@ $<
91	$(POST_PROCESS_O)
92
93$(GLIB): .debug $$(DEBUGS)
94	$(BUILD.AR)
95	$(POST_PROCESS_A)
96
97$(OBJECTS):	$(HDRS)
98
99install:	all
100
101$(POFILE):	$(POFILES)
102	$(RM) $@; cat $(POFILES) > $@
103
104# rpcgen produces unused local variables that we can't easily suppress.
105# It is also stupid about 32/64 bit integers.  Since we don't support
106# the RPC subsystem any more, just ignore complaints about it all.
107# We have no control over yaccpar, and it has lots of 32/64 complaints.
108# Assumes lint run with -s argument
109lint:		lint.out
110	sed -f lint.sed lint.out
111
112lint.out:	$(LINTLIB)
113
114check:	$(HDRS)
115	$(CSTYLE) $(CSTYLEFLAGS) `echo $(SRCS) | sed -e s/getdate.c//` $(HDRS)
116	$(HDRCHK) $(HDRCHKFLAGS) $(HDRS)
117
118# include library targets
119include ../../../lib/Makefile.targ
120
121_msg: 		$(POFILE)
122