source: Makefile @ ea911ca

Last change on this file since ea911ca was cb91b72, checked in by Wilmer van der Gaast <wilmer@…>, at 2005-11-26T01:42:20Z

Doc fixes from Jelmer

  • Property mode set to 100644
File size: 2.7 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 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
13subdirs = protocols
14
15# Expansion of variables
16subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o)
17CFLAGS += -Wall
18
19all: $(OUTFILE)
20        $(MAKE) -C doc
21
22uninstall: 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
25install: 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
34Makefile.settings:
35        @echo
36        @echo Run ./configure to create Makefile.settings, then rerun make
37        @echo
38
39clean: $(subdirs)
40        rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode
41
42distclean: clean $(subdirs)
43        rm -f Makefile.settings config.h
44        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
45
46install-doc:
47        $(MAKE) -C doc install
48
49uninstall-doc:
50        $(MAKE) -C doc uninstall
51
52install-bin:
53        mkdir -p $(DESTDIR)$(BINDIR)
54        install -m 0755 $(OUTFILE) $(DESTDIR)$(BINDIR)/$(OUTFILE)
55
56uninstall-bin:
57        rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE)
58
59install-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
64uninstall-etc:
65        rm -f $(DESTDIR)$(ETCDIR)/motd.txt
66        rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf
67        -rmdir $(DESTDIR)$(ETCDIR)
68
69tar:
70        fakeroot debian/rules clean || make distclean
71        x=$$(basename $$(pwd)); \
72        cd ..; \
73        tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x
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)
87ifndef DEBUG
88        @echo '*' Stripping $(OUTFILE)
89        @-$(STRIP) $(OUTFILE)
90endif
91
92encode: crypting.c
93        $(CC) crypting.c protocols/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS)
94
95decode: encode
96        cp encode decode
97
98ctags: 
99        ctags `find . -name "*.c"` `find . -name "*.h"`
Note: See TracBrowser for help on using the repository browser.