]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Cross architecture stuff for distro build scripts. If you have an x86_64 capable...
authorDale Weiler <killfieldengine@gmail.com>
Thu, 21 Mar 2013 02:02:41 +0000 (02:02 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Thu, 21 Mar 2013 02:02:41 +0000 (02:02 +0000)
Makefile
distro/Makefile [new file with mode: 0644]
distro/archlinux/this/Makefile
distro/deb/Makefile
distro/deb/control [deleted file]

index 247420443ee7eac65137007a337ecd29d44c5b17..f35de15c608c19e6f7ecb1771f3786dfbe6226ff 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
 DESTDIR :=
+OPTIONAL:=
 PREFIX  := /usr/local
 BINDIR  := $(PREFIX)/bin
 DATADIR := $(PREFIX)/share
@@ -9,7 +10,7 @@ CYGWIN  = $(findstring CYGWIN,  $(UNAME))
 MINGW   = $(findstring MINGW32, $(UNAME))
 
 CC     ?= clang
-CFLAGS += -Wall -Wextra -Werror -I. -fno-strict-aliasing -fsigned-char
+CFLAGS += -Wall -Wextra -Werror -I. -fno-strict-aliasing -fsigned-char $(OPTIONAL)
 ifneq ($(shell git describe --always 2>/dev/null),)
     CFLAGS += -DGMQCC_GITINFO="\"$(shell git describe --always)\""
 endif
@@ -38,7 +39,7 @@ else
 endif
 
 ifeq ($(track), no)
-    CFLAGS += -DNOTRACK
+       CFLAGS += -DNOTRACK
 endif
 
 OBJ_D = util.o code.o ast.o ir.o conout.o ftepp.o opts.o fs.o utf8.o correct.o
diff --git a/distro/Makefile b/distro/Makefile
new file mode 100644 (file)
index 0000000..ab88955
--- /dev/null
@@ -0,0 +1,11 @@
+base:
+       $(MAKE) -C deb/
+       $(MAKE) -C deb/ CARCH=i686
+       $(MAKE) -C archlinux/this/
+       $(MAKE) -C archlinux/this/ CARCH=i686
+       @mv deb/*.deb ./
+       @mv archlinux/this/*pkg.tar.xz ./
+
+clean:
+       @rm -f *.deb
+       @rm -f *.pkg.tar.xz
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
index 535cf1cdabaa1b1ad511824fa1a1d53686da7a35..df23602b592b94a07c7ef47d0792b030dad86e0b 100644 (file)
@@ -5,19 +5,39 @@ MAJOR   := `sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER)`
 MINOR   := `sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER)`
 PATCH   := `sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER)`
 DEBDIR  := gmqcc-$(MAJOR).$(MINOR).$(PATCH)
-DEB     := $(DEBDIR).deb
+CARCH   := $(shell uname -m)
+DEB     := $(DEBDIR)-$(CARCH).deb
+CONTROL := $(DEBDIR)/DEBIAN/control
+
+ifneq (, $(findstring i686, $(CARCH)))
+       CFLAGS := -m32
+endif
 
 base:
+       $(MAKE) -C $(BASEDIR) clean
        $(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) install
        @install -d -m755 $(DEBDIR)/DEBIAN
-       @cp       control $(DEBDIR)/DEBIAN/control
+       @echo "Package: gmqcc" > $(CONTROL)
+       @echo "Version: $(MAJOR).$(MINOR).$(PATCH)" >> $(CONTROL)
+       @echo "Section: user/hidden" >> $(CONTROL)
+       @echo "Priority: optional" >> $(CONTROL)
+       @echo "Architecture: $(CARCH)" >> $(CONTROL)
+       @echo "Installed-Size: `du -ks $($(DEBDIR)/usr) | cut -f 1`" >> $(CONTROL)
+       @echo "Maintainer: Dale Weiler <killfieldengine@gmail.com>" >> $(CONTROL)
+       @echo "Description: An improved Quake C Compiler" >> $(CONTROL)
+       @echo "   For an enduring period of time the options for a decent compiler for the Quake C programming language" >> $(CONTROL)
+       @echo "   were confined to a specific compiler known as QCC. Attempts were made to extend and improve upon the" >> $(CONTROL)
+       @echo "   design of QCC, but many foreseen the consequences of building on a broken foundation. The solution" >> $(CONTROL)
+       @echo "   was obvious, a new compiler; one born from the NIH realm of sarcastic wit. We welcome you. You won't" >> $(CONTROL)
+       @echo "   find a better Quake C compiler." >> $(CONTROL)
        @tar czf data.tar.gz -C $(DEBDIR)/ . --exclude=DEBIAN
        @tar czf control.tar.gz -C $(DEBDIR)/DEBIAN/ .
        @echo 2.0 > debian-binary
        @ar r $(DEB) debian-binary control.tar.gz data.tar.gz
        @rm -rf debian-binary control.tar.gz data.tar.gz $(DEBDIR)
-clean:
-       @rm -f $(DEB)
 
+clean:
+       $(MAKE) -C $(BASEDIR) clean
+       @rm -f *.deb
 
 all: base
diff --git a/distro/deb/control b/distro/deb/control
deleted file mode 100644 (file)
index 57cde3a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Package: gmqcc
-Version: 0.3.0
-Section: user/hidden
-Priority: optional
-Architecture: i386
-Installed-Size: `du -ks usr|cut -f 1`
-Maintainer: Dale Weiler <killfieldengine@gmail.com>
-Description: An improved Quake C Compiler
-   For an enduring period of time the options for a decent compiler for the Quake C programming language
-   were confined to a specific compiler known as QCC. Attempts were made to extend and improve upon the
-   design of QCC, but many foreseen the consequences of building on a broken foundation. The solution
-   was obvious, a new compiler; one born from the NIH realm of sarcastic wit. We welcome you. You won't
-   find a better Quake C compiler.