xref: /illumos-gate/usr/src/cmd/backup/lib/Makefile (revision 84ab085a13f931bc78e7415e7ce921dbaa14fcb3)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# cmd/backup/lib/Makefile
29#
30LIBRARY=	libdump.a
31
32# Has to be before include of Makefile.backup
33# This should be POFILE=libdump.po, but that causes make to
34# fall over due to some seriously weird interactions in the
35# various indirectly-included makefiles.  So, since this works
36# and is otherwise harmless, we fake it.
37PROG=		libdump
38
39# Include library definitions, then backup definitions, as in general
40# we want the flags and such from our tree.
41
42include ../../../lib/Makefile.lib
43include ../Makefile.backup
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