[b7d3cc34] | 1 | ########################### |
---|
| 2 | ## Makefile for BitlBee ## |
---|
| 3 | ## ## |
---|
| 4 | ## Copyright 2002 Lintux ## |
---|
| 5 | ########################### |
---|
| 6 | |
---|
| 7 | ### DEFINITIONS |
---|
| 8 | |
---|
| 9 | -include Makefile.settings |
---|
| 10 | |
---|
| 11 | # Program variables |
---|
[764c7d1] | 12 | objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o otr.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 ipc.h irc.h log.h nick.h otr.h query.h set.h sock.h storage.h user.h lib/events.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/nogaim.h |
---|
[84b045d] | 14 | subdirs = lib protocols |
---|
[b7d3cc34] | 15 | |
---|
| 16 | # Expansion of variables |
---|
| 17 | subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o) |
---|
| 18 | CFLAGS += -Wall |
---|
| 19 | |
---|
| 20 | all: $(OUTFILE) |
---|
[513a323] | 21 | $(MAKE) -C doc |
---|
[b7d3cc34] | 22 | |
---|
[cdb92c5] | 23 | uninstall: uninstall-bin uninstall-doc |
---|
[b7d3cc34] | 24 | @echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n' |
---|
| 25 | |
---|
[cdb92c5] | 26 | install: install-bin install-doc |
---|
[b7d3cc34] | 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 |
---|
[66b9e86e] | 42 | $(MAKE) -C tests clean |
---|
[b7d3cc34] | 43 | |
---|
| 44 | distclean: clean $(subdirs) |
---|
[b3c467b] | 45 | rm -f Makefile.settings config.h bitlbee.pc |
---|
[34c0e90] | 46 | find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \; |
---|
[dcf0f3e] | 47 | $(MAKE) -C tests distclean |
---|
[b7d3cc34] | 48 | |
---|
[66b9e86e] | 49 | check: all |
---|
[c2fa827] | 50 | $(MAKE) -C tests |
---|
| 51 | |
---|
[66b9e86e] | 52 | gcov: check |
---|
| 53 | gcov *.c |
---|
| 54 | |
---|
[348c11b] | 55 | lcov: check |
---|
| 56 | lcov --directory . --capture --output-file bitlbee.info |
---|
| 57 | genhtml -o coverage bitlbee.info |
---|
| 58 | |
---|
[b7d3cc34] | 59 | install-doc: |
---|
| 60 | $(MAKE) -C doc install |
---|
| 61 | |
---|
| 62 | uninstall-doc: |
---|
| 63 | $(MAKE) -C doc uninstall |
---|
| 64 | |
---|
| 65 | install-bin: |
---|
| 66 | mkdir -p $(DESTDIR)$(BINDIR) |
---|
| 67 | install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
| 68 | |
---|
| 69 | uninstall-bin: |
---|
| 70 | rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
| 71 | |
---|
[cdb92c5] | 72 | install-dev: |
---|
[e506d6c] | 73 | mkdir -p $(DESTDIR)$(INCLUDEDIR) |
---|
| 74 | install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR) |
---|
| 75 | mkdir -p $(DESTDIR)$(PCDIR) |
---|
| 76 | install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR) |
---|
| 77 | |
---|
[cdb92c5] | 78 | uninstall-dev: |
---|
| 79 | rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr)) |
---|
| 80 | -rmdir $(DESTDIR)$(INCLUDEDIR) |
---|
[e506d6c] | 81 | rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc |
---|
| 82 | |
---|
[b7d3cc34] | 83 | install-etc: |
---|
| 84 | mkdir -p $(DESTDIR)$(ETCDIR) |
---|
| 85 | install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt |
---|
[8961950] | 86 | install -m 0644 welcome.txt $(DESTDIR)$(ETCDIR)/welcome.txt |
---|
[b7d3cc34] | 87 | install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
| 88 | |
---|
| 89 | uninstall-etc: |
---|
| 90 | rm -f $(DESTDIR)$(ETCDIR)/motd.txt |
---|
[8961950] | 91 | rm -f $(DESTDIR)$(ETCDIR)/welcome.txt |
---|
[b7d3cc34] | 92 | rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
| 93 | -rmdir $(DESTDIR)$(ETCDIR) |
---|
| 94 | |
---|
| 95 | tar: |
---|
| 96 | fakeroot debian/rules clean || make distclean |
---|
| 97 | x=$$(basename $$(pwd)); \ |
---|
| 98 | cd ..; \ |
---|
[fe51bcf] | 99 | tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x |
---|
[b7d3cc34] | 100 | |
---|
| 101 | $(subdirs): |
---|
| 102 | @$(MAKE) -C $@ $(MAKECMDGOALS) |
---|
| 103 | |
---|
| 104 | $(objects): %.o: %.c |
---|
| 105 | @echo '*' Compiling $< |
---|
| 106 | @$(CC) -c $(CFLAGS) $< -o $@ |
---|
| 107 | |
---|
| 108 | $(objects): Makefile Makefile.settings config.h |
---|
| 109 | |
---|
| 110 | $(OUTFILE): $(objects) $(subdirs) |
---|
| 111 | @echo '*' Linking $(OUTFILE) |
---|
| 112 | @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS) |
---|
| 113 | ifndef DEBUG |
---|
| 114 | @echo '*' Stripping $(OUTFILE) |
---|
| 115 | @-$(STRIP) $(OUTFILE) |
---|
| 116 | endif |
---|
| 117 | |
---|
| 118 | encode: crypting.c |
---|
[debc281] | 119 | $(CC) crypting.c lib/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS) |
---|
[b7d3cc34] | 120 | |
---|
| 121 | decode: encode |
---|
| 122 | cp encode decode |
---|
| 123 | |
---|
| 124 | ctags: |
---|
| 125 | ctags `find . -name "*.c"` `find . -name "*.h"` |
---|