# Copyright (c) 1992,1991 Carnegie Mellon University
# All Rights Reserved.
# 
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
# software, derivative works or modified versions, and any portions
# thereof, and that both notices appear in supporting documentation.
#
# CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
# CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
# ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
#
# Carnegie Mellon requests users of this software to return to
#
#  Software Distribution Coordinator   or   Software.Distribution@CS.CMU.EDU
#  School of Computer Science
#  Carnegie Mellon University
#  Pittsburgh PA 15213-3890
#
# any improvements or extensions that they make and grant Carnegie the rights
# to redistribute these changes.
######################################################################
# Makefile to build sup (the client side), supfilesrv (the repository
# side, and supscan (used by the repository. If you only want to sup
# files from CMU, just build sup.
# The header files: c.h, libc.h and sysent.h are only
# necessary if you are compiling on a non-Mach system. Likewise the
# files in libextra.a are normally found in libcs.a on a Mach system.
# DOPRINT_VA is used by vprintf.c and should be defined if your version
# of libc/doprnt.c defines the routine _doprnt_va. If it defines _doprnt
# instead, leave DORPINT_VA undefined. NetBSD provides a complete version
# of the vprintf routines. Ultrix, OSF/1 and AIX are missing vsnprintf
######################################################################
# HISTORY
# 13-Oct-93  Mary Thompson (mrt) at Carnegie-Mellon University
#	Added definitions for Dec Alpha (OSF/1), RS/6000 (AIX 3.2.x)
#	and MIPS (RISC/os 4.5x).
#	Changes from Franz Fischer - Technical University of Munich
#
# $Log$

# Choose one set of defines

# Generic Unix system
DEFINES		= -UMACH
LIBS			= libextra.a
LIBDEPS		= libextra.a
VPRINTF		= vprintf.o

# NetBSD system
#DEFINES		= -UMACH
#LIBS			= libextra.a
#LIBDEPS		= libextra.a
#VPRINTF		=

# DEC Alpha running OSF/1
#DEFINES		= -UMACH -D_BSD -D__alpha
#LIBS			= libextra.a
#LIBDEPS		= libextra.a
#VPRINTF		= vprintf.o

# AIX 3.2.x on RS/6000
#CC			= bsdcc
#DEFINES		= -UMACH -D_AIX
#LIBS			= libextra.a
#LIBDEPS		= libextra.a
#VPRINTF		= vprintf.o

# Ultrix
#DEFINES		= -UMACH -DULTRIX
#LIBS			= libextra.a
#LIBDEPS		= libextra.a
#VPRINTF		= vprintf.o

# RISC/os 4.5x (on a MIPS)
#CC			= /usr/bsd43/bin/cc
#or: CC			= cc -systype bsd43
#DEFINES		= -UMACH -DMAILCMD="\"mailx -s \\\"SUP Upgrade of %s\\\\" %s >/dev/null\""
#LIBS			= libextra.a
#LIBDEPS		= libextra.a
#VPRINTF		= vprintf.o

# Mach system, not at CMU 
#DEFINES			= 
#LIBS			= libextra.a
#LIBDEPS			= libextra.a
#VPRINTF			= vprintf.o

#Mach running at CMUCS
#DEFINES		= -DMACH -DDOPRINT_VA
#LIBS			= -lsys
#LIBDEPS		= 
#VPRINTF		= 

DEFS			= -UCMUCS -UCMU  ${DEFINES}

# If building in place
CFLAGS			= ${DEFS} -O8 -m486 -pipe -I. 

# Uncomment if building in obj directory with DeBoor make
#CFLAGS			+= -I${.CURDIR}

# Uncomment if your compiler understands -MD and you want .d files
#CFLAGS			+= -MD


# unlicensed non-crypting version
NETCRYPT		= netcryptvoid.o
# licensed, crypting version
#NETCRYPT		= netcrypt.o

SUPCL			= supcmain.o supcvers.o supcparse.o supcname.o \
			  supcmisc.o supcmeat.o
SUPS			= scm.o scmio.o stree.o log.o supmsg.o ${NETCRYPT}
EXTRA			= atoo.o errmsg.o expand.o ffilecopy.o filecopy.o nxtarg.o  \
			  path.o quit.o run.o salloc.o skipto.o  ${VPRINTF}


PROGRAMS		= sup supscan supfilesrv

sup_OFILES		= ${SUPCL} ${SUPS}
supfilesrv_OFILES	= supfilesrv.o scan.o ${SUPS}
supscan_OFILES		= supscan.o stree.o scan.o

all: ${PROGRAMS}

sup: ${sup_OFILES} ${LIBDEPS}
	${CC} ${CFLAGS} -o sup ${sup_OFILES} ${LIBS}

supfilesrv: ${supfilesrv_OFILES} ${LIBDEPS}
	${CC} ${CFLAGS} -o supfilesrv ${supfilesrv_OFILES} ${LIBS}

supscan:  ${supscan_OFILES} ${LIBDEPS}
	${CC} ${CFLAGS} -o supscan ${supscan_OFILES} ${LIBS}

libextra.a: ${EXTRA}
	ar r libextra.a $?
	ranlib libextra.a

clean:
	rm -f ${PROGRAMS} libextra.a *.o core a.out


scan.o:	sup.h
scm.o:	sup.h
scmio.o: sup.h supmsg.h
stree.o: sup.h
supcmain.o: sup.h supmsg.h supcdefs.h
supcmeat.o: sup.h supmsg.h supcdefs.h
supcmisc.o: sup.h supmsg.h supcdefs.h
supcname.o: sup.h supmsg.h supcdefs.h
supcparse.o: sup.h supmsg.h supcdefs.h
supfilesrv.o: sup.h supmsg.h
supmsg.o: sup.h supmsg.h
supscan.o: sup.h
netcryptvoid.o: sup.h supmsg.h
netcrypt.o: sup.h supmsg.h
