apk-tools/Makefile

75 lines
1.6 KiB
Makefile
Raw Normal View History

# Makefile - one file to rule them all, one file to bind them
#
# Copyright (C) 2007 Timo Teräs <timo.teras@iki.fi>
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3 as published
# by the Free Software Foundation. See http://www.gnu.org/ for details.
PACKAGE := apk-tools
2009-03-20 10:56:48 +00:00
VERSION := 2.0_pre10
GIT_REV := $(shell git describe || echo exported)
ifneq ($(GIT_REV), exported)
ifneq ($(filter apk-tools-$(VERSION)%, $(GIT_REV)),)
FULL_VERSION := $(patsubst apk-tools-%,%,$(GIT_REV))
else
FULL_VERSION := $(GIT_REV)
endif
else
FULL_VERSION := $(VERSION)
endif
CC=gcc
INSTALL=install
INSTALLDIR=$(INSTALL) -d
CFLAGS?=-g -Werror -Wall -Wstrict-prototypes
CFLAGS+=-D_GNU_SOURCE -std=gnu99 -DAPK_VERSION=\"$(FULL_VERSION)\"
LDFLAGS?=-g
2009-01-08 13:54:50 +00:00
LDFLAGS+=-nopie
2008-11-12 09:57:53 +00:00
LIBS=/usr/lib/libz.a
ifeq ($(STATIC),yes)
CFLAGS+=-fno-stack-protector
LDFLAGS+=-static
endif
DESTDIR=
SBINDIR=/sbin
CONFDIR=/etc/apk
MANDIR=/usr/share/man
DOCDIR=/usr/share/doc/apk
2008-11-06 14:58:11 +00:00
SUBDIRS=src
.PHONY: compile install clean all static
all: compile
static:
$(MAKE) $(MFLAGS) -C src apk.static
compile install clean::
@for i in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$i $(MAKECMDGOALS); done
install::
$(INSTALLDIR) $(DESTDIR)$(DOCDIR)
$(INSTALL) README $(DESTDIR)$(DOCDIR)
2009-01-15 13:06:02 +00:00
clean::
rm -rf $(TARBALL)
TARBALL := $(PACKAGE)-$(VERSION).tar.bz2
2009-01-15 13:06:02 +00:00
dist: $(TARBALL)
$(TARBALL):
rm -rf $(PACKAGE)
git clone . $(PACKAGE)
cd $(PACKAGE) && (cd .. && git diff) | patch -p1
tar -cjf $@ $(PACKAGE)
rm -rf $(PACKAGE)
.EXPORT_ALL_VARIABLES: