2013-01-27 07:08:27 +00:00
|
|
|
BASEDIR := ../../../
|
|
|
|
PREFIX := /usr
|
|
|
|
HEADER := $(BASEDIR)/gmqcc.h
|
2013-01-27 09:31:27 +00:00
|
|
|
MAJOR := $(shell sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER))
|
|
|
|
MINOR := $(shell sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER))
|
|
|
|
PATCH := $(shell sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER))
|
|
|
|
PKGREL := 1
|
|
|
|
CARCH := $(shell uname -m)
|
|
|
|
PKGDIR := gmqcc-$(MAJOR).$(MINOR).$(PATCH)-$(PKGREL)-$(CARCH)
|
2013-10-11 09:17:03 +00:00
|
|
|
TARCOMP := -J
|
2013-01-27 09:31:27 +00:00
|
|
|
PKG := $(PKGDIR).pkg.tar.xz
|
2013-01-27 07:08:27 +00:00
|
|
|
PKGINFO := $(PKGDIR)/.PKGINFO
|
2013-09-09 10:18:30 +00:00
|
|
|
DESTDIR := distro/archlinux/this
|
2013-03-21 02:02:41 +00:00
|
|
|
CFLAGS :=
|
2013-01-27 07:08:27 +00:00
|
|
|
|
2013-09-09 10:18:30 +00:00
|
|
|
LIBC_DEPEND := glibc
|
2013-03-21 02:02:41 +00:00
|
|
|
|
|
|
|
ifneq (, $(findstring i686, $(CARCH)))
|
2013-04-26 15:56:08 +00:00
|
|
|
CFLAGS += -m32
|
|
|
|
LDFLAGS += -m32
|
2013-03-21 02:02:41 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
base:
|
|
|
|
$(MAKE) -C $(BASEDIR) clean
|
2013-04-26 15:56:08 +00:00
|
|
|
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
2013-10-11 13:51:08 +00:00
|
|
|
$(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)/$(PKGDIR)" "PREFIX=$(PREFIX)" strip install
|
2013-01-27 07:08:27 +00:00
|
|
|
@echo "pkgname = gmqcc" > $(PKGINFO)
|
2013-01-27 09:31:27 +00:00
|
|
|
@echo "pkgver = $(MAJOR).$(MINOR).$(PATCH)-$(PKGREL)" >> $(PKGINFO)
|
2013-01-27 07:08:27 +00:00
|
|
|
@echo "pkgdesc = An Improved Quake C Compiler" >> $(PKGINFO)
|
|
|
|
@echo "url = https://github.com/graphitemaster/gmqcc.git" >> $(PKGINFO)
|
|
|
|
@echo "builddate = `date -u \"+%s\"`" >> $(PKGINFO)
|
|
|
|
@echo "packager = Unknown Packager" >> $(PKGINFO)
|
2013-01-27 09:31:27 +00:00
|
|
|
@echo "size = `du -sk $(PKGDIR) | awk '{print $$1 * 1024}'`" >> $(PKGINFO)
|
|
|
|
@echo "arch = $(CARCH)" >> $(PKGINFO)
|
2013-01-27 07:08:27 +00:00
|
|
|
@echo "license = MIT" >> $(PKGINFO)
|
|
|
|
@echo "conflict = gmqcc" >> $(PKGINFO)
|
2013-09-09 10:18:30 +00:00
|
|
|
@echo "depend = $(LIBC_DEPEND)" >> $(PKGINFO)
|
2013-01-27 07:08:27 +00:00
|
|
|
@echo "makepkgopt = strip" >> $(PKGINFO)
|
|
|
|
@echo "makepkgopt = docs" >> $(PKGINFO)
|
|
|
|
@echo "makepkgopt = libtool" >> $(PKGINFO)
|
|
|
|
@echo "makepkgopt = emptydirs" >> $(PKGINFO)
|
|
|
|
@echo "makepkgopt = zipman" >> $(PKGINFO)
|
|
|
|
@echo "makepkgopt = purge" >> $(PKGINFO)
|
|
|
|
@echo "makepkgopt = !upx" >> $(PKGINFO)
|
2013-10-11 09:14:46 +00:00
|
|
|
@bsdtar -C $(PKGDIR) -czf $(PKGDIR)/.MTREE \
|
2013-09-09 10:08:57 +00:00
|
|
|
--format=mtree \
|
|
|
|
--options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' \
|
|
|
|
.PKGINFO usr/
|
2013-10-11 09:17:03 +00:00
|
|
|
@bsdtar $(TARCOMP) -cvf $(PKG) -C $(PKGDIR)/ .PKGINFO .MTREE usr/
|
2013-01-27 07:26:50 +00:00
|
|
|
@rm -rf $(PKGDIR)
|
2013-01-27 07:08:27 +00:00
|
|
|
|
|
|
|
clean:
|
2013-03-21 02:02:41 +00:00
|
|
|
$(MAKE) -C $(BASEDIR) clean
|
|
|
|
@rm -f *.pkg.tar.xz
|
2013-01-27 07:08:27 +00:00
|
|
|
|
|
|
|
all: base
|