# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $

#
# Copyright 1986, 1987, 1988, 1989, 1990, 1991 by the Condor Design Team
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the names of the University of
# Wisconsin and the Condor Design Team not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission.  The University of Wisconsin and the Condor
# Design Team make no representations about the suitability of this
# software for any purpose.  It is provided "as is" without express
# or implied warranty.
#
# THE UNIVERSITY OF WISCONSIN AND THE CONDOR DESIGN TEAM DISCLAIM ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF
# WISCONSIN OR THE CONDOR DESIGN TEAM BE LIABLE FOR ANY SPECIAL, INDIRECT
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
# OR PERFORMANCE OF THIS SOFTWARE.
#

#
# This Makefile is generated specifically for R6000_AIX32 machines.
#

TILDE = /home/condor
LIBC = /lib/libc.a
SIMPLE_LIBC = /lib/libc.a
CRT0 = /lib/crt0.o
SYSCALLS_EXP = /lib/syscalls.exp

TOP = $(TILDE)/CONDOR
INSTALL_DIR = /usr/uw/condor
TMP_DIR = /tmp

PLATFORM_DIR =	$(TOP)/R6000_AIX32
RELEASE_DIR =	$(PLATFORM_DIR)/release_dir
LIB_DIR =		$(RELEASE_DIR)/lib
CONFIG_DIR = 	$(TOP)/config
SRC_TREE =		$(TOP)/src
DOC_TREE =		$(TOP)/doc
INCLUDE_DIR =	$(SRC_TREE)/h
PS_DIR =		$(DOC_TREE)/POSTSCRIPT
CAT_DIR = 		$(DOC_TREE)/CAT
PLATFORM =		R6000_AIX32

LIBX = /usr/lib/libX11.a
LIBXEXT = /usr/lib/libXext.a
CC = bsdcc
MKDEPEND = /usr/misc/X11/bin/makedepend
STAR	= *

SYSCALL_LIB = syscall_lib_aix

LIBDBM =

STD_C_FLAGS =  \
	  -qsrcmsg -I$(INCLUDE_DIR) -D R6000 -D AIX32 -DNFSFIX -DNDBM   -g

SRC_DIR = $(SRC_TREE)/condor_$(SYSCALL_LIB)
CFLAGS = $(STD_C_FLAGS) -DCONDOR -g

TO_UPPER = $(PLATFORM_DIR)/condor_$(SYSCALL_LIB)/ToUpper

all: libcondor.a libckpt.a condor_rt0.o syscall.shr.o syscall.exp libfort.a
release:: all

tags: ALWAYS
	condor_ctags CONDOR_sysnames.c CONDOR_syscalls.c _mkckpt.c _updateckpt.c display.c ckpt.c restart.c syscall_mode.c xfer_file.c finfo.c ckpt_main.c map_file.c C_getenv.c stubs.c extern_path.c fake_getmnt.c nfs.c intern_path.c extern_name.c -l $(NULL)
clean::
	rm -f tags

depend: ALWAYS
	$(MKDEPEND) $(CFLAGS) CONDOR_sysnames.c CONDOR_syscalls.c _mkckpt.c _updateckpt.c display.c ckpt.c restart.c syscall_mode.c xfer_file.c finfo.c ckpt_main.c map_file.c C_getenv.c stubs.c extern_path.c fake_getmnt.c nfs.c intern_path.c extern_name.c

ToUpper: ToUpper.o $(NULL)
	$(CC) $(CFLAGS) -o ToUpper ToUpper.o $(NULL) $(LDFLAGS)
clean::
	rm -f ToUpper ToUpper.o
release::
	/bin/rm -f $(RELEASE_DIR)/bin/ToUpper
	cp ToUpper $(RELEASE_DIR)/bin

zap: zap.o $(NULL)
	$(CC) $(CFLAGS) -o zap zap.o $(NULL) $(LDFLAGS)
clean::
	rm -f zap zap.o
norelease::
	/bin/rm -f $(RELEASE_DIR)/bin/zap
	cp zap $(RELEASE_DIR)/bin

