include ../config

NAME = glibc-2.0.7

PWD := $(shell pwd)

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

all: upstream-install

dirs: stamp-dirs
stamp-dirs: 
	-mkdir $(LSRCDIR) $(LBUILDDIR) $(LTMPDIR)
	touch stamp-dirs

configure: stamp-configure
stamp-configure: stamp-dirs
	cd $(LBUILDDIR) && PATH=$(INSTALLDIR)/bin:$$PATH \
		BUILD_CC=gcc \
		CC='mipsel-linux-gcc -DDO_STATIC_NSS' \
		$(LSRCDIR)/configure --disable-shared --disable-profile --without-fp --enable-add-ons=yes --enable-kernel=2.4.0 --with-headers=$(KERNEL_HEADERS) --prefix=/usr --build=$(BUILD_ALIAS) --host=$(HOST_ALIAS)
	touch stamp-configure

build: stamp-build
stamp-build: stamp-configure
	cd $(LBUILDDIR) && PATH=$(INSTALLDIR)/bin:$$PATH \
		make
	touch stamp-build

upstream-install: stamp-upstream-install
stamp-upstream-install: stamp-build
	cd $(LBUILDDIR) && PATH=$(INSTALLDIR)/bin:$$PATH \
		make install install_root=$(LTMPDIR)
	touch stamp-upstream-install
