# Generated automatically from Makefile.in by configure.
# Generated automatically from Makefile.in by configure.
# ObjCInterface Makefile for GNU Smalltalk
# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
# Written by Steve Byrne/John Stanhope

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program 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 General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# $Revision: 1.3 $

SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = .

PROGS = gst

# If you use gcc, you should either run the fixincludes script that
# comes with it or else use gcc with the -traditional option.  Otherwise
# ioctl calls will be compiled incorrectly on some systems.
#CC = cc
# Explicity set the compiler to NeXT's cc since I believe gcc will
# cause problem.  Change at you own risk.
CC = cc -ObjC
# Older makes don't set $(MAKE), so we set it for them.

BISON = bison
# Use cp if you don't have install.
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
AR = ar
RANLIB = ranlib
ALLOCA = 

DEFS = -DHAVE_CONFIG_H
#OBJC_LIBS = @OBJC_LIBS@ # libOCCode.a
# Remove the standard  -lm since it include -lm and that will cause
# conflicts with stuff in Media_s and NeXT_s
LIBS = -lMedia_s -lNeXT_s #  -lm
#LIBPROGS = @LIBPROGS@
MAKEINFO = @MAKEINFO@

COMPILE_TYPE = # Normal case
#COMPILE_TYPE = -DOPTIMIZE
#COMPILE_TYPE = -DPROFILE

# optimization flag -- may become host dependent
OPT_FLAG = -O
CDEBUG = -g

INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/../lib -I./lib
CFLAGS =  
LDFLAGS = 

prefix = /usr/local
exec_prefix = ${prefix}

# Where to install the executables.
bindir = $(exec_prefix)/bin

# Where to put the system-wide image file
libdir = $(prefix)/lib
smlibdir = $(libdir)/smalltalk

## Where to put the manual pages.
#mandir = $(prefix)/man

# Where to put the info pages
infodir = $(prefix)/info

#### End of system configuration section. ####

MDEFINES = bindir='$(bindir)' libdir='$(libdir)' mandir='$(mandir)' \
INSTALL='$(INSTALL)' INSTALLDATA='$(INSTALLDATA)' \
LIBS='$(LIBS)' LIBPROGS='$(LIBPROGS)' MAKE='$(MAKE)' \
AR='$(AR)' RANLIB='$(RANLIB)' \
BISON='$(BISON)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
CC='$(CC)' INCLUDES='$(INCLUDES)' DEFS='$(DEFS)' CDEBUG='$(CDEBUG)'

GENERIC_CC = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(CDEBUG) 


# This controls the distribution version (not completely yet)
VERSION = 1.2.alpha4

OBJECTS = cfuncs.o

SOURCES = cfuncs.c

DISTFILES = $(SOURCES) Makefile.in OCObject.st 

all: libOCCode.a gst


# I'm not sure about using srcdir/.. -- I think it's right, but it really
# depends upon what the semantics of srcdir are.
.c.o: 
	$(GENERIC_CC) $<

libOCCode.a:
	cd objclib; $(MAKE)
     
gst: $(OBJECTS) $(srcdir)/../main.o $(srcdir)/../lib/libgst.a $(srcdir)/objclib/libOCCode.a
	$(CC) $(LDFLAGS) $(LDPATH) $(BINDING) -o $@ $(CFLAGS) $(CDEBUG) \
		$(srcdir)/../main.o $(OBJECTS) $(srcdir)/../lib/libgst.a \
		$(srcdir)/objclib/libOCCode.a $(LIBS) 

optimize:
	echo Optimize target not operational yet

clean:
	rm -f *.o core
	rm -f gst gst.im
	cd objclib ; $(MAKE) clean

install: all 
	 echo Install target not operational yet
#	$(INSTALL_DATA) libmst.a $(smlibdir)/libmst.a

uninstall:


$(OBJECTS): $(srcdir)/../config.h

#$(srcdir)/../mstmain.o $(srcdir)/../lib/libmst.a
#	(cd $(srcdir)/..; make)

dist:
	ln $(DISTFILES) $(dist_target)

dist_missing:
	@test -f .ok-nodist-files || touch .ok-nodist-files
	@rlog -R RCS/* | sed -e 's;RCS/\(.*\),v;\1;' | sort > .rcs-files
	@for file in $(DISTFILES); do \
	    echo $$file  ; \
	done | \
	sort | comm -23 .rcs-files - | \
	    comm -23 - .ok-nodist-files

# dist_version should be set on the command line
dist_ci:
	ci -l -mVersioning "-N$(dist_version)" RCS/*


#----------- THE BARRIER ---------------
# Stuff below has not be integrated into the makefile yet




profile:
	make CFLAGS='$(CFLAGS) -pg -Dprofiling'




tags:
.PHONY: tags

TAGS:

ls:
.PHONY: ls

#clean:
#	@for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $(MDEFINES) $@ || exit 1; cd ..; done
#.PHONY: clean

distclean:
	@for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $(MDEFINES) $@ || exit 1; cd ..; done
	rm -f Makefile config.status tags TAGS
.PHONY: distclean

realclean:
	@for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $(MDEFINES) $@ || exit 1; cd ..; done
	rm -f Makefile config.status tags TAGS
.PHONY: realclean

# Tell versions [3.59, 3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
