source: Makefile @ 46ad029

Last change on this file since 46ad029 was a4dc9f7, checked in by Jelmer Vernooij <jelmer@…>, at 2006-03-01T22:48:37Z

[merge] Wilmer

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