source: Makefile @ f665dab

Last change on this file since f665dab was f665dab, checked in by Jelmer Vernooij <jelmer@…>, at 2006-02-12T08:02:03Z

Initial work on new LDB-based storage backend

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