#
# makefile
#
# Copyright (C) 1997 Be Inc.  All Rights Reserved
#

SHELL		:= /bin/sh

#######
include $(BUILDHOME)/buildprefs/make.pre
#######

INCLUDES	+= -I. -I.. -I../intl
CFLAGS		+= -DHAVE_CONFIG_H

TARGET		= $(OBJ_DIR)/bison

APP_VERSION     = -app 1 28 0 f 0 -short 1.28 -long "1.28 "`echo -n -e '\302\251'`" 1999 The Free Software Foundation"

SRCS		= \
				LR0.c \
				allocate.c \
				closure.c \
				conflicts.c \
				derives.c \
				files.c	\
	  			getargs.c \
				gram.c \
				lalr.c \
				lex.c \
	  			main.c \
				nullable.c \
				output.c \
				print.c \
				reader.c \
				reduce.c \
				symtab.c \
				warshall.c

OBJS := $(SRCS_LIST_TO_OBJS)

$(TARGET):	$(OBJ_DIR) $(OBJS)
		$(LD) -o $@ $(OBJS) ../intl/$(OBJ_DIR)/libintl.a $(LDFLAGS)
		$(SETVERSION) $@ $(SYSTEM_VERSION) $(APP_VERSION)

install::	$(TARGET)
		sed -e "/^#line/ s|bison|/etc/bison|" -e "s/@bison_version@/1.28/" <bison.s1 >$(OBJ_DIR)/bison.simple
		install -m 0644 $(OBJ_DIR)/bison.simple $(INSTALL_ETC)/bison.simple
		install -m 0644 bison.hairy $(INSTALL_ETC)/bison.hairy

#######
include $(BUILDHOME)/buildprefs/make.post
#######
