###############################################################################
#
# Makefile
#
# Make program to build various tools for the Aldor compiler
#
# Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org).
#
###############################################################################
#
# Targets: all, junk, clean
#
#    make all   -- make the various tools for the Aldor compiler
#    make junk  -- list files which are not part of the tools
#    make clean -- remove generated files  (e.g. foo.c~)
#
###############################################################################
#
#  2006/Dec/22
#
#  On Solaris, the value of PWD does not change when make is invoked
#  recursively.  Consequently, it is necessary to explicitly set it
#  at the start of the makefile.
#
PWD = $(shell pwd)

SHELL = /bin/sh

ALDORROOTS=$(ALDORROOT)/toolbin

OKFILES = Makefile Makefile.win32 port unix win32

all::	portdir unixdir

clean::
	@ ( cd $(ALDORTOOLS) ; rm -f y.tab.h y.tab.c lex.yy.c *.o *~ )
junk::
	@ ls -d $(OKFILES) * | sort | grep -v CVS | uniq -u 


portdir:
	-(cd port ; $(MAKE) all)
clean::
	-(cd port ; $(MAKE) clean)
junk::
	-(cd port ; $(MAKE) junk)


unixdir:
	-(cd unix ; $(MAKE) all)
clean::
	-(cd unix ; $(MAKE) clean)
junk::
	-(cd unix ; $(MAKE) junk)


win32dir:
	-(cd win32 ; $(MAKE) all)
clean::
	-(cd win32 ; $(MAKE) clean)
junk::
	-(cd win32 ; $(MAKE) junk)
