]> git.xonotic.org Git - xonotic/gmqcc.git/blob - distro/deb/Makefile
fix: dotranslate now sets AST_FLAG_INCLUDE_DEF to not get removed by -Ostrip-constant...
[xonotic/gmqcc.git] / distro / deb / Makefile
1 BASEDIR := ../..
2 PREFIX  := /usr
3 HEADER  := $(BASEDIR)/gmqcc.h
4 MAJOR   := `sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER)`
5 MINOR   := `sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER)`
6 PATCH   := `sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER)`
7 DEBDIR  := gmqcc-$(MAJOR).$(MINOR).$(PATCH)
8 CARCH   := $(shell uname -m)
9 DEB     := $(DEBDIR)-$(CARCH).deb
10 CONTROL := $(DEBDIR)/DEBIAN/control
11
12 ifneq (, $(findstring i686, $(CARCH)))
13         CFLAGS := -m32
14 endif
15
16 base:
17         $(MAKE) -C $(BASEDIR) clean
18         $(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) install
19         @install -d -m755 $(DEBDIR)/DEBIAN
20         @echo "Package: gmqcc" > $(CONTROL)
21         @echo "Version: $(MAJOR).$(MINOR).$(PATCH)" >> $(CONTROL)
22         @echo "Section: user/hidden" >> $(CONTROL)
23         @echo "Priority: optional" >> $(CONTROL)
24         @echo "Architecture: $(CARCH)" >> $(CONTROL)
25         @echo "Installed-Size: `du -ks $($(DEBDIR)/usr) | cut -f 1`" >> $(CONTROL)
26         @echo "Maintainer: Dale Weiler <killfieldengine@gmail.com>" >> $(CONTROL)
27         @echo "Description: An improved Quake C Compiler" >> $(CONTROL)
28         @echo "   For an enduring period of time the options for a decent compiler for the Quake C programming language" >> $(CONTROL)
29         @echo "   were confined to a specific compiler known as QCC. Attempts were made to extend and improve upon the" >> $(CONTROL)
30         @echo "   design of QCC, but many foreseen the consequences of building on a broken foundation. The solution" >> $(CONTROL)
31         @echo "   was obvious, a new compiler; one born from the NIH realm of sarcastic wit. We welcome you. You won't" >> $(CONTROL)
32         @echo "   find a better Quake C compiler." >> $(CONTROL)
33         @tar czf data.tar.gz -C $(DEBDIR)/ . --exclude=DEBIAN
34         @tar czf control.tar.gz -C $(DEBDIR)/DEBIAN/ .
35         @echo 2.0 > debian-binary
36         @ar r $(DEB) debian-binary control.tar.gz data.tar.gz
37         @rm -rf debian-binary control.tar.gz data.tar.gz $(DEBDIR)
38
39 clean:
40         $(MAKE) -C $(BASEDIR) clean
41         @rm -f *.deb
42
43 all: base