1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
# There are plans to switch to auto tools, this Makefile will work for now.
prefix = /usr/local
bindir = $(prefix)/bin
datadir = $(prefix)/share
AXP_DATADIR = $(datadir)/axp
PERL = /usr/bin/perl
DESTDIR =
INSTALL = install -c
WITH_ARCH_PERL=auto
REQUIRED_ARCH_PM_VERSION=0.5.2
all: check-dependencies
@echo ""
@echo "Please run one of the following commands:"
@echo ""
@echo " make install # use the default prefix $(prefix)"
@echo " make install prefix=$$HOME/axp"
@echo " make install bindir=/opt/bin datadir=/opt/share PERL=/usr/bin/perl"
@echo ""
@echo "If you don't change the prefix, then axp executable is installed"
@echo "into $(bindir) and axp data (perl library) into $(datadir)/axp."
@echo ""
install: check-dependencies
$(INSTALL) -d $(DESTDIR)$(bindir)
$(INSTALL) bin/axp $(DESTDIR)$(bindir)
@for dir in perllib; do \
for file in `find $$dir -follow -type f -print | grep -v .arch-ids`; do \
echo install: $(DESTDIR)$(AXP_DATADIR)/$$file; \
$(INSTALL) -d -m 755 `dirname $(DESTDIR)$(AXP_DATADIR)/$$file`; \
$(INSTALL) -m 644 $$file $(DESTDIR)$(AXP_DATADIR)/$$file; \
done; \
done
if test "$(WITH_ARCH_PERL)" != "yes" \
&& $(PERL) -e "use Arch $(REQUIRED_ARCH_PM_VERSION)" 2>/dev/null \
|| [ "$(WITH_ARCH_PERL)" = "no" ]; \
then \
rm -rf $(DESTDIR)$(AXP_DATADIR)/perllib/Arch; \
rm -rf $(DESTDIR)$(AXP_DATADIR)/perllib/Arch.pm; \
fi
@$(PERL) -pe 's!.FindBin::Bin/../share/axp!$(AXP_DATADIR)!; s!/usr/bin/perl!$(PERL)!' \
<bin/axp >$(DESTDIR)$(bindir)/axp
check-dependencies: ../arch-perl/perllib/Arch check-required-arch-perl-revision
@$(PERL) -M5.005 -e '' \
|| echo "WARNING: You don't seem to have perl >= 5.005 installed"
# needed for development only; released tarballs include perllib/Arch inline
../arch-perl/perllib/Arch:
@echo "No arch-perl found in the parent directory, needed for this project."
@echo "Please execute the following command:"
@echo " tla get migo@homemail.com--Perl-GPL/arch-perl--devel--0 ../arch-perl"
@exit 1
# needed for development only; released tarballs include the required revision
check-required-arch-perl-revision:
@revision=`cat ./.required-arch-perl-revision`; \
if [ ! -f ../arch-perl/\{arch\}/arch-perl/arch-perl--devel/arch-perl--devel--0/migo@homemail.com--Perl-GPL/patch-log/$$revision ]; then \
echo "Your arch-perl tree is not up to date, at least $$revision is required"; \
echo "Please execute the following command:"; \
echo " tla update -d ../arch-perl"; \
exit 1; \
fi
debian:
tla register-archive \
http://arch.debian.org/arch/private/schizo/debian--2004 \
2>/dev/null || true
tla get schizo@debian.org--2004-primary/axp-debian--debian debian
# Produce an rpm package using dist in place or from the given tarball
# Usage:
# make rpm-dist
# make release=1 rpm-dist
# make rpm-this
# make version=0.5.0 release=2 rpm-this
# make rpm-dist cparams='--prefix=/opt' mparams='CFLAGS="-O2 -g"'
rpm-dist: dist rpm-this
rpm-this: rpm-regenerate
(cd rpm && $(MAKE) $(AM_MAKEFLAGS) rpm) || exit 1
# automatical regeneration is missing for other dirs, so do it explicitly
rpm-regenerate:
(cd rpm && $(MAKE) $(AM_MAKEFLAGS) Makefile *.spec) || exit 1
|