2013-01-17 22:10:36 +00:00
|
|
|
BASEDIR := ../..
|
2013-01-17 22:46:27 +00:00
|
|
|
PREFIX := /usr
|
2013-01-17 22:10:36 +00:00
|
|
|
HEADER := $(BASEDIR)/gmqcc.h
|
|
|
|
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)
|
2013-03-21 02:02:41 +00:00
|
|
|
CARCH := $(shell uname -m)
|
|
|
|
DEB := $(DEBDIR)-$(CARCH).deb
|
|
|
|
CONTROL := $(DEBDIR)/DEBIAN/control
|
|
|
|
|
|
|
|
ifneq (, $(findstring i686, $(CARCH)))
|
2013-04-27 15:00:27 +00:00
|
|
|
CFLAGS += -m32
|
|
|
|
LDFLAGS += -m32
|
2013-03-21 02:02:41 +00:00
|
|
|
endif
|
2013-01-17 22:10:36 +00:00
|
|
|
|
|
|
|
base:
|
2013-03-21 02:02:41 +00:00
|
|
|
$(MAKE) -C $(BASEDIR) clean
|
2013-04-27 15:00:27 +00:00
|
|
|
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
2013-10-11 13:51:08 +00:00
|
|
|
$(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) strip install
|
2013-01-17 22:33:02 +00:00
|
|
|
@install -d -m755 $(DEBDIR)/DEBIAN
|
2013-03-21 02:02:41 +00:00
|
|
|
@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)
|
2013-01-18 00:45:35 +00:00
|
|
|
@tar czf data.tar.gz -C $(DEBDIR)/ . --exclude=DEBIAN
|
|
|
|
@tar czf control.tar.gz -C $(DEBDIR)/DEBIAN/ .
|
2013-01-17 22:10:36 +00:00
|
|
|
@echo 2.0 > debian-binary
|
2014-04-05 09:16:15 +00:00
|
|
|
@ar r $(DEB) debian-binary control.tar.gz data.tar.gz 2>&1 >/dev/null
|
2013-01-18 00:45:35 +00:00
|
|
|
@rm -rf debian-binary control.tar.gz data.tar.gz $(DEBDIR)
|
2013-01-17 22:10:36 +00:00
|
|
|
|
2013-03-21 02:02:41 +00:00
|
|
|
clean:
|
|
|
|
$(MAKE) -C $(BASEDIR) clean
|
|
|
|
@rm -f *.deb
|
2013-01-17 22:10:36 +00:00
|
|
|
|
|
|
|
all: base
|