#!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk prefix=/usr crt_xargs= package = mingw-w64-gcc rtpackage = mingw-w64-gcc-rt target = x86_64-w64-mingw32 sysroot=$(prefix)/$(target) DESTDIR = $(shell /bin/pwd)/debian/$(package) package32 = mingw-w32-gcc rtpackage32 = mingw-w32-gcc-rt target32 = i686-w64-mingw32 sysroot32=$(prefix)/$(target32) DESTDIR32 = $(shell /bin/pwd)/debian/$(package32) docdir = debian/$(package)/usr/share/doc/$(package) docdir32 = debian/$(package32)/usr/share/doc/$(package32) DEB_INSTALL_DOCS_ALL := 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) debian/$(rtpackage) mkdir -p debian/$(package)$(sysroot) rm -rf gcc/build mkdir gcc/build cd gcc/build && ../configure --disable-multilib --target=$(target) --prefix=$(prefix) --with-sysroot=$(sysroot) --datadir=$(sysroot)/share --mandir=$(sysroot)/share/man --infodir=$(sysroot)/share/info cd gcc/build && make all rm -rf debian/$(package32) debian/$(rtpackage32) mkdir -p debian/$(package32)$(sysroot32) rm -rf gcc/build32 mkdir gcc/build32 cd gcc/build32 && ../configure --disable-multilib --target=$(target32) --prefix=$(prefix) --with-sysroot=$(sysroot32) --datadir=$(sysroot32)/share --mandir=$(sysroot32)/share/man --infodir=$(sysroot32)/share/info cd gcc/build32 && make all touch common-build-arch clean:: rm -f compile common-install-arch common-build-arch rm -rf *~ debian/$(package) debian/$(package32) debian/*~ debian/files* debian/substvars debian/compat rm -rf gcc/build gcc/build32 rm -rf 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/build && make DESTDIR=$(DESTDIR) install mkdir -p debian/$(package)$(sysroot)/bin cd debian/$(package)$(sysroot)/lib && for file in *.dll; do ln -s ../lib/$$file ../bin; done rm -rf debian/$(package)/usr/lib/lib*.a rm -f debian/$(package)$(sysroot)/share/info/dir mkdir -p debian/$(rtpackage)$(sysroot)/bin debian/$(rtpackage)$(sysroot)/lib mv debian/$(package)$(sysroot)/bin/libgcc_s_sjlj-1.dll debian/$(rtpackage)$(sysroot)/bin/ mv debian/$(package)$(sysroot)/bin/libstdc++-6.dll debian/$(rtpackage)$(sysroot)/bin/ mv debian/$(package)$(sysroot)/lib/libgcc_s_sjlj-1.dll debian/$(rtpackage)$(sysroot)/lib/ mv debian/$(package)$(sysroot)/lib/libstdc++-6.dll debian/$(rtpackage)$(sysroot)/lib/ cd gcc/build32 && make DESTDIR=$(DESTDIR32) install mkdir -p debian/$(package32)$(sysroot32)/bin cd debian/$(package32)$(sysroot32)/lib && for file in *.dll; do ln -s ../lib/$$file ../bin; done rm -rf debian/$(package32)/usr/lib/lib*.a rm -f debian/$(package32)$(sysroot32)/share/info/dir mkdir -p debian/$(rtpackage32)$(sysroot32)/bin debian/$(rtpackage32)$(sysroot32)/lib mv debian/$(package32)$(sysroot32)/bin/libgcc_s_sjlj-1.dll debian/$(rtpackage32)$(sysroot32)/bin/ mv debian/$(package32)$(sysroot32)/bin/libstdc++-6.dll debian/$(rtpackage32)$(sysroot32)/bin/ mv debian/$(package32)$(sysroot32)/lib/libgcc_s_sjlj-1.dll debian/$(rtpackage32)$(sysroot32)/lib/ mv debian/$(package32)$(sysroot32)/lib/libstdc++-6.dll debian/$(rtpackage32)$(sysroot32)/lib/ touch common-install-arch