../condor_util_lib/blankline.o ../condor_util_lib/config.o ../condor_util_lib/do_connect.o ../condor_util_lib/dprintf.o ../condor_util_lib/dprintf_config.o ../condor_util_lib/except.o ../condor_util_lib/expr.o ../condor_util_lib/history.o ../condor_util_lib/job_queue.o ../condor_util_lib/ltrunc.o ../condor_util_lib/mkargv.o ../condor_util_lib/perror.o ../condor_util_lib/proc.o ../condor_util_lib/condor_config.o ../condor_util_lib/condor_errlst.o ../condor_util_lib/signames.o ../condor_util_lib/status.o ../condor_util_lib/strdup.o ../condor_util_lib/stricmp.o ../condor_util_lib/update_rusage.o:
	@echo ../condor_util_lib must be up to date before making $(SRC_DIR)
	@echo MISSING ../condor_util_lib/blankline.o ../condor_util_lib/config.o ../condor_util_lib/do_connect.o ../condor_util_lib/dprintf.o ../condor_util_lib/dprintf_config.o ../condor_util_lib/except.o ../condor_util_lib/expr.o ../condor_util_lib/history.o ../condor_util_lib/job_queue.o ../condor_util_lib/ltrunc.o ../condor_util_lib/mkargv.o ../condor_util_lib/perror.o ../condor_util_lib/proc.o ../condor_util_lib/condor_config.o ../condor_util_lib/condor_errlst.o ../condor_util_lib/signames.o ../condor_util_lib/status.o ../condor_util_lib/strdup.o ../condor_util_lib/stricmp.o ../condor_util_lib/update_rusage.o
	@false

../condor_xdr_lib/xdr_Init.o ../condor_xdr_lib/xdr_direntries.o ../condor_xdr_lib/xdr_expr.o ../condor_xdr_lib/xdr_fdset.o ../condor_xdr_lib/xdr_io.o ../condor_xdr_lib/xdr_itimerval.o ../condor_xdr_lib/xdr_mach_rec.o ../condor_xdr_lib/xdr_ports.o ../condor_xdr_lib/xdr_prio_rec.o ../condor_xdr_lib/xdr_proc.o ../condor_xdr_lib/xdr_ptr.o ../condor_xdr_lib/xdr_record.o ../condor_xdr_lib/xdr_rlimit.o ../condor_xdr_lib/xdr_rusage.o ../condor_xdr_lib/xdr_stat.o ../condor_xdr_lib/xdr_statfs.o ../condor_xdr_lib/xdr_status.o ../condor_xdr_lib/xdr_timeval.o ../condor_xdr_lib/xdr_timezone.o ../condor_xdr_lib/xdr_wait.o:
	@echo ../condor_xdr_lib must be up to date before making $(SRC_DIR)
	@echo MISSING ../condor_xdr_lib/xdr_Init.o ../condor_xdr_lib/xdr_direntries.o ../condor_xdr_lib/xdr_expr.o ../condor_xdr_lib/xdr_fdset.o ../condor_xdr_lib/xdr_io.o ../condor_xdr_lib/xdr_itimerval.o ../condor_xdr_lib/xdr_mach_rec.o ../condor_xdr_lib/xdr_ports.o ../condor_xdr_lib/xdr_prio_rec.o ../condor_xdr_lib/xdr_proc.o ../condor_xdr_lib/xdr_ptr.o ../condor_xdr_lib/xdr_record.o ../condor_xdr_lib/xdr_rlimit.o ../condor_xdr_lib/xdr_rusage.o ../condor_xdr_lib/xdr_stat.o ../condor_xdr_lib/xdr_statfs.o ../condor_xdr_lib/xdr_status.o ../condor_xdr_lib/xdr_timeval.o ../condor_xdr_lib/xdr_timezone.o ../condor_xdr_lib/xdr_wait.o
	@false

release::
	cp syscall.exp $(RELEASE_DIR)/lib
	cp C_getenv.o $(RELEASE_DIR)/lib

