Cross architecture stuff for distro build scripts. If you have an x86_64 capable system with a compiler and make (the OS doesn't even matter), simply changing to "distro" directory and typing "make" is sufficent to make archlinux i686/x86_64, and debian i686/x86_64 packages.

This commit is contained in:
Dale Weiler 2013-03-21 02:02:41 +00:00
parent 66b5cf29ba
commit 1b02a5204a
5 changed files with 49 additions and 23 deletions

View file

@ -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

11
distro/Makefile Normal file
View file

@ -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

View 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

View 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

View file

@ -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.