]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - distro/archlinux/this/Makefile
Cross architecture stuff for distro build scripts. If you have an x86_64 capable...
[xonotic/gmqcc.git] / distro / archlinux / this / Makefile
index 6d3b557580f43230742274e032324834bb37fe40..df94ff34526cbf6b4c0eacc5e368073e5623025b 100644 (file)
@@ -9,9 +9,16 @@ CARCH   := $(shell uname -m)
 PKGDIR  := gmqcc-$(MAJOR).$(MINOR).$(PATCH)-$(PKGREL)-$(CARCH)
 PKG     := $(PKGDIR).pkg.tar.xz
 PKGINFO := $(PKGDIR)/.PKGINFO
+CFLAGS  :=
 
-base: clean
-       $(MAKE) -C $(BASEDIR) DESTDIR=distro/archlinux/this/$(PKGDIR) PREFIX=$(PREFIX) install
+
+ifneq (, $(findstring i686, $(CARCH)))
+       CFLAGS := -m32
+endif
+
+base:
+       $(MAKE) -C $(BASEDIR) clean
+       $(MAKE) -C $(BASEDIR) OPTIONAL=$(CFLAGS) DESTDIR=distro/archlinux/this/$(PKGDIR) PREFIX=$(PREFIX) install
        @echo "pkgname = gmqcc" > $(PKGINFO)
        @echo "pkgver = $(MAJOR).$(MINOR).$(PATCH)-$(PKGREL)" >> $(PKGINFO)
        @echo "pkgdesc = An Improved Quake C Compiler" >> $(PKGINFO)
@@ -34,7 +41,7 @@ base: clean
        @rm -rf $(PKGDIR)
 
 clean:
-       @rm -f  $(PKG)
-
+       $(MAKE) -C $(BASEDIR) clean
+       @rm -f *.pkg.tar.xz
 
 all: base