# Generated automatically from Makefile.defs.in by configure.
# Generated automatically from Makefile.defs.in by configure.
# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
# Written by Steve Byrne

# 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.1 $

SHELL = /bin/sh
# .SUFFIXES : .obj .h .c   # OS/2 w/gnu make needs this

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

srcdir = .

PROGS = gst

# Last Validated: 9/17/95
MAINTAINER = 'bug-gnu-smalltalk@gnu.ai.mit.edu'

READLINE = @READLINE@

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

# 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
# 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
LIBS =  -lm $(USER_LIBS)    # on OS/2, we don't need -lm 

# other definitions
GST_TAB=gst.tab
RM=rm -f

OBJ=o
LIB=a

MAKE_LIBRARY_COMMAND=cd lib; $(MAKE) all
COMPLETE_MAKE=

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

# Other version related definitions (mostly for DOS) 
ST_MAJOR_VERSION = 1
ST_MINOR_VERSION = 2
ST_EDIT_VERSION  = 5
ST_EDIT_PREFIX   = alpha


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

#INCLUDES = @includeopt@
INCLUDES= -I.. -I$(srcdir) -I$(srcdir)/../lib $(USER_INCLUDES)
CPPFLAGS = 
CFLAGS =  # $(INCLUDES)
LDPATH =  
LDFLAGS =  $(USER_LDFLAGS)
GCC_EXTRA_FLAGS = -Wimplicit -Wreturn-type -Wunused 
# ICC_EXTRA_FLAGS = /c /Fo$@ /D__EXTENDED__  # flags for ICC

X_CFLAGS =  -I/usr/X11R6/include
X_LIBS =  -L/usr/X11R6/lib
X_EXTRA_LIBS = 
X_PRE_LIBS =  -lSM -lICE

MAKEINFO = :

# Use cp if you don't have install.
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644



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
stdir = $(prefix)/smalltalk

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

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

# Where to put include files
includedir = $(prefix)/include


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

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


GENERIC_CC = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(GCC_EXTRA_FLAGS) $(CFLAGS) $(CDEBUG) 
# here's the OS/2 definition
# GENERIC_CC = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(GCC_EXTRA_FLAGS) $(CFLAGS) $(ICC_EXTRA_FLAGS) $(CDEBUG) 

.c.$(OBJ): 
	$(GENERIC_CC) $<



# examples Makefile for GNU Smalltalk
# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
# Written by Steve Byrne

# 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.2 $


OBJECTS = 

SOURCES = 

DISTFILES = Makefile.body CFuncs.st Host.st README RandomInteger.st defwin.c \
    mem-usage.st pids.c printHier.st suntool.st up.st win.c

all:
	@echo this makefile does nothing at the moment by default

######################################################################
######################################################################
######################################################################
###
### Generic GNU Smalltalk make rules
###
### $Revision: 1.1 $
###
######################################################################
######################################################################
######################################################################

# basic rule templates common to all make files

gst: $(OBJECTS) $(srcdir)/../main.$(OBJ) $(srcdir)/../lib/libgst.$(LIB)
	$(RM) gst
	$(CC) $(LDFLAGS) $(LDPATH) $(BINDING) -o $@ $(CFLAGS) $(CDEBUG) \
		$(srcdir)/../main.$(OBJ) $(OBJECTS) $(srcdir)/../lib/libgst.$(LIB) \
		$(LIBS)

# It is not clear that optimize should use :: instead of :
optimize::
	echo $(CFLAGS)
	$(MAKE) CFLAGS="-DOPTIMIZE $(OPT_FLAG) $(CFLAGS)" CDEBUG= TARGET=optimize

clean::
	$(RM) *.$(OBJ) core
	$(RM) gst gst.im

installdirs:
	$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(smlibdir) $(infodir) \
		 $(stdir)

#Note: this definition of install is most likely incorrect
install:: installdirs all 
	$(INSTALL_PROGRAM) gst $(bindir)/$(binprefix)gst
	@INSTALL_ST_FILES@

#install uninstall TAGS clean mostlyclean distclean realclean::
install uninstall clean mostlyclean distclean realclean::
	for dir in $(SUBDIRS); do \
	  echo making $@ in $$dir ; \
	  (cd $$dir; $(MAKE) $@) ; \
	done



# !!! Clean these up in the future 


#
# Install the files into the proper place
#

#install: all
#	echo "install not ready"
#	if test ! -d KERNEL_PATH ; then      \
#	    mkdir -p KERNEL_PATH ;           \
#	fi
#	cp *.st KERNEL_PATH
#	(cd KERNEL_PATH; chmod +r *.st)
#	if test ! -d IMAGE_PATH ; then      \
#	    mkdir -p IMAGE_PATH ;           \
#	fi
#	(x=`pwd`; cd IMAGE_PATH; $$x/gst -Vi)



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_missingr:
	for dir in . $(SUBDIRS); do \
	    (cd $$dir; \
	    $(MAKE) dist_missing ); \
	done

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



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

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


#tags:
#	@for dir in $(TSUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $(MDEFINES) $@ || exit 1; cd ..; done
#	@echo making $@ in .
#	@ctags `for i in \`$(MAKE) SUBDIRS="$(TSUBDIRS)" ls\` ; do echo $(srcdir)/$$i ; done`
.PHONY: tags

#TAGS:
#	@for dir in $(TSUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $(MDEFINES) $@ || exit 1; cd ..; done
#	@echo making $@ in .
#	@etags `for i in \`$(MAKE) SUBDIRS="$(TSUBDIRS)" ls\` ; do echo $(srcdir)/$$i ; done`

ls:
###	@echo $(DISTFILES)
###	@for dir in $(SUBDIRS); do \
###		for i in `cd $$dir; $(MAKE) $(MDEFINES) $@` ; do \
###			echo $$dir/$$i ; \
###		done ; \
###	done
.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) Makefile config.status tags TAGS config.log config.cache
.PHONY: distclean

realclean::
	@for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $(MDEFINES) $@ || exit 1; cd ..; done
	$(RM) 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:
