moving to standard makefile system, and cpp only extension

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@46 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
imaginos
2005-03-30 18:49:14 +00:00
parent e24236fd9f
commit a564545f75
6 changed files with 38 additions and 86 deletions
+28
View File
@@ -0,0 +1,28 @@
ifneq ($(MAKE),gmake)
# If you got an ERROR on the previous line, then you aren't using gmake
endif
CXX=g++
CXXFLAGS=@CXXFLAGS@
INCLUDES=@INCLUDES@
LIBS=@LIBS@
VPATH=.:..
OBJS=$(addsuffix .o, $(basename $(wildcard *.cpp)))
SRCS=$(wildcard *.cpp) $(wildcard ../*.cpp)
all: $(addsuffix .so, $(basename $(wildcard *.cpp)))
depend::
g++ -M $(CXXFLAGS) $(SRCS) $(INCLUDES) >.depend
clean:
rm -rf *.so *.o core core.*
-include .depend
%.so: %.o
$(CXX) $(CXXFLAGS) -shared -o $@ $< $(INCLUDES) $(LIBS)
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<
-70
View File
@@ -1,70 +0,0 @@
#!/bin/bash
CXXFLAGS="@MODFLAGS@"
LIBS="@LIBS@"
if test -z "$1"; then
echo "Usage: $0 [--cflags] [--libs] | --all | <module> [...]"
exit 1
fi
if [ -z "$CXX" ]; then
CXX="g++"
fi
if [ "$1" = "--cflags" ]; then
echo "$CXXFLAGS"
exit 0
fi
if [ "$1" = "--libs" ]; then
echo "$LIBS"
exit 0
fi
if [ "$1" = "--all" ]; then
FILES="email raw sample shell watch"
if `echo $CXXFLAGS | grep 'HAVE_LIBSSL' >/dev/null 2>/dev/null`; then
FILES="$FILES schat savebuff"
fi
else
FILES=$@
fi
for arg in $FILES
do
if test -d $arg && test "$arg" != "CVS"; then
(cd $arg && make || exit 1)
elif test -f "$arg"; then
FILE="$arg"
MOD="${FILE%.cpp}"
MOD="${MOD%.cc}"
elif test -f "$arg.cpp"; then
FILE="$arg.cpp"
MOD="$arg"
elif test -f "$arg.cc"; then
FILE="$arg.cc"
MOD="$arg"
else
continue
fi
rm -f "$MOD.so"
if test -n "$FILE"; then
COMMAND="$CXX $CXXFLAGS -c $FILE"
echo $COMMAND
$COMMAND || exit 1
COMMAND="$CXX $CXXFLAGS -shared -o $MOD.so $MOD.o $LIBS"
echo $COMMAND
$COMMAND || exit 1
fi
if ! test -f "$MOD.so"; then
echo "Failed to build $MOD.so!"
exit 1
else
echo "Built $MOD.so"
fi
done
exit 0
+5 -2
View File
@@ -14,8 +14,11 @@
* Author: imaginos <imaginos@imaginos.net>
*
* $Log$
* Revision 1.1 2004/08/24 00:08:52 prozacx
* Initial revision
* Revision 1.1 2005/03/30 18:46:35 imaginos
* moving to standard makefile system, and cpp only extension
*
* Revision 1.1.1.1 2004/08/24 00:08:52 prozacx
*
*
*
*/