[b7d3cc34] | 1 | ########################### |
---|
| 2 | ## Makefile for BitlBee ## |
---|
| 3 | ## ## |
---|
| 4 | ## Copyright 2002 Lintux ## |
---|
| 5 | ########################### |
---|
| 6 | |
---|
| 7 | ### DEFINITIONS |
---|
| 8 | |
---|
| 9 | -include Makefile.settings |
---|
| 10 | |
---|
| 11 | # Program variables |
---|
[85d7b85] | 12 | objects = account.o bitlbee.o crypting.o help.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) user.o |
---|
[221a273] | 13 | headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ipc.h irc.h log.h nick.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 | |
---|
[d1d6776] | 16 | ifeq ($(ARCH),Windows) |
---|
| 17 | objects += win32.o |
---|
| 18 | else |
---|
[4146a07] | 19 | objects += unix.o conf.o log.o |
---|
[d1d6776] | 20 | endif |
---|
| 21 | |
---|
[b7d3cc34] | 22 | # Expansion of variables |
---|
| 23 | subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o) |
---|
| 24 | CFLAGS += -Wall |
---|
| 25 | |
---|
| 26 | all: $(OUTFILE) |
---|
[513a323] | 27 | $(MAKE) -C doc |
---|
[b7d3cc34] | 28 | |
---|
[cdb92c5] | 29 | uninstall: uninstall-bin uninstall-doc |
---|
[b7d3cc34] | 30 | @echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n' |
---|
| 31 | |
---|
| 32 | install: install-bin install-doc |
---|
| 33 | @if ! [ -d $(DESTDIR)$(CONFIG) ]; then echo -e '\nThe configuration directory $(DESTDIR)$(CONFIG) does not exist yet, don'\''t forget to create it!'; fi |
---|
| 34 | @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 |
---|
| 35 | @echo |
---|
| 36 | |
---|
| 37 | .PHONY: install install-bin install-etc install-doc \ |
---|
| 38 | uninstall uninstall-bin uninstall-etc uninstall-doc \ |
---|
| 39 | all clean distclean tar $(subdirs) |
---|
| 40 | |
---|
| 41 | Makefile.settings: |
---|
| 42 | @echo |
---|
| 43 | @echo Run ./configure to create Makefile.settings, then rerun make |
---|
| 44 | @echo |
---|
| 45 | |
---|
| 46 | clean: $(subdirs) |
---|
| 47 | rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode |
---|
[66b9e86e] | 48 | $(MAKE) -C tests clean |
---|
[b7d3cc34] | 49 | |
---|
| 50 | distclean: clean $(subdirs) |
---|
[b3c467b] | 51 | rm -f Makefile.settings config.h bitlbee.pc |
---|
[34c0e90] | 52 | find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \; |
---|
[dcf0f3e] | 53 | $(MAKE) -C tests distclean |
---|
[b7d3cc34] | 54 | |
---|
[66b9e86e] | 55 | check: all |
---|
[c2fa827] | 56 | $(MAKE) -C tests |
---|
| 57 | |
---|
[66b9e86e] | 58 | gcov: check |
---|
| 59 | gcov *.c |
---|
| 60 | |
---|
[348c11b] | 61 | lcov: check |
---|
| 62 | lcov --directory . --capture --output-file bitlbee.info |
---|
| 63 | genhtml -o coverage bitlbee.info |
---|
[b7d3cc34] | 64 | |
---|
| 65 | install-doc: |
---|
| 66 | $(MAKE) -C doc install |
---|
| 67 | |
---|
| 68 | uninstall-doc: |
---|
| 69 | $(MAKE) -C doc uninstall |
---|
| 70 | |
---|
| 71 | install-bin: |
---|
| 72 | mkdir -p $(DESTDIR)$(BINDIR) |
---|
| 73 | install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
| 74 | |
---|
| 75 | uninstall-bin: |
---|
| 76 | rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
| 77 | |
---|
[cdb92c5] | 78 | install-dev: |
---|
[e506d6c] | 79 | mkdir -p $(DESTDIR)$(INCLUDEDIR) |
---|
| 80 | install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR) |
---|
| 81 | mkdir -p $(DESTDIR)$(PCDIR) |
---|
| 82 | install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR) |
---|
| 83 | |
---|
[cdb92c5] | 84 | uninstall-dev: |
---|
| 85 | rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr)) |
---|
| 86 | -rmdir $(DESTDIR)$(INCLUDEDIR) |
---|
[e506d6c] | 87 | rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc |
---|
| 88 | |
---|
[b7d3cc34] | 89 | install-etc: |
---|
| 90 | mkdir -p $(DESTDIR)$(ETCDIR) |
---|
| 91 | install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt |
---|
| 92 | install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
| 93 | |
---|
| 94 | uninstall-etc: |
---|
| 95 | rm -f $(DESTDIR)$(ETCDIR)/motd.txt |
---|
| 96 | rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
| 97 | -rmdir $(DESTDIR)$(ETCDIR) |
---|
| 98 | |
---|
| 99 | tar: |
---|
| 100 | fakeroot debian/rules clean || make distclean |
---|
| 101 | x=$$(basename $$(pwd)); \ |
---|
| 102 | cd ..; \ |
---|
[fe51bcf] | 103 | tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x |
---|
[b7d3cc34] | 104 | |
---|
| 105 | $(subdirs): |
---|
| 106 | @$(MAKE) -C $@ $(MAKECMDGOALS) |
---|
| 107 | |
---|
| 108 | $(objects): %.o: %.c |
---|
| 109 | @echo '*' Compiling $< |
---|
| 110 | @$(CC) -c $(CFLAGS) $< -o $@ |
---|
| 111 | |
---|
| 112 | $(objects): Makefile Makefile.settings config.h |
---|
| 113 | |
---|
| 114 | $(OUTFILE): $(objects) $(subdirs) |
---|
| 115 | @echo '*' Linking $(OUTFILE) |
---|
| 116 | @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS) |
---|
| 117 | ifndef DEBUG |
---|
| 118 | @echo '*' Stripping $(OUTFILE) |
---|
| 119 | @-$(STRIP) $(OUTFILE) |
---|
| 120 | endif |
---|
| 121 | |
---|
| 122 | encode: crypting.c |
---|
[debc281] | 123 | $(CC) crypting.c lib/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS) |
---|
[b7d3cc34] | 124 | |
---|
| 125 | decode: encode |
---|
| 126 | cp encode decode |
---|
| 127 | |
---|
| 128 | ctags: |
---|
| 129 | ctags `find . -name "*.c"` `find . -name "*.h"` |
---|