source: Makefile @ fd03770

Last change on this file since fd03770 was fd03770, checked in by Wilmer van der Gaast <wilmer@…>, at 2006-06-25T19:43:14Z

Merging from devel/Jelmer.

  • Property mode set to 100644
File size: 3.4 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
[df1694b]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_text.o storage_xml.o unix.o user.o
[e506d6c]13headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ini.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h url.h user.h protocols/http_client.h protocols/md5.h protocols/nogaim.h protocols/proxy.h protocols/sha.h protocols/ssl_client.h
[df1694b]14subdirs = protocols lib
[b7d3cc34]15
[f32d557]16objects += $(LDAP_OBJ)
[f665dab]17
[b7d3cc34]18# Expansion of variables
19subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o)
20CFLAGS += -Wall
21
22all: $(OUTFILE)
[513a323]23        $(MAKE) -C doc
[b7d3cc34]24
[cdb92c5]25uninstall: uninstall-bin uninstall-doc
[b7d3cc34]26        @echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n'
27
28install: install-bin install-doc
29        @if ! [ -d $(DESTDIR)$(CONFIG) ]; then echo -e '\nThe configuration directory $(DESTDIR)$(CONFIG) does not exist yet, don'\''t forget to create it!'; fi
30        @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
31        @echo
32
33.PHONY:   install   install-bin   install-etc   install-doc \
34        uninstall uninstall-bin uninstall-etc uninstall-doc \
35        all clean distclean tar $(subdirs)
36
37Makefile.settings:
38        @echo
39        @echo Run ./configure to create Makefile.settings, then rerun make
40        @echo
41
42clean: $(subdirs)
43        rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode
44
45distclean: clean $(subdirs)
46        rm -f Makefile.settings config.h
[34c0e90]47        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
[b7d3cc34]48
[c2fa827]49check:
50        $(MAKE) -C tests
51
[b7d3cc34]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
[cdb92c5]65install-dev:
[e506d6c]66        mkdir -p $(DESTDIR)$(INCLUDEDIR)
67        install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR)
68        mkdir -p $(DESTDIR)$(PCDIR)
69        install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR)
70
[cdb92c5]71uninstall-dev:
72        rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr))
73        -rmdir $(DESTDIR)$(INCLUDEDIR)
[e506d6c]74        rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc
75
[b7d3cc34]76install-etc:
77        mkdir -p $(DESTDIR)$(ETCDIR)
78        install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt
79        install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf
80
81uninstall-etc:
82        rm -f $(DESTDIR)$(ETCDIR)/motd.txt
83        rm -f $(DESTDIR)$(ETCDIR)/bitlbee.conf
84        -rmdir $(DESTDIR)$(ETCDIR)
85
86tar:
87        fakeroot debian/rules clean || make distclean
88        x=$$(basename $$(pwd)); \
89        cd ..; \
[fe51bcf]90        tar czf $$x.tar.gz --exclude=debian --exclude=.bzr $$x
[b7d3cc34]91
92$(subdirs):
93        @$(MAKE) -C $@ $(MAKECMDGOALS)
94
95$(objects): %.o: %.c
96        @echo '*' Compiling $<
97        @$(CC) -c $(CFLAGS) $< -o $@
98
99$(objects): Makefile Makefile.settings config.h
100
101$(OUTFILE): $(objects) $(subdirs)
102        @echo '*' Linking $(OUTFILE)
103        @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LFLAGS) $(EFLAGS)
104ifndef DEBUG
105        @echo '*' Stripping $(OUTFILE)
106        @-$(STRIP) $(OUTFILE)
107endif
108
109encode: crypting.c
110        $(CC) crypting.c protocols/md5.c $(CFLAGS) -o encode -DCRYPTING_MAIN $(CFLAGS) $(EFLAGS) $(LFLAGS)
111
112decode: encode
113        cp encode decode
114
115ctags: 
116        ctags `find . -name "*.c"` `find . -name "*.h"`
Note: See TracBrowser for help on using the repository browser.