source: Makefile @ fb4ebcc5

Last change on this file since fb4ebcc5 was 221a273, checked in by Wilmer van der Gaast <wilmer@…>, at 2007-11-24T19:07:22Z

1.1.1dev (Although the CHANGES change isn't in there).

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[b7d3cc34]1###########################
2## Makefile for BitlBee  ##
3##                       ##
4## Copyright 2002 Lintux ##
5###########################
6
7### DEFINITIONS
8
9-include Makefile.settings
10
11# Program variables
[b3c467b]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
[221a273]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
[84b045d]14subdirs = lib protocols
[b7d3cc34]15
16# Expansion of variables
17subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o)
18CFLAGS += -Wall
19
20all: $(OUTFILE)
[513a323]21        $(MAKE) -C doc
[b7d3cc34]22
[cdb92c5]23uninstall: uninstall-bin uninstall-doc
[b7d3cc34]24        @echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n'
25
[cdb92c5]26install: install-bin install-doc
[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
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
[66b9e86e]42        $(MAKE) -C tests clean
[b7d3cc34]43
44distclean: clean $(subdirs)
[b3c467b]45        rm -f Makefile.settings config.h bitlbee.pc
[34c0e90]46        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
[dcf0f3e]47        $(MAKE) -C tests distclean
[b7d3cc34]48
[66b9e86e]49check: all
[c2fa827]50        $(MAKE) -C tests
51
[348c11b]52lcov:
[66b9e86e]53gcov: check
54        gcov *.c
55
[348c11b]56lcov: check
57        lcov --directory . --capture --output-file bitlbee.info
58        genhtml -o coverage bitlbee.info
59
[b7d3cc34]60install-doc:
61        $(MAKE) -C doc install
62
63uninstall-doc:
64        $(MAKE) -C doc uninstall
65
66install-bin:
67        mkdir -p $(DESTDIR)$(BINDIR)
68        install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE)
69
70uninstall-bin:
71        rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE)
72
[cdb92c5]73install-dev:
[e506d6c]74        mkdir -p $(DESTDIR)$(INCLUDEDIR)
75        install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR)
76        mkdir -p $(DESTDIR)$(PCDIR)
77        install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR)
78
[cdb92c5]79uninstall-dev:
80        rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr))
81        -rmdir $(DESTDIR)$(INCLUDEDIR)
[e506d6c]82        rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc
83
[b7d3cc34]84install-etc:
85        mkdir -p $(DESTDIR)$(ETCDIR)
86        install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt
87        install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf
88
89uninstall-etc:
90        rm -f $(DESTDIR)$(ETCDIR)/motd.txt
91        rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf
92        -rmdir $(DESTDIR)$(ETCDIR)
93
94tar:
95        fakeroot debian/rules clean || make distclean
96        x=$$(basename $$(pwd)); \
97        cd ..; \
[fe51bcf]98        tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x
[b7d3cc34]99
100$(subdirs):
101        @$(MAKE) -C $@ $(MAKECMDGOALS)
102
103$(objects): %.o: %.c
104        @echo '*' Compiling $<
105        @$(CC) -c $(CFLAGS) $< -o $@
106
107$(objects): Makefile Makefile.settings config.h
108
109$(OUTFILE): $(objects) $(subdirs)
110        @echo '*' Linking $(OUTFILE)
111        @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS)
112ifndef DEBUG
113        @echo '*' Stripping $(OUTFILE)
114        @-$(STRIP) $(OUTFILE)
115endif
116
117encode: crypting.c
118        $(CC) crypting.c protocols/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS)
119
120decode: encode
121        cp encode decode
122
123ctags: 
124        ctags `find . -name "*.c"` `find . -name "*.h"`
Note: See TracBrowser for help on using the repository browser.