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