File: Makefile

package info (click to toggle)
archway 0.2.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,992 kB
  • ctags: 846
  • sloc: perl: 10,695; makefile: 179
file content (109 lines) | stat: -rw-r--r-- 4,212 bytes parent folder | download | duplicates (3)
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# There are plans to switch to auto tools, this Makefile will work for now.

prefix = /usr/local
bindir = $(prefix)/bin
datadir = $(prefix)/share
AW_DATADIR = $(datadir)/archway
PERL = /usr/bin/perl
DESTDIR =

INSTALL = install -c
LN_S = ln -s

WITH_ARCH_PERL=auto
REQUIRED_ARCH_PM_VERSION=0.5.0

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/archway"
	@echo "	make install bindir=/opt/bin datadir=/opt/share PERL=/usr/bin/perl"
	@echo ""
	@echo "If you don't change the prefix, then archway executables are installed"
	@echo "into $(bindir) and archway data into $(datadir)/archway."
	@echo ""

install: check-dependencies
	$(INSTALL) -d $(DESTDIR)$(bindir)
	$(INSTALL) bin/archway $(DESTDIR)$(bindir)
	$(LN_S) -f archway $(DESTDIR)$(bindir)/archang
	$(LN_S) -f archway $(DESTDIR)$(bindir)/archelf
	$(LN_S) -f archway $(DESTDIR)$(bindir)/archeye
	$(LN_S) -f archway $(DESTDIR)$(bindir)/archmag
	$(LN_S) -f archway $(DESTDIR)$(bindir)/archrog
	$(LN_S) -f archway $(DESTDIR)$(bindir)/archaos
	$(LN_S) -f archway $(DESTDIR)$(bindir)/archgen
	$(LN_S) -f archway $(DESTDIR)$(bindir)/archero
	$(INSTALL) -d $(DESTDIR)$(datadir)
	$(INSTALL) -d $(DESTDIR)$(AW_DATADIR)
	@# later archway-ssh-askpass will be installed into AW_DATADIR probably
	$(INSTALL) bin/archway-ssh-askpass $(DESTDIR)$(bindir)
	@for dir in images/logo perllib; do \
		for file in `find $$dir -follow -type f -print | grep -v .arch-ids`; do \
			echo install: $(DESTDIR)$(AW_DATADIR)/$$file; \
			$(INSTALL) -d -m 755 `dirname $(DESTDIR)$(AW_DATADIR)/$$file`; \
			$(INSTALL) -m 644 $$file $(DESTDIR)$(AW_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)$(AW_DATADIR)/perllib/Arch; \
	fi

	@$(PERL) -pe 's!.FindBin::Bin/../share/archway!$(AW_DATADIR)!; s!/usr/bin/perl!$(PERL)!' \
		<bin/archway >$(DESTDIR)$(bindir)/archway
	@$(PERL) -pe 's!.FindBin::Bin/../share/archway!$(AW_DATADIR)!' \
		<perllib/ArchWay/Session.pm >$(DESTDIR)$(AW_DATADIR)/perllib/ArchWay/Session.pm

check-dependencies: ../arch-perl/perllib/Arch check-required-arch-perl-revision
	@test -x $(PERL) \
		|| (echo "No perl found at location $(PERL), run 'make PERL=/path/to/perl'" && false)
	@$(PERL) -M5.006 -e '' \
		|| echo "WARNING: You don't seem to have perl >= 5.6 installed"
	@$(PERL) -MGtk2=1.023 -e 'exit(Gtk2->CHECK_VERSION(2, 4, 0) ? 0 : 1)' \
		|| echo "WARNING: You don't seem to have recent Gtk2-perl with gtk-2.4 support 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/archway-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