# (C) Copyright International Business Machines Corporation 23 January 
# 1990.  All Rights Reserved. 
#  
# See the file USERAGREEMENT distributed with this software for full 
# terms and conditions of use. 
# SCCS Info: @(#)Makefile	1.11 5/10/90

DEFOBJS	=	libinit.do errno.do initcwd.do \
		fixdefs.do fixfull.do fixfullint.do fixmin.do \
		progfixfull.do itoa.do checkdefs.do

include ../../make/includefile

# Set GENHROOT to something other than HROOT in order to use
# definition modules from a different hermes system while using the
# current system's compiler.  This is used by the precompilerboot
# target in the root Makefile
GENHROOT =	$(HROOT)
GENBIN =	$(GENHROOT)/bin

DEFDIR =	$(GENBIN)

# parameterize the .d.do rule so we can bootstrap with the standalone parser
.d.do:
	$(STANDALONE) $*$(DEFSUFFIX)
STANDALONE =
DEFSUFFIX =

all:	compiledefs

boot:	
	$(MAKE) defobjs HROOT=$(HROOT) GENHROOT=$(GENHROOT) MTYPE=$(MTYPE) \
		STANDALONE="sleep 1; env $(HERMENV) $(HERMES)" DEFSUFFIX=".d"

# see interface/Makefile for a description of the following bogosity
fixdefs:
	@-mkdir .dosave 2>/dev/null; 
	@-rm -f .dosave/* 2>/dev/null
	@mv *.do .dosave
	@dlist=`make -n defobjs` ; echo $$dlist > .dlist
	@mv .dosave/* .
	@rmdir .dosave
	@dlist=`cat .dlist` ; rm .dlist ; \
		echo env $(HERMENV) $(HERMI) $(CACHE) fixdefs $$dlist ; \
		env $(HERMENV) $(HERMI) $(CACHE) fixdefs $$dlist


libinit.do: libinit.d 

errno.do: errno.d 

initcwd.do: initcwd.d

fixdefs.do: fixdefs.d

fixmin.do: fixfull.do

checkdefs.do: checkdefs.d

clean:
	rm -f core *~ *.do .made
