source: Makefile @ ed165fe

Last change on this file since ed165fe was cfcc587, checked in by Jelmer Vernooij <jelmer@…>, at 2005-11-28T01:14:35Z

Merge from Wilmer

  • Property mode set to 100644
File size: 2.8 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
[f56c491]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
[b7d3cc34]13subdirs = protocols
14
[d1d6776]15ifeq ($(ARCH),Windows)
16objects += win32.o
17else
18objects += unix.o conf.o
19endif
20
[b7d3cc34]21# Expansion of variables
22subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o)
23CFLAGS += -Wall
24
25all: $(OUTFILE)
[513a323]26        $(MAKE) -C doc
[b7d3cc34]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
[34c0e90]50        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
[b7d3cc34]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 ..; \
[fe51bcf]79        tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x
[b7d3cc34]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.