[b7d3cc34] | 1 | ########################### |
---|
| 2 | ## Makefile for BitlBee ## |
---|
| 3 | ## ## |
---|
| 4 | ## Copyright 2002 Lintux ## |
---|
| 5 | ########################### |
---|
| 6 | |
---|
| 7 | ### DEFINITIONS |
---|
| 8 | |
---|
| 9 | -include Makefile.settings |
---|
| 10 | |
---|
| 11 | # Program variables |
---|
[a4dc9f7] | 12 | objects = account.o bitlbee.o crypting.o help.o ini.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o storage_text.o url.o user.o util.o |
---|
[e506d6c] | 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 |
---|
[b7d3cc34] | 14 | subdirs = protocols |
---|
| 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 |
---|
| 48 | |
---|
| 49 | distclean: clean $(subdirs) |
---|
| 50 | rm -f Makefile.settings config.h |
---|
[34c0e90] | 51 | find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \; |
---|
[b7d3cc34] | 52 | |
---|
| 53 | install-doc: |
---|
| 54 | $(MAKE) -C doc install |
---|
| 55 | |
---|
| 56 | uninstall-doc: |
---|
| 57 | $(MAKE) -C doc uninstall |
---|
| 58 | |
---|
| 59 | install-bin: |
---|
| 60 | mkdir -p $(DESTDIR)$(BINDIR) |
---|
| 61 | install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
| 62 | |
---|
| 63 | uninstall-bin: |
---|
| 64 | rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
| 65 | |
---|
[cdb92c5] | 66 | install-dev: |
---|
[e506d6c] | 67 | mkdir -p $(DESTDIR)$(INCLUDEDIR) |
---|
| 68 | install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR) |
---|
| 69 | mkdir -p $(DESTDIR)$(PCDIR) |
---|
| 70 | install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR) |
---|
| 71 | |
---|
[cdb92c5] | 72 | uninstall-dev: |
---|
| 73 | rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr)) |
---|
| 74 | -rmdir $(DESTDIR)$(INCLUDEDIR) |
---|
[e506d6c] | 75 | rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc |
---|
| 76 | |
---|
[b7d3cc34] | 77 | install-etc: |
---|
| 78 | mkdir -p $(DESTDIR)$(ETCDIR) |
---|
| 79 | install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt |
---|
| 80 | install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
| 81 | |
---|
| 82 | uninstall-etc: |
---|
| 83 | rm -f $(DESTDIR)$(ETCDIR)/motd.txt |
---|
| 84 | rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
| 85 | -rmdir $(DESTDIR)$(ETCDIR) |
---|
| 86 | |
---|
| 87 | tar: |
---|
| 88 | fakeroot debian/rules clean || make distclean |
---|
| 89 | x=$$(basename $$(pwd)); \ |
---|
| 90 | cd ..; \ |
---|
[fe51bcf] | 91 | tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x |
---|
[b7d3cc34] | 92 | |
---|
| 93 | $(subdirs): |
---|
| 94 | @$(MAKE) -C $@ $(MAKECMDGOALS) |
---|
| 95 | |
---|
| 96 | $(objects): %.o: %.c |
---|
| 97 | @echo '*' Compiling $< |
---|
| 98 | @$(CC) -c $(CFLAGS) $< -o $@ |
---|
| 99 | |
---|
| 100 | $(objects): Makefile Makefile.settings config.h |
---|
| 101 | |
---|
| 102 | $(OUTFILE): $(objects) $(subdirs) |
---|
| 103 | @echo '*' Linking $(OUTFILE) |
---|
| 104 | @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS) |
---|
| 105 | ifndef DEBUG |
---|
| 106 | @echo '*' Stripping $(OUTFILE) |
---|
| 107 | @-$(STRIP) $(OUTFILE) |
---|
| 108 | endif |
---|
| 109 | |
---|
| 110 | encode: crypting.c |
---|
| 111 | $(CC) crypting.c protocols/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS) |
---|
| 112 | |
---|
| 113 | decode: encode |
---|
| 114 | cp encode decode |
---|
| 115 | |
---|
| 116 | ctags: |
---|
| 117 | ctags `find . -name "*.c"` `find . -name "*.h"` |
---|