source: Makefile @ f56c491

Last change on this file since f56c491 was f56c491, checked in by Jelmer Vernooij <jelmer@…>, at 2005-11-15T13:35:24Z

Merge new changes from pluginable and Wilmer

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