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