include ../config

NAME = binutils-2.11.92.0.10

LSRCDIR= $(SRCDIR)/$(NAME)
LBUILDDIR = $(BUILDDIR)/$(NAME)
LUNPACKDIR = $(UNPACKDIR)/binutils-2.11.92.0.10-1.src.rpm-unpacked

AR=ar
CC=gcc
LD=ld
NM=nm
RANLIB=ranlib

export AR CC LD NM RANLIB

all: install

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

unpack: stamp-unpack
stamp-unpack: stamp-dirs
	cd $(UNPACKDIR) && tar xfz $(RPMSRCDIR)/binutils-2.11.92.0.10-1.src.rpm-unpacked.tar.gz
	touch stamp-unpack

untar: stamp-untar
stamp-untar: stamp-unpack
	cd $(SRCDIR) && tar xfz $(LUNPACKDIR)/binutils-2.11.92.0.10.tar.gz
	touch stamp-untar

patch: stamp-patch
stamp-patch: stamp-untar
	touch stamp-patch

configure: stamp-configure
stamp-configure: stamp-patch
	cd $(LBUILDDIR) && $(LSRCDIR)/configure --enable-shared --target=$(HOST_ALIAS) --prefix=$(INSTALLDIR)
	touch stamp-configure

build: stamp-build
stamp-build: stamp-configure
	cd $(LBUILDDIR) && make
	touch stamp-build

install: stamp-install
stamp-install: stamp-build
	cd $(LBUILDDIR) && make install
	strip -g $(INSTALLDIR)/bin/*
	touch stamp-install


