2008-04-17 14:09:13 +00:00
|
|
|
# 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.
|
|
|
|
|
2008-10-26 20:22:16 +00:00
|
|
|
VERSION := 2.0_pre1
|
2008-04-17 14:09:13 +00:00
|
|
|
|
|
|
|
SVN_REV := $(shell svn info 2> /dev/null | grep ^Revision | cut -d ' ' -f 2)
|
|
|
|
ifneq ($(SVN_REV),)
|
|
|
|
FULL_VERSION := $(VERSION)-r$(SVN_REV)
|
|
|
|
else
|
|
|
|
FULL_VERSION := $(VERSION)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
INSTALL=install
|
|
|
|
INSTALLDIR=$(INSTALL) -d
|
|
|
|
|
2008-12-01 07:03:11 +00:00
|
|
|
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
|
2008-04-21 16:30:10 +00:00
|
|
|
|
|
|
|
ifeq ($(STATIC),yes)
|
|
|
|
CFLAGS+=-fno-stack-protector
|
|
|
|
LDFLAGS+=-static
|
|
|
|
endif
|
2008-04-17 14:09:13 +00:00
|
|
|
|
|
|
|
DESTDIR=
|
2008-04-22 08:16:26 +00:00
|
|
|
SBINDIR=/sbin
|
2008-04-17 14:09:13 +00:00
|
|
|
CONFDIR=/etc/apk
|
|
|
|
MANDIR=/usr/share/man
|
|
|
|
DOCDIR=/usr/share/doc/apk
|
|
|
|
|
2008-11-06 14:58:11 +00:00
|
|
|
SUBDIRS=src
|
2008-04-17 14:09:13 +00:00
|
|
|
|
|
|
|
.PHONY: compile install clean all
|
|
|
|
|
|
|
|
all: compile
|
|
|
|
|
|
|
|
compile install clean::
|
|
|
|
@for i in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$i $(MAKECMDGOALS); done
|
|
|
|
|
|
|
|
install::
|
|
|
|
$(INSTALLDIR) $(DESTDIR)$(DOCDIR)
|
|
|
|
$(INSTALL) README $(DESTDIR)$(DOCDIR)
|
|
|
|
|
|
|
|
dist:
|
|
|
|
svn-clean
|
|
|
|
(TOP=`pwd` && cd .. && ln -s $$TOP apk-tools-$(VERSION) && \
|
|
|
|
tar --exclude '*/.svn*' -cjvf apk-tools-$(VERSION).tar.bz2 apk-tools-$(VERSION)/* && \
|
|
|
|
rm apk-tools-$(VERSION))
|
|
|
|
|
|
|
|
.EXPORT_ALL_VARIABLES:
|