source: Makefile @ 79b6213

Last change on this file since 79b6213 was cdb92c5, checked in by Jelmer Vernooij <jelmer@…>, at 2006-03-02T12:43:36Z

Move development stuff into a seperate install-dev

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