#!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk prefix=/usr package = mingw-w64-expat target = x86_64-w64-mingw32 docdir = debian/$(package)/usr/share/doc/$(package) builddir = build/mingw-w64 DESTDIR = $(shell /bin/pwd)/debian/$(package) gcc = x86_64-w64-mingw32-gcc gpp = x86_64-w64-mingw32-g++ ld = x86_64-w64-mingw32-ld ar = x86_64-w64-mingw32-ar rc = x86_64-w64-mingw32-windres strip = x86_64-w64-mingw32-strip package32 = mingw-w32-expat target32 = i686-w64-mingw32 docdir32 = debian/$(package32)/usr/share/doc/$(package32) builddir32 = build/mingw-w32 DESTDIR32 = $(shell /bin/pwd)/debian/$(package32) gcc32 = i686-w64-mingw32-gcc gpp = i686-w64-mingw32-g++ ld32 = i686-w64-mingw32-ld ar32 = i686-w64-mingw32-ar rc32 = i686-w64-mingw32-windres strip32 = i686-w64-mingw32-strip cflags=-O3 -Wall cxxflags=-O3 -Wall ldflags=-s arflags=rcs rcflags=--define GCC_WINDRES DEB_INSTALL_DOCS_ALL := src/COPYING src/README DEB_SHLIBDEPS_INCLUDE := 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-indep:: rm -rf $(builddir) mkdir -p $(builddir) cd $(builddir) && CC=$(gcc) CFLAGS="$(cflags)" CXX=$(gpp) CXXFLAGS="$(cxxflags)" LD=$(ld) LDFLAGS=$(ldflags) AR=$(ar) ARFLAGS=$(arflags) RC=$(rc) RCFLAGS="$(rcflags)" ../../src/configure --prefix=$(prefix)/$(target) --host=$(target) cd $(builddir) && make rm -rf $(builddir32) mkdir -p $(builddir32) cd $(builddir32) && CC=$(gcc32) CFLAGS="$(cflags)" CXX=$(gpp32) CXXFLAGS="$(cxxflags)" LD=$(ld) LDFLAGS=$(ldflags) AR=$(ar32) ARFLAGS=$(arflags) RC=$(rc32) RCFLAGS="$(rcflags)" ../../src/configure --prefix=$(prefix)/$(target32) --host=$(target32) cd $(builddir32) && make touch common-build-arch clean:: rm -f compile common-install-indep common-build-indep rm -rf *~ debian/$(package) debian/$(package32) debian/*~ debian/files* debian/substvars rm -rf $(builddir) $(builddir32) # # info pages, locale data and static libraries may conflict with # already installed binutils packages. # common-install-indep:: rm -rf debian/$(package) mkdir debian/$(package) cd $(builddir) && make DESTDIR=$(DESTDIR) install rm -rf debian/$(package32) mkdir debian/$(package32) cd $(builddir32) && make DESTDIR=$(DESTDIR32) install #mkdir -p debian/$(package)/usr/x86_64-w64-mingw32/lib/pkgconfig #sed -e 's/__VERSION__/$(DEB_UPSTREAM_VERSION)/' -e 's/__arch__/x86_64-w64-mingw32/' < pc/expat.pc > debian/$(package)/usr/x86_64-w64-mingw32/lib/pkgconfig/expat.pc #mkdir -p debian/$(package32)/usr/i686-w64-mingw32/lib/pkgconfig #sed -e 's/__VERSION__/$(DEB_UPSTREAM_VERSION)/' -e 's/__arch__/i686-w64-mingw32/' < pc/expat.pc > debian/$(package32)/usr/i686-w64-mingw32/lib/pkgconfig/expat.pc touch common-install-indep