diff --git a/Makefile b/Makefile index 537c9c7..da00ccd 100644 --- a/Makefile +++ b/Makefile @@ -8,21 +8,29 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = glibc,gmp,mpc,mpfr,zlib -ARCH = x86_64 -URL = https://gcc.gnu.org/ +export SRCPKG = gcc +export DEPENDS = glibc,gmp,libgcc,libstdc++,mpc,mpfr,zlib +export ARCH = x86_64 +export URL = https://gcc.gnu.org/ +BRIEF = GNU compiler collection DESC = The GNU Compiler Collection includes front ends for C, C++, \ Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these \ languages (libstdc++, libgcj,...). -SNAPVER = sr1 +SNAPVER = 2 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//') PATCHDIR := $(PWD)/SRC/patches BUILDDIR := $(PWD)/BUILD -VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER) MACHINE := $(gcc -dumpmachine) +export VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'| \ + sed 's/^-//')-$(SNAPVER) + +LIBGCC := $(PWD)/libgcc +LIBGCCROOT := $(LIBGCC)/ROOT +LIBSTDC := $(PWD)/libstdc++ +LIBSTDCROOT := $(LIBSTDC)/ROOT include /usr/share/snap/Makefile.snaplinux @@ -85,12 +93,26 @@ $(ROOT): $(BUILDDIR)/gcc $(ROOT)/usr/share/gdb/auto-load/usr/lib && \ rm -v $(ROOT)/usr/share/info/dir + @install -v -d $(LIBGCC)/SNAP && \ + install -v -d $(LIBGCCROOT) && \ + install -v -d $(LIBSTDC)/SNAP && \ + install -v -d $(LIBSTDCROOT) && \ + install -v -d -m 755 $(LIBGCCROOT)/usr/lib && \ + install -v -d -m 755 $(LIBSTDCROOT)/usr/lib && \ + mv -v $(ROOT)/usr/lib64/libgcc_s.so* $(LIBGCCROOT)/usr/lib && \ + mv -v $(ROOT)/usr/lib64/libstdc++* $(LIBSTDCROOT)/usr/lib && \ + find $(ROOT) -type d -empty -delete && \ + cd $(LIBGCC) && make -f ../Makefile.libgcc && mv *.snap ../ && \ + cd $(LIBSTDC) && make -f ../Makefile.libstdc++ && mv *.snap ../ + test: $(ROOT) @cd $(BUILDDIR); \ make -k check clean: @rm -rvf $(ROOT) \ + $(LIBGCC) \ + $(LIBSTDC) \ $(SNAPINFO) \ $(MANIFEST) \ $(FILES) \ diff --git a/Makefile.libgcc b/Makefile.libgcc new file mode 100644 index 0000000..a7854b4 --- /dev/null +++ b/Makefile.libgcc @@ -0,0 +1,15 @@ +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation here: +# (http://www.gnu.org/licenses/gpl-2.0.html) +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +DEPENDS = +BRIEF = Run time library for some gcc compiled binaires +DESC = Run time library for some gcc compiled binaires + +include /usr/share/snap/Makefile.snaplinux diff --git a/Makefile.libstdc++ b/Makefile.libstdc++ new file mode 100644 index 0000000..60b81fa --- /dev/null +++ b/Makefile.libstdc++ @@ -0,0 +1,15 @@ +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation here: +# (http://www.gnu.org/licenses/gpl-2.0.html) +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +DEPENDS = +BRIEF = Run time library for C++ binaries +DESC = Run time library for C++ binaries + +include /usr/share/snap/Makefile.snaplinux