xref: /titanic_41/usr/src/cmd/backup/restore/Makefile (revision 989f28072d20c73ae0955d6a1e3e2fc74831cb39)
1#
2# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
3# Use is subject to license terms.
4#
5# cmd/backup/restore/Makefile
6#
7# Copyright (c) 1983 Regents of the University of California.
8# All rights reserved.  The Berkeley software License Agreement
9# specifies the terms and conditions for redistribution.
10#
11#	CAUTION:  FSTYPE must be defined before including ../Makefile.backup,
12#		  otherwise UTFROOTPKGUSRLIBFSTYPE doesn't get expanded
13#		  properly and the magic doesn't happen.
14
15FSTYPE=		ufs
16
17UFSRESTORE=	ufsrestore
18
19PROG=		$(UFSRESTORE)
20ROOTFS_PROG=	$(PROG)
21PRODUCT=	$(PROG)
22
23include ../Makefile.backup
24
25OBJECTS=	dirs.o interactive.o main.o restore.o \
26		symtab.o tape.o utilities.o
27SRCS=		$(OBJECTS:%.o=%.c)
28
29POFILES=	$(OBJECTS:%.o=%.po) ../lib/libdump.po
30POFILE=		ufsrestore.po
31
32# XXX This is only needed for the check: target.  It would be nice to
33# XXX automatically generate the list when needed.
34HEADERS=	../../../head/protocols/dumprestore.h \
35	../include/byteorder.h ../include/memutils.h \
36	../include/rmt.h restore.h
37
38CLOBBERFILES=	$(PRODUCT) $(DEBUGPRODUCTS) *.ln $(POFILES)
39
40LOCAL=		.
41GENERAL=	../include
42GLOBAL=		../../../head
43CPPFLAGS=	-I$(LOCAL) -I$(GENERAL) -I$(GLOBAL) \
44			$(CPPFLAGS.master) -D_LARGEFILE64_SOURCE=1
45LIBDUMP=	../lib/libdump.a
46LINTLIBDUMP=	../lib/llib-ldump.ln
47LDLIBS +=	$(BSTATIC) -L../lib -ldump $(BDYNAMIC) -lsocket -lnsl -lsec
48
49UFSROOTLINK=	$(UFSROOTUSRSBIN)/$(PROG)
50LINKVALUE=	../lib/fs/$(FSTYPE)/$(PROG)
51
52FILEMODE=	04555
53
54.KEEP_STATE:
55
56all:		$(ROOTFS_PROG)
57
58$(PROG):	$(OBJECTS) $$(LIBDUMP)
59	$(LINK.c) -o $@ $(OBJECTS) $(LDLIBS)
60	$(POST_PROCESS)
61
62$(LIBDUMP): FRC
63	$(DO_LIBDIR)
64
65FRC:
66
67install:	all $(UFSROOTPKGUSRLIBFSTYPE) $(UFSROOTLINK)
68
69lint:	$(SRCS) $(LINTLIBDUMP)
70	$(LINT.c) $(SRCS) $(LINTLIBDUMP) 2>&1 \
71	| sed -f lint.sed | grep -v '^[ 	]'
72
73$(LINTLIBDUMP):	FRC
74	cd ../lib; pwd; $(MAKE) lint
75	pwd
76
77check:
78	$(CSTYLE) $(CSTYLEFLAGS) $(SRCS) $(HEADERS)
79	$(HDRCHK) $(HDRCHKFLAGS) $(HEADERS)
80
81clean:
82	$(RM) $(OBJECTS) $(DEBUGOBJS) *.ln
83
84$(UFSROOTLINK):
85	-$(RM) $@; $(SYMLINK) $(LINKVALUE) $(UFSROOTLINK)
86
87$(POFILE):	$(POFILES)
88	$(RM) $@; cat $(POFILES) > $@
89
90../lib/libdump.po:
91	cd ../lib ; pwd ; $(MAKE)  libdump.po
92
93include ../Makefile.targ
94