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