###########################################################################
#
#	Makefile
#
#	Resource compiler makefile.
#
#	@(#)Makefile	2.17 4/15/97 15:52:54 /users/sccs/src/winsdk/rc/s.Makefile
#
#	Copyright (c) 1995-1996, Willows Software Inc.  All rights reserved.
#
#
#	TARGET is the destination of a build.
#	TWINDIR is the destination directory for any installations.
#
###########################################################################

default = bin
project = rc


TWIN_XFLAGS =  -DRC_VERSION=\"$(VERNAME)\"
TWIN_AUXINC =  -I$(TWINDIR)/win

# Installation command, used to control owner and privleges.
INSTALL_EXEC=install -m 0755

VERNAME = $(VERSION).$(PATCHLEVEL).$(ALPHA)

components = lex.yy.o rc.y.tab.o rc.z.tab.o define.o resources.o util.o \
	   rc.o printres.o cmdline.o buffer.o cleanup.o mdc.o

made_objects = rc.y.tab.c rc.y.tab.h lex.yy.c rc.z.tab.c rc.z.tab.h

include $(TWINDIR)/Makefile.config

rc: $(components)
	$(CC) -o rc $(components)

lex.yy.o: rc.y.tab.h rc.z.tab.h define.h rc.h
rc.y.tab.o: rc.h define.h buffer.h resfunc.h
rc.z.tab.o:
define.o: define.h
resources.o: rc.h buffer.h restypes.h resfunc.h
util.o: restypes.h
rc.o: rc.h define.h restypes.h
convert.o: rc.h restypes.h
nprint.o: rc.h restypes.h
buffer.o: rc.h buffer.h
 
lex.yy.c: rclex.l Makefile
	$(LEX) -i rclex.l

rc.y.tab.c rc.y.tab.h: rcyacc.y Makefile
	$(YACC) -d rcyacc.y
	@mv y.tab.c rc.y.tab.c
	@mv y.tab.h rc.y.tab.h

rc.z.tab.c rc.z.tab.h: ifyacc.y Makefile
	$(YACC) -d ifyacc.y
	@sed -e "s/yy/zz/g" -e "s/YY/ZZ/g" y.tab.c >rc.z.tab.c
	@sed -e "s/yy/zz/g" -e "s/YY/ZZ/g" y.tab.h >rc.z.tab.h
	@rm y.tab.?
