source: Makefile @ 846cec61

Last change on this file since 846cec61 was b3c467b, checked in by Wilmer van der Gaast <wilmer@…>, at 2006-06-28T09:59:33Z

Cleaned up Makefiles + configure: Cleaning up bitlbee.pc, removed the second
piece of libevent probing code that mysteriously appeared (?), better handling
of storage backends, an SSL module is now always included (so BitlBee can be
compiled again when building without MSN- and Jabber-support (http_client also
depends on SSL libs and can't be disabled)), oh, and fixed a compiler warning.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1###########################
2## Makefile for BitlBee  ##
3##                       ##
4## Copyright 2002 Lintux ##
5###########################
6
7### DEFINITIONS
8
9-include Makefile.settings
10
11# Program variables
12objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) unix.o user.o
13headers = 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
14subdirs = protocols lib
15
16# Expansion of variables
17subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o)
18CFLAGS += -Wall
19
20all: $(OUTFILE)
21        $(MAKE) -C doc
22
23uninstall: uninstall-bin uninstall-doc
24        @echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n'
25
26install: install-bin install-doc
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
35Makefile.settings:
36        @echo
37        @echo Run ./configure to create Makefile.settings, then rerun make
38        @echo
39
40clean: $(subdirs)
41        rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode
42
43distclean: clean $(subdirs)
44        rm -f Makefile.settings config.h bitlbee.pc
45        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
46
47check:
48        $(MAKE) -C tests
49
50install-doc:
51        $(MAKE) -C doc install
52
53uninstall-doc:
54        $(MAKE) -C doc uninstall
55
56install-bin:
57        mkdir -p $(DESTDIR)$(BINDIR)
58        install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE)
59
60uninstall-bin:
61        rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE)
62
63install-dev:
64        mkdir -p $(DESTDIR)$(INCLUDEDIR)
65        install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR)
66        mkdir -p $(DESTDIR)$(PCDIR)
67        install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR)
68
69uninstall-dev:
70        rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr))
71        -rmdir $(DESTDIR)$(INCLUDEDIR)
72        rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc
73
74install-etc:
75        mkdir -p $(DESTDIR)$(ETCDIR)
76        install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt
77        install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf
78
79uninstall-etc:
80        rm -f $(DESTDIR)$(ETCDIR)/motd.txt
81        rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf
82        -rmdir $(DESTDIR)$(ETCDIR)
83
84tar:
85        fakeroot debian/rules clean || make distclean
86        x=$$(basename $$(pwd)); \
87        cd ..; \
88        tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x
89
90$(subdirs):
91        @$(MAKE) -C $@ $(MAKECMDGOALS)
92
93$(objects): %.o: %.c
94        @echo '*' Compiling $<
95        @$(CC) -c $(CFLAGS) $< -o $@
96
97$(objects): Makefile Makefile.settings config.h
98
99$(OUTFILE): $(objects) $(subdirs)
100        @echo '*' Linking $(OUTFILE)
101        @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS)
102ifndef DEBUG
103        @echo '*' Stripping $(OUTFILE)
104        @-$(STRIP) $(OUTFILE)
105endif
106
107encode: crypting.c
108        $(CC) crypting.c protocols/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS)
109
110decode: encode
111        cp encode decode
112
113ctags: 
114        ctags `find . -name "*.c"` `find . -name "*.h"`
Note: See TracBrowser for help on using the repository browser.