#
#  This stub `Makefile' was created automatically by configure.
#  (BEGINNING OF AUTOMATICALLY GENERATED PORTION)

export CC = gcc
export LD = ld
export OBJCOPY = objcopy
export SHARED_FLAGS = -pipe -fno-builtin -nostdinc -Os -mpreferred-stack-boundary=2  -DEXT_C\(x\)="x"
export PC9800 = 1
export PTABLE_EDITOR =

#  (END OF AUTOMATICALLY GENERATED PORTION)
#

#							-*- Makefile -*-
#  GRUB Makefile ending stub, to be automatically added to the end of the
#  part created by configure.
#

ifneq ($(PC9800),)
 SHARED_FLAGS += -DPC9800=$(PC9800) -Wall -fomit-frame-pointer
endif

PROGS=	stage1 ffs_stage1_5 stage2 stage2_debug

all: $(PROGS:%=all-%)
#	@for X in $(PROGS) ; do (cd $$X ; $(MAKE)) ; done

$(PROGS:%=all-%):
	cd $(@:all-%=%) && $(MAKE) all

clean:
#	@for X in $(PROGS) ; do (cd $$X ; $(MAKE) clean) ; done
	@case "$(MAKEFLAGS)" in *k*) ;; *) set -e ;; esac; \
	 for X in $(PROGS) ; do $(MAKE) -C $$X clean ; done
	rm -f config.log

ifneq ($(PC9800),)
TAR	= tar
ARCHIVE_PREFIX = /tmp/
ARCHIVE	= grub-0.5-pc9800-`date +%Y%m%d`.tar.gz
EXCLUDE	= \*.\[os\] \*.list \*.exec \*~ grub-0.5/Makefile config.log TAGS RCS

archive:
	GZIP=-9 $(TAR) -zcvf $(ARCHIVE_PREFIX)$(ARCHIVE) \
		$(addprefix --exclude=,$(EXCLUDE)) \
		-C .. grub-0.5
endif
