# $Source: /hpux/shared/supp//usr/src/cmd/restore/./makefile,v $
# $Revision: 78.1 $

# Common makefile for restore

LIBS = -lBSD 
B1 = -lBSD -lscmd -lsec
CFLAGS = -D_LARGE_UIDS -D_LARGE_UIDS2 -D_FILE_OFFSET_BITS=32
OBJECTS  =  main.o restore.o dirs.o symtab.o tape.o utilities.o hpux_rel.o \
            interactive.o telldir.o dumprmt.o opendir.o
SOURCES  =  main.c restore.c dirs.c symtab.c tape.c utilities.c hpux_rel.c \
            interactive.c telldir.c ../dump/dumprmt.c opendir.c
INCLUDES = -I../dump

default: restore restore.arch

metrics: restore.M

restore: $(OBJECTS)
	if ifdef SecureWare || ifdef B1 || ifdef TRUSTED; then		\
		$(CC) $(LDFLAGS) $(OBJECTS) -lm6 -o restore $(B1);	\
	else								\
		$(CC) $(LDFLAGS) $(OBJECTS) -o restore $(LIBS);		\
	fi

restore.arch: restore
	if ifdef SecureWare || ifdef B1 || ifdef TRUSTED; then		\
	$(CC) $(LDFLAGS) -Wl,-a,archive $(OBJECTS) -lm6 -o restore.arch $(B1); \
	else								\
	$(CC) $(LDFLAGS) -Wl,-a,archive $(OBJECTS) -o restore.arch $(LIBS); \
	fi

restore.M: $(SOURCES)
	$(METRICS) $(CFLAGS) $(SOURCES) -o restore.M $(LIBS)

clean:
	/bin/rm -f *.o core

clobber: clean
	/bin/rm -f restore restore.arch restore.M

$(OBJECTS): 	restore.h dumprestore.h

dumprmt.o: ../dump/dumprmt.c
	$(CC) $(CFLAGS) $(FLAGS) $(INCLUDES) -c ../dump/dumprmt.c

# Redefine the .c to .o rule as to include FLAGS
.c.o:
	$(CC) $(CFLAGS) $(FLAGS) -c $<

