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