1 | ########################### |
---|
2 | ## Makefile for BitlBee ## |
---|
3 | ## ## |
---|
4 | ## Copyright 2002 Lintux ## |
---|
5 | ########################### |
---|
6 | |
---|
7 | ### DEFINITIONS |
---|
8 | |
---|
9 | -include Makefile.settings |
---|
10 | |
---|
11 | # Program variables |
---|
12 | objects = account.o bitlbee.o commands.o conf.o crypting.o help.o ini.o irc.o log.o nick.o query.o set.o unix.o url.o user.o |
---|
13 | subdirs = protocols |
---|
14 | |
---|
15 | # Expansion of variables |
---|
16 | subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o) |
---|
17 | CFLAGS += -Wall |
---|
18 | |
---|
19 | all: $(OUTFILE) |
---|
20 | |
---|
21 | uninstall: uninstall-bin uninstall-doc |
---|
22 | @echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n' |
---|
23 | |
---|
24 | install: install-bin install-doc |
---|
25 | @if ! [ -d $(DESTDIR)$(CONFIG) ]; then echo -e '\nThe configuration directory $(DESTDIR)$(CONFIG) does not exist yet, don'\''t forget to create it!'; fi |
---|
26 | @if ! [ -e $(DESTDIR)$(ETCDIR)/bitlbee.conf ]; then echo -e '\nNo files are installed in '$(DESTDIR)$(ETCDIR)' by make install. Run make install-etc to do that.'; fi |
---|
27 | @echo |
---|
28 | |
---|
29 | .PHONY: install install-bin install-etc install-doc \ |
---|
30 | uninstall uninstall-bin uninstall-etc uninstall-doc \ |
---|
31 | all clean distclean tar $(subdirs) |
---|
32 | |
---|
33 | Makefile.settings: |
---|
34 | @echo |
---|
35 | @echo Run ./configure to create Makefile.settings, then rerun make |
---|
36 | @echo |
---|
37 | |
---|
38 | clean: $(subdirs) |
---|
39 | rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode |
---|
40 | |
---|
41 | distclean: clean $(subdirs) |
---|
42 | rm -f Makefile.settings config.h |
---|
43 | find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' | xargs rm -f |
---|
44 | |
---|
45 | install-doc: |
---|
46 | $(MAKE) -C doc install |
---|
47 | |
---|
48 | uninstall-doc: |
---|
49 | $(MAKE) -C doc uninstall |
---|
50 | |
---|
51 | install-bin: |
---|
52 | mkdir -p $(DESTDIR)$(BINDIR) |
---|
53 | install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
54 | |
---|
55 | uninstall-bin: |
---|
56 | rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
57 | |
---|
58 | install-etc: |
---|
59 | mkdir -p $(DESTDIR)$(ETCDIR) |
---|
60 | install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt |
---|
61 | install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
62 | |
---|
63 | uninstall-etc: |
---|
64 | rm -f $(DESTDIR)$(ETCDIR)/motd.txt |
---|
65 | rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
66 | -rmdir $(DESTDIR)$(ETCDIR) |
---|
67 | |
---|
68 | tar: |
---|
69 | fakeroot debian/rules clean || make distclean |
---|
70 | x=$$(basename $$(pwd)); \ |
---|
71 | cd ..; \ |
---|
72 | tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x |
---|
73 | |
---|
74 | $(subdirs): |
---|
75 | @$(MAKE) -C $@ $(MAKECMDGOALS) |
---|
76 | |
---|
77 | $(objects): %.o: %.c |
---|
78 | @echo '*' Compiling $< |
---|
79 | @$(CC) -c $(CFLAGS) $< -o $@ |
---|
80 | |
---|
81 | $(objects): Makefile Makefile.settings config.h |
---|
82 | |
---|
83 | $(OUTFILE): $(objects) $(subdirs) |
---|
84 | @echo '*' Linking $(OUTFILE) |
---|
85 | @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS) |
---|
86 | ifndef DEBUG |
---|
87 | @echo '*' Stripping $(OUTFILE) |
---|
88 | @-$(STRIP) $(OUTFILE) |
---|
89 | endif |
---|
90 | |
---|
91 | encode: crypting.c |
---|
92 | $(CC) crypting.c protocols/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS) |
---|
93 | |
---|
94 | decode: encode |
---|
95 | cp encode decode |
---|
96 | |
---|
97 | ctags: |
---|
98 | ctags `find . -name "*.c"` `find . -name "*.h"` |
---|