source: Makefile @ 9afeefa

Last change on this file since 9afeefa was b79308b, checked in by ulim <a.sporto+bee@…>, at 2008-04-14T13:10:53Z

merged in upstream r379 (somewhere after 1.2-3).
Just one trivial conflict in the jabber Makefile, went smoothly.

  • Property mode set to 100644
File size: 3.6 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 dcc.o
13headers = 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 dcc.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 protocols/ft.h
14subdirs = lib protocols
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        $(MAKE) -C tests clean
43
44distclean: clean $(subdirs)
45        rm -f Makefile.settings config.h bitlbee.pc
46        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
47        $(MAKE) -C tests distclean
48
49check: all
50        $(MAKE) -C tests
51
52gcov: check
53        gcov *.c
54
55lcov: check
56        lcov --directory . --capture --output-file bitlbee.info
57        genhtml -o coverage bitlbee.info
58
59install-doc:
60        $(MAKE) -C doc install
61
62uninstall-doc:
63        $(MAKE) -C doc uninstall
64
65install-bin:
66        mkdir -p $(DESTDIR)$(BINDIR)
67        install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE)
68
69uninstall-bin:
70        rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE)
71
72install-dev:
73        mkdir -p $(DESTDIR)$(INCLUDEDIR)
74        install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR)
75        mkdir -p $(DESTDIR)$(PCDIR)
76        install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR)
77
78uninstall-dev:
79        rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr))
80        -rmdir $(DESTDIR)$(INCLUDEDIR)
81        rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc
82
83install-etc:
84        mkdir -p $(DESTDIR)$(ETCDIR)
85        install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt
86        install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf
87
88uninstall-etc:
89        rm -f $(DESTDIR)$(ETCDIR)/motd.txt
90        rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf
91        -rmdir $(DESTDIR)$(ETCDIR)
92
93tar:
94        fakeroot debian/rules clean || make distclean
95        x=$$(basename $$(pwd)); \
96        cd ..; \
97        tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x
98
99$(subdirs):
100        @$(MAKE) -C $@ $(MAKECMDGOALS)
101
102$(objects): %.o: %.c
103        @echo '*' Compiling $<
104        @$(CC) -c $(CFLAGS) $< -o $@
105
106$(objects): Makefile Makefile.settings config.h
107
108$(OUTFILE): $(objects) $(subdirs)
109        @echo '*' Linking $(OUTFILE)
110        @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS)
111ifndef DEBUG
112        @echo '*' Stripping $(OUTFILE)
113        @-$(STRIP) $(OUTFILE)
114endif
115
116encode: crypting.c
117        $(CC) crypting.c lib/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS)
118
119decode: encode
120        cp encode decode
121
122ctags: 
123        ctags `find . -name "*.c"` `find . -name "*.h"`
Note: See TracBrowser for help on using the repository browser.