Changeset f60079b


Ignore:
Timestamp:
2010-05-25T22:26:54Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4af3050
Parents:
51a799e
Message:

Allow one to run the configure script from a different directory and put all
build files in there. I need this to properly make Debian package variants
(i.e. libpurple and native).

Files:
14 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r51a799e rf60079b  
    110110        @$(MAKE) -C $@ $(MAKECMDGOALS)
    111111
    112 $(objects): %.o: %.c
     112$(objects): %.o: $(SRCDIR)%.c
    113113        @echo '*' Compiling $<
    114114        @$(CC) -c $(CFLAGS) $< -o $@
  • bitlbee.h

    r51a799e rf60079b  
    4343
    4444#if HAVE_CONFIG_H
    45 #include "config.h"
     45#include <config.h>
    4646#endif
    4747
  • configure

    r51a799e rf60079b  
    124124EOF
    125125
     126srcdir="$(dirname $0)"
     127if [ "$srcdir" != "." ]; then
     128        echo
     129        echo "configure script run from a different directory. Will create some symlinks..."
     130        if [ ! -e Makefile -o -L Makefile ]; then
     131                mkdir -p $(cd "$srcdir"; find . -type d)
     132                find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null
     133                dst="$PWD"
     134                cd "$srcdir"
     135                for i in $(find . -name Makefile); do
     136                        ln -s "$PWD${i#.}" "$dst/$i";
     137                done
     138                cd "$dst"
     139                rm -rf .bzr
     140        fi
     141       
     142        echo "SRCDIR=$srcdir/" >> Makefile.settings
     143        CFLAGS="$CFLAGS -I${dst}"
     144else
     145        srcdir=$PWD
     146fi
     147
    126148cat<<EOF>config.h
    127149/* BitlBee settings, generated by configure
     
    161183
    162184echo CFLAGS=$CFLAGS >> Makefile.settings
    163 echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings
     185echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings
    164186
    165187echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
  • doc/Makefile

    r51a799e rf60079b  
    11-include ../Makefile.settings
     2ifdef SRCDIR
     3SRCDIR := $(SRCDIR)doc/
     4endif
    25
    36all:
  • doc/user-guide/Makefile

    r51a799e rf60079b  
    11-include ../../Makefile.settings
     2ifdef SRCDIR
     3SRCDIR := $(SRCDIR)doc/user-guide/
     4endif
     5
    26EXTRAPARANEWLINE = 1
    37# EXTRAPARANEWLINE = 0
  • lib/Makefile

    r51a799e rf60079b  
    88
    99-include ../Makefile.settings
     10ifdef SRCDIR
     11SRCDIR := $(SRCDIR)lib/
     12endif
    1013
    1114# [SH] Program variables
     
    3740$(objects): ../Makefile.settings Makefile
    3841
    39 $(objects): %.o: %.c
     42$(objects): %.o: $(SRCDIR)%.c
    4043        @echo '*' Compiling $<
    4144        @$(CC) -c $(CFLAGS) $< -o $@
  • protocols/Makefile

    r51a799e rf60079b  
    88
    99-include ../Makefile.settings
     10ifdef SRCDIR
     11SRCDIR := $(SRCDIR)protocols/
     12endif
    1013
    1114# [SH] Program variables
     
    4952$(objects): ../Makefile.settings Makefile
    5053
    51 $(objects): %.o: %.c
     54$(objects): %.o: $(SRCDIR)%.c
    5255        @echo '*' Compiling $<
    5356        @$(CC) -c $(CFLAGS) $< -o $@
  • protocols/jabber/Makefile

    r51a799e rf60079b  
    88
    99-include ../../Makefile.settings
     10ifdef SRCDIR
     11SRCDIR := $(SRCDIR)protocols/jabber/
     12endif
    1013
    1114# [SH] Program variables
     
    3336$(objects): ../../Makefile.settings Makefile
    3437
    35 $(objects): %.o: %.c
     38$(objects): %.o: $(SRCDIR)%.c
    3639        @echo '*' Compiling $<
    3740        @$(CC) -c $(CFLAGS) $< -o $@
  • protocols/msn/Makefile

    r51a799e rf60079b  
    88
    99-include ../../Makefile.settings
     10ifdef SRCDIR
     11SRCDIR := $(SRCDIR)protocols/msn/
     12endif
    1013
    1114# [SH] Program variables
     
    3336$(objects): ../../Makefile.settings Makefile
    3437
    35 $(objects): %.o: %.c
     38$(objects): %.o: $(SRCDIR)%.c
    3639        @echo '*' Compiling $<
    3740        @$(CC) -c $(CFLAGS) $< -o $@
  • protocols/oscar/Makefile

    r51a799e rf60079b  
    88
    99-include ../../Makefile.settings
     10ifdef SRCDIR
     11SRCDIR := $(SRCDIR)protocols/oscar/
     12CFLAGS += -I$(SRCDIR)
     13endif
    1014
    1115# [SH] Program variables
     
    3337$(objects): ../../Makefile.settings Makefile
    3438
    35 $(objects): %.o: %.c
     39$(objects): %.o: $(SRCDIR)%.c
    3640        @echo '*' Compiling $<
    3741        @$(CC) -c $(CFLAGS) $< -o $@
  • protocols/purple/Makefile

    r51a799e rf60079b  
    88
    99-include ../../Makefile.settings
     10ifdef SRCDIR
     11SRCDIR := $(SRCDIR)protocols/purple/
     12endif
    1013
    1114# [SH] Program variables
     
    3336$(objects): ../../Makefile.settings Makefile
    3437
    35 $(objects): %.o: %.c
     38$(objects): %.o: $(SRCDIR)%.c
    3639        @echo '*' Compiling $<
    3740        @$(CC) -c $(CFLAGS) $< -o $@
  • protocols/twitter/Makefile

    r51a799e rf60079b  
    88
    99-include ../../Makefile.settings
     10ifdef SRCDIR
     11SRCDIR := $(SRCDIR)protocols/twitter/
     12endif
    1013
    1114# [SH] Program variables
     
    3336$(objects): ../../Makefile.settings Makefile
    3437
    35 $(objects): %.o: %.c
     38$(objects): %.o: $(SRCDIR)%.c
    3639        @echo '*' Compiling $<
    3740        @$(CC) -c $(CFLAGS) $< -o $@
  • protocols/yahoo/Makefile

    r51a799e rf60079b  
    88
    99-include ../../Makefile.settings
     10ifdef SRCDIR
     11SRCDIR := $(SRCDIR)protocols/yahoo/
     12endif
    1013
    1114# [SH] Program variables
     
    3336$(objects): ../../Makefile.settings Makefile
    3437
    35 $(objects): %.o: %.c
     38$(objects): %.o: $(SRCDIR)%.c
    3639        @echo '*' Compiling $<
    3740        @$(CC) -c $(CFLAGS) $< -o $@
  • tests/Makefile

    r51a799e rf60079b  
    11-include ../Makefile.settings
     2ifdef SRCDIR
     3SRCDIR := $(SRCDIR)tests/
     4endif
    25
    36LFLAGS +=-lcheck
     
    1922        @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS)
    2023
    21 %.o: %.c
     24%.o: $(SRCDIR)%.c
    2225        @echo '*' Compiling $<
    2326        @$(CC) -c $(CFLAGS) $< -o $@
Note: See TracChangeset for help on using the changeset viewer.