diff --git a/Makefile b/Makefile index 6e51827..af60ccc 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = flex,zlib +DEPENDS = flex,glibc,zlib ARCH = x86_64 URL = http://www.gnu.org/software/binutils/ DESC = The GNU Binutils are a collection of binary tools. -SNAPVER = sr2 +SNAPVER = sr3 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') @@ -21,13 +21,9 @@ PATCHDIR := $(PWD)/SRC/patches BUILDDIR := $(PWD)/BUILD VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER) -MAKE = make tooldir=/usr -MAKEINST = make tooldir=/usr install -SNAPHACKS = rm -v $(ROOT)/usr/share/info/dir - include /usr/share/snap/Makefile.snaplinux -$(SRCDIR): $(ARCHIVE) +$(SRCDIR)/configure: $(ARCHIVE) @if [ '$(TYPE)' == 'application/x-bzip2' ]; then \ tar -jxf $(ARCHIVE); \ elif [ '$(TYPE)' == 'application/x-gzip' ]; then \ @@ -40,14 +36,16 @@ $(SRCDIR): $(ARCHIVE) echo 'Unable to determine archive type'; \ exit 1; \ fi + @touch $(SRCDIR)/configure -$(BUILDDIR)/config.log: $(SRCDIR) +$(BUILDDIR)/config.log: $(SRCDIR)/configure + @cd $(SRCDIR) && \ + for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \ + patch --verbose -Np1 -i $$patch; \ + done @if [ ! -d $(BUILDDIR) ]; then \ mkdir -v $(BUILDDIR); \ fi - @cd $(SRCDIR) && for patch in `find $(PATCHDIR) -name \*.patch`; do \ - patch --verbose -Np0 -i $$patch; \ - done @cd $(BUILDDIR); \ ../$(SRCDIR)/configure \ --prefix=/usr \ @@ -58,8 +56,7 @@ $(BUILDDIR)/config.log: $(SRCDIR) --target=x86_64-snap-linux-gnu $(BUILDDIR)/binutils/ar: $(BUILDDIR)/config.log - @cd $(BUILDDIR); \ - $(MAKE) + @cd $(BUILDDIR) && make tooldir=/usr $(ROOT): $(BUILDDIR)/binutils/ar @if [ -d $(ROOT) ]; then \ @@ -68,10 +65,8 @@ $(ROOT): $(BUILDDIR)/binutils/ar mkdir -v $(ROOT); \ fi - @cd $(BUILDDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) - - @$(SNAPHACKS) + @cd $(BUILDDIR) && make tooldir=/usr install DESTDIR=$(ROOT) && \ + rm -v $(ROOT)/usr/share/info/dir test: $(ROOT) @cd $(BUILDDIR); \