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