#
# Create a replacement for libc.a by copying it and replacing all
# the system calls with our own version.
#
libcondor.a:	../condor_util_lib/blankline.o ../condor_util_lib/config.o ../condor_util_lib/do_connect.o ../condor_util_lib/dprintf.o ../condor_util_lib/dprintf_config.o ../condor_util_lib/except.o ../condor_util_lib/expr.o ../condor_util_lib/history.o ../condor_util_lib/job_queue.o ../condor_util_lib/ltrunc.o ../condor_util_lib/mkargv.o ../condor_util_lib/perror.o ../condor_util_lib/proc.o ../condor_util_lib/condor_config.o ../condor_util_lib/condor_errlst.o ../condor_util_lib/signames.o ../condor_util_lib/status.o ../condor_util_lib/strdup.o ../condor_util_lib/stricmp.o ../condor_util_lib/update_rusage.o ../condor_xdr_lib/xdr_Init.o ../condor_xdr_lib/xdr_direntries.o ../condor_xdr_lib/xdr_expr.o ../condor_xdr_lib/xdr_fdset.o ../condor_xdr_lib/xdr_io.o ../condor_xdr_lib/xdr_itimerval.o ../condor_xdr_lib/xdr_mach_rec.o ../condor_xdr_lib/xdr_ports.o ../condor_xdr_lib/xdr_prio_rec.o ../condor_xdr_lib/xdr_proc.o ../condor_xdr_lib/xdr_ptr.o ../condor_xdr_lib/xdr_record.o ../condor_xdr_lib/xdr_rlimit.o ../condor_xdr_lib/xdr_rusage.o ../condor_xdr_lib/xdr_stat.o ../condor_xdr_lib/xdr_statfs.o ../condor_xdr_lib/xdr_status.o ../condor_xdr_lib/xdr_timeval.o ../condor_xdr_lib/xdr_timezone.o ../condor_xdr_lib/xdr_wait.o CONDOR_sysnames.o CONDOR_syscalls.o _mkckpt.o _updateckpt.o display.o ckpt.o restart.o syscall_mode.o xfer_file.o finfo.o ckpt_main.rem.o map_file.o extern_path.o fake_getmnt.o nfs.o intern_path.o extern_name.o stubs.o condor_shr.o
	rm -f libcondor.a
	cp $(LIBC) libcondor.a
	chmod u+w libcondor.a
	ar d libcondor.a shr.o
	ar vrs libcondor.a ../condor_util_lib/blankline.o ../condor_util_lib/config.o ../condor_util_lib/do_connect.o ../condor_util_lib/dprintf.o ../condor_util_lib/dprintf_config.o ../condor_util_lib/except.o ../condor_util_lib/expr.o ../condor_util_lib/history.o ../condor_util_lib/job_queue.o ../condor_util_lib/ltrunc.o ../condor_util_lib/mkargv.o ../condor_util_lib/perror.o ../condor_util_lib/proc.o ../condor_util_lib/condor_config.o ../condor_util_lib/condor_errlst.o ../condor_util_lib/signames.o ../condor_util_lib/status.o ../condor_util_lib/strdup.o ../condor_util_lib/stricmp.o ../condor_util_lib/update_rusage.o ../condor_xdr_lib/xdr_Init.o ../condor_xdr_lib/xdr_direntries.o ../condor_xdr_lib/xdr_expr.o ../condor_xdr_lib/xdr_fdset.o ../condor_xdr_lib/xdr_io.o ../condor_xdr_lib/xdr_itimerval.o ../condor_xdr_lib/xdr_mach_rec.o ../condor_xdr_lib/xdr_ports.o ../condor_xdr_lib/xdr_prio_rec.o ../condor_xdr_lib/xdr_proc.o ../condor_xdr_lib/xdr_ptr.o ../condor_xdr_lib/xdr_record.o ../condor_xdr_lib/xdr_rlimit.o ../condor_xdr_lib/xdr_rusage.o ../condor_xdr_lib/xdr_stat.o ../condor_xdr_lib/xdr_statfs.o ../condor_xdr_lib/xdr_status.o ../condor_xdr_lib/xdr_timeval.o ../condor_xdr_lib/xdr_timezone.o ../condor_xdr_lib/xdr_wait.o CONDOR_sysnames.o CONDOR_syscalls.o _mkckpt.o _updateckpt.o display.o ckpt.o restart.o syscall_mode.o xfer_file.o finfo.o ckpt_main.rem.o map_file.o extern_path.o fake_getmnt.o nfs.o intern_path.o extern_name.o stubs.o condor_shr.o
release:: libcondor.a
	cp libcondor.a  $(RELEASE_DIR)/lib
	ranlib -t $(RELEASE_DIR)/lib/libcondor.a
clean::
	rm -f libcondor.a ../condor_util_lib/blankline.o ../condor_util_lib/config.o ../condor_util_lib/do_connect.o ../condor_util_lib/dprintf.o ../condor_util_lib/dprintf_config.o ../condor_util_lib/except.o ../condor_util_lib/expr.o ../condor_util_lib/history.o ../condor_util_lib/job_queue.o ../condor_util_lib/ltrunc.o ../condor_util_lib/mkargv.o ../condor_util_lib/perror.o ../condor_util_lib/proc.o ../condor_util_lib/condor_config.o ../condor_util_lib/condor_errlst.o ../condor_util_lib/signames.o ../condor_util_lib/status.o ../condor_util_lib/strdup.o ../condor_util_lib/stricmp.o ../condor_util_lib/update_rusage.o ../condor_xdr_lib/xdr_Init.o ../condor_xdr_lib/xdr_direntries.o ../condor_xdr_lib/xdr_expr.o ../condor_xdr_lib/xdr_fdset.o ../condor_xdr_lib/xdr_io.o ../condor_xdr_lib/xdr_itimerval.o ../condor_xdr_lib/xdr_mach_rec.o ../condor_xdr_lib/xdr_ports.o ../condor_xdr_lib/xdr_prio_rec.o ../condor_xdr_lib/xdr_proc.o ../condor_xdr_lib/xdr_ptr.o ../condor_xdr_lib/xdr_record.o ../condor_xdr_lib/xdr_rlimit.o ../condor_xdr_lib/xdr_rusage.o ../condor_xdr_lib/xdr_stat.o ../condor_xdr_lib/xdr_statfs.o ../condor_xdr_lib/xdr_status.o ../condor_xdr_lib/xdr_timeval.o ../condor_xdr_lib/xdr_timezone.o ../condor_xdr_lib/xdr_wait.o CONDOR_sysnames.o CONDOR_syscalls.o _mkckpt.o _updateckpt.o display.o ckpt.o restart.o syscall_mode.o xfer_file.o finfo.o ckpt_main.rem.o map_file.o extern_path.o fake_getmnt.o nfs.o intern_path.o extern_name.o stubs.o condor_shr.o

