xref: /illumos-gate/usr/src/cmd/backup/lib/Makefile (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
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
26LIBRARY=	libdump.a
27
28# Has to be before include of Makefile.backup
29# This should be POFILE=libdump.po, but that causes make to
30# fall over due to some seriously weird interactions in the
31# various indirectly-included makefiles.  So, since this works
32# and is otherwise harmless, we fake it.
33PROG=		libdump
34
35# Include library definitions, then backup definitions, as in general
36# we want the flags and such from our tree.
37
38include ../../../lib/Makefile.lib
39include ../Makefile.backup
40
41SRCDIR =	.
42
43# Specifically request the construction of a static library.
44# This library is not installed in the proto area.
45LIBS=	$(LIBRARY)
46
47HDRS=		../include/byteorder.h \
48	../include/memutils.h ../include/myrcmd.h \
49	../../../head/protocols/dumprestore.h \
50	../include/rmt.h
51
52YFILE=		getdate.y
53YSRC=		getdate.c
54
55CLOBBERFILES +=	$(LIBS) $(GLIB)
56
57LOBJS=		rmtlib.o myrcmd.o \
58		$(YSRC:%.c=%.o) \
59		byteorder.o memutils.o $(RPC_CLNT:%.c=%.o) $(RPC_XDR:%.c=%.o)
60
61OBJECTS=	$(LOBJS)
62POFILES=	$(OBJECTS:.o=.po)
63GENERAL=	../include
64GLOBAL=		../../../head
65CPPFLAGS=	-I$(GENERAL) -I$(GLOBAL) $(CPPFLAGS.master)
66CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
67CERRWARN +=	-_gcc=-Wno-parentheses
68CERRWARN +=	-_gcc=-Wno-unused-label
69CERRWARN +=	-_gcc=-Wno-unused-variable
70CLEANFILES=	$(OBJECTS) $(DEBUGS) $(YSRC) $(LIBRARY)
71
72# support for -g library
73GLIB=		libdump_g.a
74DEBUGS=		$(OBJECTS:%=.debug/%)
75$(GLIB):=	AROBJS = $(DEBUGS)
76$(GLIB):=	DIR = .debug
77$(GLIB):=	CFLAGS= $(CCGDEBUG) $(XESS) -DDEBUG -DYYDEBUG ${SBFLAGS}
78
79.KEEP_STATE:
80
81all:	$(LIBS)
82
83debug:	$(LIBS) $(GLIB)
84
85.debug:
86	-@mkdir -p $@
87
88.debug/%.o: %.c
89	$(COMPILE.c) -o $@ $<
90	$(POST_PROCESS_O)
91
92$(GLIB): .debug $$(DEBUGS)
93	$(BUILD.AR)
94	$(POST_PROCESS_A)
95
96$(OBJECTS):	$(HDRS)
97
98install:	all
99
100$(POFILE):	$(POFILES)
101	$(RM) $@; cat $(POFILES) > $@
102
103lint:
104
105check:	$(HDRS)
106	$(CSTYLE) $(CSTYLEFLAGS) `echo $(SRCS) | sed -e s/getdate.c//` $(HDRS)
107	$(HDRCHK) $(HDRCHKFLAGS) $(HDRS)
108
109# include library targets
110include ../../../lib/Makefile.targ
111
112_msg:		$(POFILE)
113