xref: /illumos-gate/usr/src/cmd/backup/restore/Makefile (revision 55fea89d)
17c478bd9Sstevel@tonic-gate#
224fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate# Use is subject to license terms.
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# cmd/backup/restore/Makefile
67c478bd9Sstevel@tonic-gate#
77c478bd9Sstevel@tonic-gate# Copyright (c) 1983 Regents of the University of California.
87c478bd9Sstevel@tonic-gate# All rights reserved.  The Berkeley software License Agreement
97c478bd9Sstevel@tonic-gate# specifies the terms and conditions for redistribution.
107c478bd9Sstevel@tonic-gate#
117c478bd9Sstevel@tonic-gate#	CAUTION:  FSTYPE must be defined before including ../Makefile.backup,
127c478bd9Sstevel@tonic-gate#		  otherwise UTFROOTPKGUSRLIBFSTYPE doesn't get expanded
137c478bd9Sstevel@tonic-gate#		  properly and the magic doesn't happen.
147c478bd9Sstevel@tonic-gate
157c478bd9Sstevel@tonic-gateFSTYPE=		ufs
167c478bd9Sstevel@tonic-gate
177c478bd9Sstevel@tonic-gateUFSRESTORE=	ufsrestore
187c478bd9Sstevel@tonic-gate
197c478bd9Sstevel@tonic-gatePROG=		$(UFSRESTORE)
207c478bd9Sstevel@tonic-gateROOTFS_PROG=	$(PROG)
217c478bd9Sstevel@tonic-gatePRODUCT=	$(PROG)
227c478bd9Sstevel@tonic-gate
237c478bd9Sstevel@tonic-gateinclude ../Makefile.backup
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gateOBJECTS=	dirs.o interactive.o main.o restore.o \
267c478bd9Sstevel@tonic-gate		symtab.o tape.o utilities.o
277c478bd9Sstevel@tonic-gateSRCS=		$(OBJECTS:%.o=%.c)
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gatePOFILES=	$(OBJECTS:%.o=%.po) ../lib/libdump.po
307c478bd9Sstevel@tonic-gatePOFILE=		ufsrestore.po
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gate# XXX This is only needed for the check: target.  It would be nice to
337c478bd9Sstevel@tonic-gate# XXX automatically generate the list when needed.
347c478bd9Sstevel@tonic-gateHEADERS=	../../../head/protocols/dumprestore.h \
357c478bd9Sstevel@tonic-gate	../include/byteorder.h ../include/memutils.h \
367c478bd9Sstevel@tonic-gate	../include/rmt.h restore.h
377c478bd9Sstevel@tonic-gate
38b6805bf7SGordon RossCLOBBERFILES +=	$(PRODUCT) $(DEBUGPRODUCTS)
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateLOCAL=		.
417c478bd9Sstevel@tonic-gateGENERAL=	../include
427c478bd9Sstevel@tonic-gateGLOBAL=		../../../head
437c478bd9Sstevel@tonic-gateCPPFLAGS=	-I$(LOCAL) -I$(GENERAL) -I$(GLOBAL) \
447c478bd9Sstevel@tonic-gate			$(CPPFLAGS.master) -D_LARGEFILE64_SOURCE=1
457c478bd9Sstevel@tonic-gateLIBDUMP=	../lib/libdump.a
467c478bd9Sstevel@tonic-gateLINTLIBDUMP=	../lib/llib-ldump.ln
4749f0e518SmarksLDLIBS +=	$(BSTATIC) -L../lib -ldump $(BDYNAMIC) -lsocket -lnsl -lsec
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gateUFSROOTLINK=	$(UFSROOTUSRSBIN)/$(PROG)
507c478bd9Sstevel@tonic-gateLINKVALUE=	../lib/fs/$(FSTYPE)/$(PROG)
517c478bd9Sstevel@tonic-gate
527c478bd9Sstevel@tonic-gateFILEMODE=	04555
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate.KEEP_STATE:
557c478bd9Sstevel@tonic-gate
56*55fea89dSDan Crossall:		$(ROOTFS_PROG)
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gate$(PROG):	$(OBJECTS) $$(LIBDUMP)
597c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJECTS) $(LDLIBS)
607c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gate$(LIBDUMP): FRC
637c478bd9Sstevel@tonic-gate	$(DO_LIBDIR)
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gateFRC:
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gateinstall:	all $(UFSROOTPKGUSRLIBFSTYPE) $(UFSROOTLINK)
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gatelint:	$(SRCS) $(LINTLIBDUMP)
707c478bd9Sstevel@tonic-gate	$(LINT.c) $(SRCS) $(LINTLIBDUMP) 2>&1 \
717c478bd9Sstevel@tonic-gate	| sed -f lint.sed | grep -v '^[ 	]'
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gate$(LINTLIBDUMP):	FRC
747c478bd9Sstevel@tonic-gate	cd ../lib; pwd; $(MAKE) lint
757c478bd9Sstevel@tonic-gate	pwd
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gatecheck:
787c478bd9Sstevel@tonic-gate	$(CSTYLE) $(CSTYLEFLAGS) $(SRCS) $(HEADERS)
797c478bd9Sstevel@tonic-gate	$(HDRCHK) $(HDRCHKFLAGS) $(HEADERS)
807c478bd9Sstevel@tonic-gate
817c478bd9Sstevel@tonic-gateclean:
827c478bd9Sstevel@tonic-gate	$(RM) $(OBJECTS) $(DEBUGOBJS) *.ln
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gate$(UFSROOTLINK):
857c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) $(LINKVALUE) $(UFSROOTLINK)
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate$(POFILE):	$(POFILES)
887c478bd9Sstevel@tonic-gate	$(RM) $@; cat $(POFILES) > $@
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gate../lib/libdump.po:
917c478bd9Sstevel@tonic-gate	cd ../lib ; pwd ; $(MAKE)  libdump.po
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
94