#
# Create a replacement for libc.a to be linked with programs for
# checkpointing, but not remote execution.  N.B. This is done differently
# than other libraries in that we start out with a copy of libcondor.a,
# and replace ckpt_main.rem.o with ckpt_main.loc.o, (checkpointing
# only, no remote system calls).  Don't use the default rule for this one!
#
libckpt.a: ../condor_$(SYSCALL_LIB)/libcondor.a ckpt_main.loc.o
	rm -f libckpt.a
	cp libcondor.a  libckpt.a
	chmod u+w libckpt.a
	ar d libckpt.a ckpt_main.rem.o
	ar vrs libckpt.a ckpt_main.loc.o
release:: libckpt.a
	cp libckpt.a $(RELEASE_DIR)/lib
	ranlib -t $(RELEASE_DIR)/lib/libckpt.a
clean::
	rm -f ckpt_main.rem.o libckpt.a

#
# Condor version of libc.a/shr.o.
# Take the original shr.o and strip out the import from /unix.
# This will force these symbols to be resolved from stubs.o which
# will satisfy them with calls to syscall().
#

condor_shr.o: $(LIBC) zap
	ar x $(LIBC) shr.o
	mv shr.o condor_shr.o
	zap condor_shr.o
clean::
	rm -f shr.o condor_shr.o

#
# Provide the syscall() routine.
# Imports: all system calls from /unix
# Exports: syscall() and CondorErrno
#
syscall.shr.o: syscall.o syscall.exp
	ld -o syscall.shr.o \
		-bM:SRE -T512 \
		-bE:syscall.exp \
		-bI:$(SYSCALLS_EXP) \
		syscall.o
release::
	rm -f $(RELEASE_DIR)/lib/syscall.shr.o
	cp syscall.shr.o $(RELEASE_DIR)/lib
clean::
	rm -f syscall.shr.o syscall.o

#
# Be sure every Condor program contains one object compiled with "-g".
# Otherwise there will not be a DEBUG section in the final executable,
# and the checkpointing code will fail!
#
# In this version we compile with CONDOR defined, and get a
# checkpointing plus remote system call version.
#
ckpt_main.rem.o: ckpt_main.c
	$(CC) -c $(CFLAGS) -g ckpt_main.c
	mv ckpt_main.o ckpt_main.rem.o

#
# Be sure every Condor program contains one object compiled with "-g".
# Otherwise there will not be a DEBUG section in the final executable,
# and the checkpointing code will fail!
#
# In this version we compile without defining CONDOR, and get a
# checkpoint only, (no remote system calls) version.
#
ckpt_main.loc.o: ckpt_main.c
	$(CC) -c $(STD_C_FLAGS) -g ckpt_main.c
	mv ckpt_main.o ckpt_main.loc.o

#
# Replaces /lib/crt0.o in programs linked for execution with Condor
#
condor_rt0.o: $(CRT0) $(TO_UPPER)
	$(TO_UPPER) $(CRT0) condor_rt0.o main MAIN
release::
	cp condor_rt0.o $(RELEASE_DIR)/lib
clean::
	rm -f condor_rt0.o

#
# The aix fortran library libxlf.a defines a getenv() routine which takes 2
# arguments, the name of the environment variable, and buffer in which to
# put the associated value.
#
# The aix C library libc.a defines a getenv routine which takes 1 argument,
# the name of the environment variable, and it returns a pointer to the
# associated value.
#
# Condor programs need to be linked with the condor libraries, which will
# end up calling getenv(), and expecting the C version.  We therefore
# supply our own C version, so that we can get it linked in before the
# fortran version gets linked.
#
# Of course this will break any fortran programs which call getenv and expect
# the fortran version!  If some AIXpert knows how to fix this, I would be
# very happy to learn about it. -- mike
#

libfort.a: C_getenv.o
	rm -f libfort.a
	ar vrs libfort.a C_getenv.o
release:: libfort.a
	cp libfort.a $(RELEASE_DIR)/lib
	ranlib -t $(RELEASE_DIR)/lib/libfort.a
clean::
	rm -f libfort.a C_getenv.o

ALWAYS:

