# Makefile for RUNNER.
# Written by Tiggr <tiggr@es.ele.tue.nl> and Michael <michael@thi.nl>
#
# Copyright (C) 1994, 1995 Pieter J. Schoenmakers and Michael L.H. Brouwer.
# All rights reserved.
#
# This file is part of RUNNER.
#
# RUNNER is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# RUNNER is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
# License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with RUNNER; see the file COPYING.LIB.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# $Id: Makefile,v 1.2 1995/08/28 15:01:21 tiggr Exp $

# Possible features:
#    HAVE_FOUNDATION	assume the resulting programs will be linked
#			against libFoundation, thus needing top level
#			NSAutoreleasePool management.
FEATURE_DEFINES=	-DHAVE_FOUNDATION

# Where do we install all this.
INSTALLDIR=	/usr/local

CLASSES=	TMConnectionObserver.m TMConnectionRunner.m

HFILES=		runner.h
CFILES=		

OTHER_CFLAGS =  $(FEATURE_DEFINES)
OTHER_OFILES=	remoteHelper.o
OTHER_GARBAGE=	libNeXT_p.a remoteHelper.o example example.o

NAME=		runner

TMMAKEFILEDIR=	.
include $(TMMAKEFILEDIR)/lib.make
-include Makefile.dependencies

# Obtain the NXConnection category which defines the `-runFromAppkit'
# method and related functionality.
remoteHelper.o: libNeXT_p.a
	ar x libNeXT_p.a remoteHelper.o

# Since ar x will not work on a fat library thin it first if we can
# and/or need.
libNeXT_p.a:
	@(rm -f $@; \
	  if test -f /bin/lipo; then \
	    /bin/lipo /usr/lib/libNeXT_p.a -thin `arch` -output $@; \
	  else \
	    ln -s /usr/lib/libNeXT_p.a $@; \
	  fi)

example: debug example.o
	$(CC) $(CFLAGS) -o example -ObjC example.o -L. -lrunner_g -lFoundation_s

example.o: example.m
	$(CC) $(CFLAGS) -g -c example.m
