include ../config

NAME = flex-2.5.4

PWD := $(shell pwd)

LSRCDIR= $(SRCDIR)/$(NAME)
LBUILDDIR = $(BUILDDIR)/$(NAME)
LTMPDIR = $(BUILDDIR)/$(NAME)

all: install

dirs: stamp-dirs
stamp-dirs: 
	mkdir -p $(LBUILDDIR)
	touch stamp-dirs

untar: stamp-untar
stamp-untar: stamp-dirs
	cd $(SRCDIR) && tar xfz $(DEBSRCDIR)/flex_2.5.4a.orig.tar.gz
	touch stamp-untar


configure: stamp-configure
stamp-configure: stamp-untar
	cd $(LBUILDDIR) && PATH=$(INSTALLDIR)/bin:$$PATH \
		CC='mipsel-linux-snow-gcc' RANLIB='mipsel-linux-ranlib' CFLAGS='-O2' $(LSRCDIR)/configure 
	touch stamp-configure


build: stamp-build
stamp-build: stamp-configure
	cd $(LBUILDDIR) && PATH=$(INSTALLDIR)/bin:$$PATH \
		make AR='mipsel-linux-ar'
	touch stamp-build

install: stamp-install
stamp-install: stamp-build
	cd $(LBUILDDIR) && PATH=$(INSTALLDIR)/bin:$$PATH \
		cp libfl.a $(INSTALLDIR)/mipsel-linux/lib/soft-float/snow-model/
	touch stamp-install
