mirror of
https://github.com/znc/znc.git
synced 2026-08-02 06:52:51 +02:00
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:
+2
-3
@@ -13,7 +13,6 @@ SRCS=main.cpp znc.cpp User.cpp IRCSock.cpp UserSock.cpp DCCBounce.cpp DCCSock.cp
|
||||
all: znc @MODTARGET@
|
||||
|
||||
depend::
|
||||
cat /dev/null >.depend
|
||||
g++ -M $(CXXFLAGS) $(SRCS) $(INCLUDES) >.depend
|
||||
|
||||
znc: $(OBJS)
|
||||
@@ -29,9 +28,9 @@ modules::
|
||||
clean:
|
||||
rm -rf znc znc-static *.o core core.*
|
||||
|
||||
include .depend
|
||||
-include .depend
|
||||
|
||||
.cpp.o:
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $*.o $*.cpp
|
||||
|
||||
install: znc @MODTARGET@
|
||||
|
||||
@@ -2840,7 +2840,7 @@ fi
|
||||
ac_config_files="$ac_config_files Makefile"
|
||||
|
||||
if test "$MODULES" = "yes"; then
|
||||
ac_config_files="$ac_config_files modules/buildmod"
|
||||
ac_config_files="$ac_config_files modules/Makefile"
|
||||
|
||||
fi
|
||||
cat >confcache <<\_ACEOF
|
||||
@@ -3393,7 +3393,7 @@ do
|
||||
case "$ac_config_target" in
|
||||
# Handling of arguments.
|
||||
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||
"modules/buildmod" ) CONFIG_FILES="$CONFIG_FILES modules/buildmod" ;;
|
||||
"modules/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;;
|
||||
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
|
||||
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
|
||||
{ (exit 1); exit 1; }; };;
|
||||
@@ -3731,7 +3731,3 @@ if test "$no_create" != yes; then
|
||||
$ac_cs_success || { (exit 1); exit 1; }
|
||||
fi
|
||||
|
||||
if test -f modules/buildmod; then
|
||||
chmod 0711 modules/buildmod
|
||||
fi
|
||||
touch .depend
|
||||
|
||||
+1
-5
@@ -78,10 +78,6 @@ AC_SUBST([MODULES])
|
||||
AC_SUBST([MODTARGET])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
if test "$MODULES" = "yes"; then
|
||||
AC_CONFIG_FILES([modules/buildmod])
|
||||
AC_CONFIG_FILES([modules/Makefile])
|
||||
fi
|
||||
AC_OUTPUT
|
||||
if test -f modules/buildmod; then
|
||||
chmod 0711 modules/buildmod
|
||||
fi
|
||||
touch .depend
|
||||
|
||||
@@ -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 $@ $<
|
||||
@@ -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
|
||||
@@ -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
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
Reference in New Issue
Block a user