#############################################################################
#       $Id: GNUmakefile,v 1.3 1994/05/05 00:54:17 rich Exp $
# $Revision: 1.3 $
#     $Date: 1994/05/05 00:54:17 $
#   $Author: rich $
#    $State: Exp $
#   $Locker:  $
#
# PROJECT:	LRD
#
# FILE:		Makefile
#		Based on Erebus prototypical Makefile
#		Makefile.proto,v 1.1 1992/06/16 22:50:21 jwest Exp 
#
# DESCRIPTION:
# Makes the tca libraries and central server.
#
# EXPORTS:
#	The following targets are available as part of Makefile.std:
#		all bins libs privs objs
#		clean install
#		lint depend
#
# HISTORY:
#
# $Log: GNUmakefile,v $
#
#############################################################################

.KEEP_STATE:

#############################################################################
# Site Configuration Macros
#############################################################################

# For most machines, this gets a string that can be used to determine
# the machine.
THIS_ARCH := $(shell arch)

PROJECT_DIR	= /afs/cs.cmu.edu/project/TCA/release/alpha
LISP_INC_DIR	= /usr/misc/.allegro/lib/misc
INSTALL_DIR	= ..
MODULE_DIR	= 
FTP_DIR		= /afs/cs.cmu.edu/project/TCA/ftp

CVS_BIN 	= /usr/misc/.cvs/bin
CVSROOT 	= /afs/cs.cmu.edu/project/TCA/Master

DEPEND_FILE	= GNUmakefile

# set AFS to "afs" is the system is installled in an afs file system.
IS_AFS	= `/usr/misc/bin/fs listquota >/dev/null`
AFS_TYPE = $(shell /usr/misc/bin/fs sysname | sed -e s/\'// | sed -e s/\'// | awk '{print $$4}')

# places where files live, relative to this file :
BDIR    = bin
LDIR    = lib
ODIR    = obj
LODIR   = lispObj
VODIR   = vxObj
TESTDIR = ../test/
PWD 	= `(cd ..;/bin/pwd)`

#############################################################################
# Release configuration.
#############################################################################

MAJOR_VERSION	= 7
MINOR_VERSION	= 6

#############################################################################
# Standard directories
#############################################################################

PUBLIC_BIN_DIR		= $(INSTALL_DIR)/bin
PUBLIC_INC_DIR 		= $(INSTALL_DIR)/include
PUBLIC_LIB_DIR		= $(INSTALL_DIR)/lib
PUBLIC_LINT_DIR		= $(INSTALL_DIR)/lib/lint
PUBLIC_MAN_DIR		= $(INSTALL_DIR)/man/man1
PUBLIC_DOC_DIR		= $(INSTALL_DIR)/doc

MODULE_INC_DIR		= $(PUBLIC_INC_DIR)/$(MODULE_DIR)
MODULE_LIB_DIR		= $(PUBLIC_LIB_DIR)/$(MODULE_DIR)
MODULE_LINT_DIR		= $(PUBLIC_LINT_DIR)/$(MODULE_DIR)

INSTALL		= install
INS_BIN_FLAGS	= -m 555
INS_INC_FLAGS	= -c -m 444
INS_LIB_FLAGS	= -m 666
INS_LINT_FLAGS	= -m 444
INS_MAN_FLAGS	= -c -m 444
INS_DOC_FLAGS	= -c -m 444
INS_FTP_FLAGS	= -m 444

CC		= gcc
AR		= ar
LINT		= lint
RM		= /bin/rm -f

#############################################################################
# Program Configuration Macros
#############################################################################

INC_PATH	= -I. -I$(PUBLIC_INC_DIR)
DEFINES		= 
CPPFLAGS	= $(INC_PATH) $(DEFINES)
CFLAGS_sun4	= -fpic
CFLAGS		= -g -O -Wall -fpcc-struct-return $(CFLAGS_$(THIS_ARCH))

LIB_PATH	= -L. -L$(PUBLIC_LIB_DIR) -L$(MODULE_LIB_DIR) \
		  -L$(PROJECT_DIR)/lib
LDFLAGS 	= $(LIB_PATH)
LIBRARIES	= -ltca

LINTFLAGS	= -abch

ARFLAGS		= rv

SUBDIRS		= 

##########
# File Definition Macros.  Deletion of generated files assumed
#    to be o.k.  Source files will never be deleted.
##########

# Generated files - installed
PUBLIC_BINS		= 
PUBLIC_LIBS_sun4	= 
PUBLIC_LIBS_pmax	= 
PUBLIC_LIBS		= 
PUBLIC_LINTS		= 

MODULE_LIBS		= 
MODULE_LINTS		= 



# Source files - installed
PUBLIC_INCS		= 
PUBLIC_MANS		= 
PUBLIC_DOCS		= 

MODULE_INCS		= 

INCS			= $(MODULE_INCS) $(PUBLIC_INCS)

# Generated files - not installed
PRIVS	= 

OBJS	= 

# Source files - not installed

SRCS	= 

PRIVATE_INCS	= 

MISC		=  GNUmakefile GNUmakefile.std fixLinks makeTAGS tcvs

# All source files
SRCS_ALL	= $(SRCS) $(INCS) $(PRIVATE_INCS) $(MANS) $(DOCS) $(MISC)

# Files to be removed by 'make clean' and 'make realclean'
DELETES		= core Makefile.bak \
	  	  $(PUBLIC_BINS) $(PUBLIC_LIBS) $(PUBLIC_LINTS) \
		  $(MODULE_LIBS) $(MODULE_LINTS) $(PRIVS) $(OBJS) make.state \
		  $(wildcard .nse_dep*) $(wildcard *.CKP) $(wildcard \#*\#) \
		  $(wildcard *~) $(wildcard .*~) $(wildcard *.CKP)\
	          $(wildcard *.BAK) $(wildcard .*.BAK)

# Files never to be removed, even if Make encounters an error
.PRECIOUS: $(SRCS_ALL) $(SUBDIRS)

##########
# Default Target
##########

all:: $(SUBDIRS) libs privs bins 

##########
# User Defined Targets
##########

# Define rules for all files listed in BINS, LIBS, and LINTS in this section.
# Example executable, object, library, and combined objects are shown below:
#
#  sample: file1.o file2.o
#	$(LINK.c) -o $@ file1.o file2.o $(LIBRARIES)
#
#  alternateName.o: file1.c
#	$(COMPILE.c) -o $@ file1.o
#
#  libsample.a: file1.o file2.o
#	-rm $@
#	$(AR) $(ARFLAGS) $@ file1.o file2.o
#	ranlib $@
#
#  combined.o: part1.o part2.o
#	$(LD) -r -o $@ part1.o part2.o; chmod a-x $@

##########
# Include standard target definitions and RCS rules
##########

include $(INSTALL_DIR)/etc/GNUmakefile.std

# DO NOT DELETE THIS LINE -- make depend depends on it.
