source: Makefile @ 73c2dce

Last change on this file since 73c2dce was 73c2dce, checked in by Jelmer Vernooij <jelmer@…>, at 2008-06-10T03:21:13Z

Update docs, remove obsolete win32-related utilities.

  • 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 crypting.o help.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) user.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 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
14subdirs = lib protocols
15
16ifeq ($(TARGET),i586-mingw32msvc)
17objects += win32.o
18LFLAGS+=-lws2_32
19EFLAGS+=-lsecur32
20else
21objects += unix.o conf.o log.o
22endif
23
24# Expansion of variables
25subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o)
26CFLAGS += -Wall
27
28all: $(OUTFILE)
29        $(MAKE) -C doc
30
31uninstall: uninstall-bin uninstall-doc
32        @echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n'
33
34install: install-bin install-doc
35        @if ! [ -d $(DESTDIR)$(CONFIG) ]; then echo -e '\nThe configuration directory $(DESTDIR)$(CONFIG) does not exist yet, don'\''t forget to create it!'; fi
36        @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
37        @echo
38
39.PHONY:   install   install-bin   install-etc   install-doc \
40        uninstall uninstall-bin uninstall-etc uninstall-doc \
41        all clean distclean tar $(subdirs)
42
43Makefile.settings:
44        @echo
45        @echo Run ./configure to create Makefile.settings, then rerun make
46        @echo
47
48clean: $(subdirs)
49        rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode
50        $(MAKE) -C tests clean
51
52distclean: clean $(subdirs)
53        rm -f Makefile.settings config.h bitlbee.pc
54        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
55        $(MAKE) -C tests distclean
56
57check: all
58        $(MAKE) -C tests
59
60gcov: check
61        gcov *.c
62
63lcov: check
64        lcov --directory . --capture --output-file bitlbee.info
65        genhtml -o coverage bitlbee.info
66
67install-doc:
68        $(MAKE) -C doc install
69
70uninstall-doc:
71        $(MAKE) -C doc uninstall
72
73install-bin:
74        mkdir -p $(DESTDIR)$(BINDIR)
75        install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE)
76
77uninstall-bin:
78        rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE)
79
80install-dev:
81        mkdir -p $(DESTDIR)$(INCLUDEDIR)
82        install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR)
83        mkdir -p $(DESTDIR)$(PCDIR)
84        install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR)
85
86uninstall-dev:
87        rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr))
88        -rmdir $(DESTDIR)$(INCLUDEDIR)
89        rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc
90
91install-etc:
92        mkdir -p $(DESTDIR)$(ETCDIR)
93        install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt
94        install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf
95
96uninstall-etc:
97        rm -f $(DESTDIR)$(ETCDIR)/motd.txt
98        rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf
99        -rmdir $(DESTDIR)$(ETCDIR)
100
101tar:
102        fakeroot debian/rules clean || make distclean
103        x=$$(basename $$(pwd)); \
104        cd ..; \
105        tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x
106
107$(subdirs):
108        @$(MAKE) -C $@ $(MAKECMDGOALS)
109
110$(objects): %.o: %.c
111        @echo '*' Compiling $<
112        @$(CC) -c $(CFLAGS) $< -o $@
113
114$(objects): Makefile Makefile.settings config.h
115
116$(OUTFILE): $(objects) $(subdirs)
117        @echo '*' Linking $(OUTFILE)
118        @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS)
119ifndef DEBUG
120        @echo '*' Stripping $(OUTFILE)
121        @-$(STRIP) $(OUTFILE)
122endif
123
124encode: crypting.c
125        $(CC) crypting.c lib/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS)
126
127decode: encode
128        cp encode decode
129
130ctags: 
131        ctags `find . -name "*.c"` `find . -name "*.h"`
Note: See TracBrowser for help on using the repository browser.