1 | -include config.mak |
---|
2 | |
---|
3 | VERSION = 0.8.1 |
---|
4 | DATE := $(shell date +%Y-%m-%d) |
---|
5 | # latest stable |
---|
6 | BITLBEE_VERSION = 1.2.5 |
---|
7 | |
---|
8 | AMPATH = $(shell grep automake- $(shell which automake)|sed "s|.*'\(.*\)';|\1|") |
---|
9 | |
---|
10 | ifeq ($(AMPATH),) |
---|
11 | # Gentoo, it has some crappy wrapper |
---|
12 | AMPATH = $(shell find /usr/share/ -maxdepth 1 -name 'automake-*'|tail -n 1) |
---|
13 | endif |
---|
14 | |
---|
15 | ifeq ($(ASCIIDOC),yes) |
---|
16 | MANPAGES = skyped.1 |
---|
17 | else |
---|
18 | MANPAGES = |
---|
19 | endif |
---|
20 | |
---|
21 | ifeq ($(BITLBEE),yes) |
---|
22 | LIBS = skype.$(SHARED_EXT) |
---|
23 | else |
---|
24 | LIBS = |
---|
25 | endif |
---|
26 | |
---|
27 | all: $(LIBS) $(MANPAGES) |
---|
28 | |
---|
29 | skype.$(SHARED_EXT): skype.c config.mak |
---|
30 | ifeq ($(BITLBEE),yes) |
---|
31 | $(CC) $(CFLAGS) $(SHARED_FLAGS) -o skype.$(SHARED_EXT) skype.c $(LDFLAGS) |
---|
32 | endif |
---|
33 | |
---|
34 | install: all |
---|
35 | ifeq ($(ASCIIDOC),yes) |
---|
36 | $(INSTALL) -d $(DESTDIR)$(mandir)/man1 |
---|
37 | $(INSTALL) -m644 $(MANPAGES) $(DESTDIR)$(mandir)/man1 |
---|
38 | endif |
---|
39 | ifeq ($(BITLBEE),yes) |
---|
40 | $(INSTALL) -d $(DESTDIR)$(plugindir) |
---|
41 | $(INSTALL) skype.$(SHARED_EXT) $(DESTDIR)$(plugindir) |
---|
42 | endif |
---|
43 | ifeq ($(SKYPE4PY),yes) |
---|
44 | $(INSTALL) -d $(DESTDIR)$(bindir) |
---|
45 | $(INSTALL) -d $(DESTDIR)$(sysconfdir) |
---|
46 | $(INSTALL) skyped.py $(DESTDIR)$(bindir)/skyped |
---|
47 | perl -p -i -e 's|/usr/local/etc/skyped|$(sysconfdir)|' $(DESTDIR)$(bindir)/skyped |
---|
48 | $(INSTALL) -m644 skyped.conf.dist $(DESTDIR)$(sysconfdir)/skyped.conf |
---|
49 | perl -p -i -e 's|\$${prefix}|$(prefix)|' $(DESTDIR)$(sysconfdir)/skyped.conf |
---|
50 | $(INSTALL) -m644 skyped.cnf $(DESTDIR)$(sysconfdir) |
---|
51 | endif |
---|
52 | |
---|
53 | client: client.c |
---|
54 | |
---|
55 | autogen: configure.ac |
---|
56 | cp $(AMPATH)/install-sh ./ |
---|
57 | autoconf |
---|
58 | |
---|
59 | clean: |
---|
60 | rm -f $(LIBS) $(MANPAGES) |
---|
61 | |
---|
62 | distclean: clean |
---|
63 | rm -f config.log config.mak config.status |
---|
64 | |
---|
65 | autoclean: distclean |
---|
66 | rm -rf aclocal.m4 autom4te.cache configure install-sh |
---|
67 | |
---|
68 | # take this from the kernel |
---|
69 | check: |
---|
70 | perl checkpatch.pl --no-tree --file skype.c |
---|
71 | |
---|
72 | dist: |
---|
73 | git archive --format=tar --prefix=bitlbee-skype-$(VERSION)/ HEAD | tar xf - |
---|
74 | mkdir -p bitlbee-skype-$(VERSION) |
---|
75 | git log --no-merges |git name-rev --tags --stdin > bitlbee-skype-$(VERSION)/Changelog |
---|
76 | make -C bitlbee-skype-$(VERSION) autogen |
---|
77 | tar czf bitlbee-skype-$(VERSION).tar.gz bitlbee-skype-$(VERSION) |
---|
78 | rm -rf bitlbee-skype-$(VERSION) |
---|
79 | |
---|
80 | release: |
---|
81 | git tag $(VERSION) |
---|
82 | $(MAKE) dist |
---|
83 | gpg --comment "See http://vmiklos.hu/gpg/ for info" \ |
---|
84 | -ba bitlbee-skype-$(VERSION).tar.gz |
---|
85 | |
---|
86 | doc: HEADER.html Changelog |
---|
87 | |
---|
88 | HEADER.html: README Makefile |
---|
89 | asciidoc -a toc -a numbered -a sectids -o HEADER.html README |
---|
90 | sed -i 's|@VERSION@|$(VERSION)|g' HEADER.html |
---|
91 | sed -i 's|@BITLBEE_VERSION@|$(BITLBEE_VERSION)|g' HEADER.html |
---|
92 | |
---|
93 | Changelog: .git/refs/heads/master |
---|
94 | git log --no-merges |git name-rev --tags --stdin >Changelog |
---|
95 | |
---|
96 | %.1: %.txt asciidoc.conf |
---|
97 | a2x --asciidoc-opts="-f asciidoc.conf" \ |
---|
98 | -a bs_version=$(VERSION) -a bs_date=$(DATE) -f manpage $< |
---|