[b7d3cc34] | 1 | ########################### |
---|
| 2 | ## Makefile for BitlBee ## |
---|
| 3 | ## ## |
---|
| 4 | ## Copyright 2002 Lintux ## |
---|
| 5 | ########################### |
---|
| 6 | |
---|
| 7 | ### DEFINITIONS |
---|
| 8 | |
---|
| 9 | -include Makefile.settings |
---|
| 10 | |
---|
| 11 | # Program variables |
---|
[576d6d7] | 12 | objects = account.o bitlbee.o commands.o conf.o crypting.o help.o ini.o irc.o log.o nick.o query.o set.o unix.o url.o user.o |
---|
[b7d3cc34] | 13 | subdirs = protocols |
---|
| 14 | |
---|
| 15 | # Expansion of variables |
---|
| 16 | subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o) |
---|
| 17 | CFLAGS += -Wall |
---|
| 18 | |
---|
| 19 | all: $(OUTFILE) |
---|
[513a323] | 20 | $(MAKE) -C doc |
---|
[b7d3cc34] | 21 | |
---|
| 22 | uninstall: uninstall-bin uninstall-doc |
---|
| 23 | @echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n' |
---|
| 24 | |
---|
| 25 | install: install-bin install-doc |
---|
| 26 | @if ! [ -d $(DESTDIR)$(CONFIG) ]; then echo -e '\nThe configuration directory $(DESTDIR)$(CONFIG) does not exist yet, don'\''t forget to create it!'; fi |
---|
| 27 | @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 |
---|
| 28 | @echo |
---|
| 29 | |
---|
| 30 | .PHONY: install install-bin install-etc install-doc \ |
---|
| 31 | uninstall uninstall-bin uninstall-etc uninstall-doc \ |
---|
| 32 | all clean distclean tar $(subdirs) |
---|
| 33 | |
---|
| 34 | Makefile.settings: |
---|
| 35 | @echo |
---|
| 36 | @echo Run ./configure to create Makefile.settings, then rerun make |
---|
| 37 | @echo |
---|
| 38 | |
---|
| 39 | clean: $(subdirs) |
---|
| 40 | rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode |
---|
| 41 | |
---|
| 42 | distclean: clean $(subdirs) |
---|
| 43 | rm -f Makefile.settings config.h |
---|
| 44 | find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' | xargs rm -f |
---|
| 45 | |
---|
| 46 | install-doc: |
---|
| 47 | $(MAKE) -C doc install |
---|
| 48 | |
---|
| 49 | uninstall-doc: |
---|
| 50 | $(MAKE) -C doc uninstall |
---|
| 51 | |
---|
| 52 | install-bin: |
---|
| 53 | mkdir -p $(DESTDIR)$(BINDIR) |
---|
| 54 | install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
| 55 | |
---|
| 56 | uninstall-bin: |
---|
| 57 | rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE) |
---|
| 58 | |
---|
| 59 | install-etc: |
---|
| 60 | mkdir -p $(DESTDIR)$(ETCDIR) |
---|
| 61 | install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt |
---|
| 62 | install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
| 63 | |
---|
| 64 | uninstall-etc: |
---|
| 65 | rm -f $(DESTDIR)$(ETCDIR)/motd.txt |
---|
| 66 | rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf |
---|
| 67 | -rmdir $(DESTDIR)$(ETCDIR) |
---|
| 68 | |
---|
| 69 | tar: |
---|
| 70 | fakeroot debian/rules clean || make distclean |
---|
| 71 | x=$$(basename $$(pwd)); \ |
---|
| 72 | cd ..; \ |
---|
[fe51bcf] | 73 | tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x |
---|
[b7d3cc34] | 74 | |
---|
| 75 | $(subdirs): |
---|
| 76 | @$(MAKE) -C $@ $(MAKECMDGOALS) |
---|
| 77 | |
---|
| 78 | $(objects): %.o: %.c |
---|
| 79 | @echo '*' Compiling $< |
---|
| 80 | @$(CC) -c $(CFLAGS) $< -o $@ |
---|
| 81 | |
---|
| 82 | $(objects): Makefile Makefile.settings config.h |
---|
| 83 | |
---|
| 84 | $(OUTFILE): $(objects) $(subdirs) |
---|
| 85 | @echo '*' Linking $(OUTFILE) |
---|
| 86 | @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS) |
---|
| 87 | ifndef DEBUG |
---|
| 88 | @echo '*' Stripping $(OUTFILE) |
---|
| 89 | @-$(STRIP) $(OUTFILE) |
---|
| 90 | endif |
---|
| 91 | |
---|
| 92 | encode: crypting.c |
---|
| 93 | $(CC) crypting.c protocols/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS) |
---|
| 94 | |
---|
| 95 | decode: encode |
---|
| 96 | cp encode decode |
---|
| 97 | |
---|
| 98 | ctags: |
---|
| 99 | ctags `find . -name "*.c"` `find . -name "*.h"` |
---|