#!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk package = mingw-w64-gcc target = x86_64-pc-mingw32 crt_xargs= prefix=/usr sysroot=$(prefix)/$(target) DESTDIR = $(shell /bin/pwd)/debian/$(package) docdir = debian/$(package)/usr/share/doc/$(package) DEB_INSTALL_DOCS_ALL := gcc/gcc/COPYING DEB_SHLIBDEPS_INCLUDE := debian/$(package)/usr/bin/$(target)-gcc DEB_DH_ALWAYS_EXCLUDE := .svn # do not strip anything. # call 'strip' on a mingw lib*.a file causes the ranlib information to # be discarded rendering the libraries useless. DEB_DH_STRIP_ARGS := -Xlib INSTALL_PROGRAM = install common-build-arch:: rm -rf debian/$(package) mkdir -p debian/$(package)$(sysroot)/mingw cd debian/$(package)$(sysroot)/mingw && ln -s $(sysroot)/mingw/include include cd debian/$(package)$(sysroot)/mingw && ln -s include include64 rm -rf gcc/gcc/build mkdir gcc/gcc/build cd gcc/gcc/build && ../configure --target=$(target) --prefix=$(prefix) --with-sysroot=$(sysroot) --datadir=$(sysroot)/share --mandir=$(sysroot)/share/man --infodir=$(sysroot)/share/info cd gcc/gcc/build && make all-gcc cd gcc/gcc/build && make DESTDIR=$(DESTDIR) install-gcc rm -rf mingw/mingw-w64-crt/build mkdir mingw/mingw-w64-crt/build cd mingw/mingw-w64-crt/build && CC="$(DESTDIR)/usr/bin/$(target)-gcc -B/usr/$(target)/bin -B$(DESTDIR)/usr/libexec/gcc" CXX="$(DESTDIR)/usr/bin/$(target)-g++ -B/usr/$(target)/bin -B$(DESTDIR)/usr/libexec/gcc" ../configure --host=$(target) --prefix=$(prefix) --with-sysroot=$(sysroot) --datarootdir=$(sysroot)/share $(crt_xargs) cd mingw/mingw-w64-crt/build && make cd mingw/mingw-w64-crt/build && make DESTDIR=$(DESTDIR) install rm -f gcc/gcc/winsup cd gcc/gcc && ln -s $(DESTDIR)$(sysroot) winsup rm -f gcc/gcc/build/$(target)/winsup mkdir -p gcc/gcc/build/$(target)/winsup cd gcc/gcc/build/$(target)/winsup && ln -s $(DESTDIR)$(sysroot)/lib mingw cd gcc/gcc/build/gcc && for file in $(DESTDIR)$(sysroot)/lib/*.o; do test ! -e `basename $file` && ln -s $$file .; done cd gcc/gcc/build && make all touch common-build-arch clean:: rm -f compile common-install-arch common-build-arch rm -rf *~ debian/$(package) debian/*~ debian/files* debian/substvars debian/compat rm -rf gcc/gcc/build rm -rf mingw/mingw-w64-crt/build rm -f gcc/gcc/winsup # # info pages, locale data and man pages are in /usr/$(target)/share # static helper libraries for host system (libiberty.a) are deleted # common-install-arch:: cd gcc/gcc/build && make DESTDIR=$(DESTDIR) install mkdir -p debian/$(package)$(sysroot)/bin mv debian/$(package)/usr/bin/libgcc_s_sjlj-1.dll debian/$(package)$(sysroot)/bin rm -f debian/$(package)$(sysroot)/mingw/include rm -rf debian/$(package)/usr/lib/lib*.a touch common-install-arch