]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - .Makefile.inc
Replace std::deque with std::vector in spanningtree and related modules
[user/henk/code/inspircd.git] / .Makefile.inc
index af5a617e994a545c566cf565601141bbdfb8a488..b2eaa4abe5ae3420f2a9ac2c914f81ea5ae9116d 100644 (file)
-#             InspIRCd Main Makefile
+#               InspIRCd Main Makefile
 #
-#     (C) InspIRCd Development Team, 2002-2007
+#       (C) InspIRCd Development Team, 2002-2009
 # This file is automagically generated by configure, from
-#    .Makefile.inc. Any changes made will go away! :P
-# Please do not edit unless you know what you're doing.
+#     .Makefile.inc. Any changes make will go away!
+#   Please do not edit unless you know what you're doing.
 #
 
+@GNU_ONLY MAKESTYLE = gnu
+@GNU_ONLY COMPILE_ROOT ?= $(shell pwd)
+@BSD_ONLY MAKESTYLE = bsd
+@BSD_ONLY COMPILE_ROOT != pwd
+
 CC = @CC@
-MAKE = @MAKEPROG@
-PROGS = inspircd
-FLAGS = @FLAGS@
-DEBUG = @DEVELOPER@
-LDLIBS = @LDLIBS@
-BASE = $(DESTDIR)@BASE_DIR@
-CONPATH = $(DESTDIR)@CONFIG_DIR@
-MODPATH = $(DESTDIR)@MODULE_DIR@
-BINPATH = $(DESTDIR)@BINARY_DIR@
-LAUNCHDPATH = $(DESTDIR)/System/Library/LaunchDaemons
-LIBPATH = $(DESTDIR)@LIBRARY_DIR@
-MODULES = @MODULES@
+SYSTEM = @SYSTEM@
+SOCKETENGINE = @SOCKETENGINE@
+CXXFLAGS += -pipe -fPIC -DPIC
+LDLIBS = -pthread -lstdc++
+LDFLAGS = 
+SHARED = -shared -rdynamic
+CORELDFLAGS = -rdynamic -L. $(LDFLAGS)
+PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
+BASE = "@BASE_DIR@"
+CONPATH = "@CONFIG_DIR@"
+MODPATH = "@MODULE_DIR@"
+BINPATH = "@BINARY_DIR@"
+LAUNCHDPATH = "/System/Library/LaunchDaemons"
+LIBPATH = "@LIBRARY_DIR@"
 INSTMODE = 0755
-MAKEARGS = 'PROGS=${PROGS}' 'FLAGS=${FLAGS}' 'CC=${CC}' 'LDLIBS=${LDLIBS}' 'MODULES=${MODULES}' 'MODPATH=${MODPATH}' 'LIBPATH=${LIBPATH}' 'INSTMODE=${INSTMODE}'
 
-all: @MAKEORDER@ finishmessage
+@IFEQ $(CC) icc
+  CXXFLAGS += -Wshadow
+@ELSE
+  CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall
+@ENDIF
+
+
+@IFEQ $(SYSTEM) linux
+  LDLIBS += -ldl
+@ELSIFEQ $(SYSTEM) solaris
+  LDLIBS += -lsocket -lnsl -lrt -lresolv
+@ELSIFEQ $(SYSTEM) sunos
+  LDLIBS += -lsocket -lnsl -lrt -lresolv
+@ELSIFEQ $(SYSTEM) darwin
+  CXXFLAGS += -DDARWIN -frtti
+  LDLIBS += -ldl
+  SHARED = -bundle -twolevel_namespace -undefined dynamic_lookup
+  CORE_FLAGS = -dynamic -bind_at_load -L.
+@ENDIF 
+
+@IFDEF D
+    CXXFLAGS += -g3
+    HEADER = debug-header
+@ELSE
+    CXXFLAGS += -g1
+    HEADER = std-header
+@ENDIF
+FOOTER = finishmessage
+
+CXXFLAGS += -I$(COMPILE_ROOT)/include
+
+@GNU_ONLY MAKEFLAGS += --no-print-directory
+
+@IFDEF V
+    RUNCC = $(CC)
+    VERBOSE = -v
+@ELSE
+    @GNU_ONLY MAKEFLAGS += --silent
+    @BSD_ONLY MAKE += -s
+    RUNCC = $(COMPILE_ROOT)/make/run-cc.pl $(CC)
+@ENDIF
+
+@DO_EXPORT RUNCC CXXFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
+@DO_EXPORT BASE CONPATH MODPATH BINPATH LIBPATH
+
+# Default target
+TARGET = all
+
+@IFDEF M
+    HEADER = mod-header
+    FOOTER = mod-footer
+    @BSD_ONLY TARGET = modules/${M:S/.so$//}.so
+    @GNU_ONLY TARGET = modules/$(M:.so=).so
+@ENDIF
+
+@IFDEF T
+    HEADER =
+    FOOTER = target
+    TARGET = $(T)
+@ENDIF
+
+all: $(FOOTER)
+
+target: $(HEADER)
+       $(MAKEENV) $(MAKE) -C src -f ../make/$(MAKESTYLE)-real.mk $(TARGET)
 
 debug:
-       @echo ""
+       @${MAKE} D=1 all
+
+debug-header:
        @echo "*************************************"
        @echo "*    BUILDING WITH DEBUG SYMBOLS    *"
        @echo "*                                   *"
+       @echo "*   This will take a *long* time.   *"
        @echo "*  Please be aware that this build  *"
        @echo "*  will consume a very large amount *"
-       @echo "*   of disk space (350mb+) and may  *"
-       @echo "*  run noticably slower. Only build *"
-       @echo "*   InspIRCd with debug symbols if  *"
-       @echo "* you are developing modules or are *"
-       @echo "*      experiencing problems.       *"
+       @echo "*  of disk space (150MB+), and can  *"
+       @echo "*  run slower. Use the debug build  *"
+       @echo "*  for module development or if you *"
+       @echo "*    are experiencing problems.     *"
        @echo "*                                   *"
        @echo "*************************************"
-       ${MAKE} -C . 'FLAGS=${DEBUG}' all
 
-mods:
-       @echo "Making modules..."
-       ${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS)
+mod-header:
+       @echo 'Building single module:'
 
-# Make this depend on 'ircd' and 'mods', so its always output last even with -j
-finishmessage: ircd mods
-       @echo ""
-       @echo "*************************************"
-       @echo "*        BUILD COMPLETE!            *"
-       @echo "*                                   *"
-       @echo "*   To install InspIRCd, type:      *"
-       @echo "*         make install              *"
-       @echo "*************************************"
+mod-footer: target
+       @echo 'To install, copy src/$(TARGET) to $(MODPATH)'
+       @echo 'Or, run "make install"'
 
-ircd:
+std-header:
        @echo "*************************************"
        @echo "*       BUILDING INSPIRCD           *"
        @echo "*                                   *"
        @echo "*   This will take a *long* time.   *"
        @echo "*     Why not read our wiki at      *"
-       @echo "*   http://www.inspircd.org/wiki    *"
+       @echo "*     http://wiki.inspircd.org      *"
        @echo "*  while you wait for make to run?  *"
        @echo "*************************************"
-       ${MAKE} -C src DIRNAME="src" $(MAKEARGS)
 
-install: all@EXTRA_DIR@
+finishmessage: target
+       @echo ""
+       @echo "*************************************"
+       @echo "*        BUILD COMPLETE!            *"
+       @echo "*                                   *"
+       @echo "*   To install InspIRCd, type:      *"
+       @echo "*         make install              *"
+       @echo "*************************************"
+
+install: target@EXTRA_DIR@
        @-install -d -m $(INSTMODE) $(BASE)
        @-install -d -m $(INSTMODE) $(LIBPATH)
        @-install -d -m $(INSTMODE) $(BINPATH)
        @-install -d -m $(INSTMODE) $(CONPATH)
        @-install -d -m $(INSTMODE) $(MODPATH)
-@INSTALL_LIST@ -install -m $(INSTMODE) src/inspircd $(BINPATH)
+       -install -m $(INSTMODE) src/commands/*.so $(LIBPATH)
+       -install -m $(INSTMODE) src/modules/*.so $(MODPATH)
        -install -m $(INSTMODE) @STARTSCRIPT@ $(@DESTINATION@) 2>/dev/null
-       @-cp .gdbargs $(BASE)
-       @-cp conf/inspircd.quotes.example $(CONPATH)
-       @-cp conf/inspircd.rules.example $(CONPATH)
-       @-cp conf/inspircd.motd.example $(CONPATH)
-       @-cp conf/inspircd.helpop-full.example $(CONPATH)
-       @-cp conf/inspircd.helpop.example $(CONPATH)
-       @-cp conf/inspircd.censor.example $(CONPATH)
-       @-cp conf/inspircd.filter.example $(CONPATH)
-       @-cp conf/key.pem $(CONPATH)
-       @-cp conf/cert.pem $(CONPATH)
-       @-cp docs/inspircd.conf.example $(CONPATH)
-       ${MAKE} modinstall
-
-modinstall: mods
-       ${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) modinst
+       -install -m $(INSTMODE) src/inspircd $(BINPATH)
+       @$(MAKEENV) make/install-extras.pl install
        @echo ""
        @echo "*************************************"
        @echo "*        INSTALL COMPLETE!          *"
@@ -98,22 +158,19 @@ modinstall: mods
        @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *"
        @echo "*************************************"
 
-module:
-       ${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) ${name}
-
 clean:
        @echo Cleaning...
-       @rm -rvf src/*.so src/*.dylib src/*.o src/inspircd src/modules/*.so src/modules/*.o *~ src/*~ src/modules/*~ src/modules/extra/*~ src/modes/*~ src/modes/*.o src/modes/*.a src/commands/*.so src/commands/*.o src/modules/*/*.o src/modules/*/*.so src/socketengines/*.o
+       @rm -f src/inspircd src/modes/modeclasses.a
+       @rm -f src/*.so src/modules/*.so src/commands/*.so src/modules/*/*.so
+       @rm -f src/*.o src/*/*.o src/modules/*/*.o
+       @rm -f src/.*.d src/*/.*.d src/modules/*/.*.d
        @echo Completed.
 
-modclean:
-       rm -rf modules/*.so
-       rm -rf src/modules/*.so
-       rm -rf src/modules/*.o
-       rm -rf src/modules/*/*.so
-       rm -rf src/modules/*/*.o
-       rm -rf lib/*.so
-       rm -f bin/inspircd
+deinstall:
+       -rm $(BINPATH)/inspircd
+       -rm $(LIBPATH)/*.so
+       -rm $(MODPATH)/*.so
+       @make/install-extras.pl deinstall
 
 squeakyclean: distclean
 
@@ -122,11 +179,43 @@ launchd_dir:
 
 configureclean:
        rm -f .config.cache
-       rm src/modules/Makefile
-       rm src/Makefile
-       rm Makefile
-       rm include/inspircd_config.h
-       rm include/inspircd_se_config.h
-
-distclean: modclean clean configureclean
-
+       rm -f src/modules/Makefile
+       rm -f src/commands/Makefile
+       rm -f src/Makefile
+       -rm -f Makefile
+       rm -f BSDmakefile
+       rm -f GNUmakefile
+       rm -f include/inspircd_config.h
+       rm -f include/inspircd_se_config.h
+
+distclean: clean configureclean
+
+help:
+       @echo 'InspIRCd Makefile'
+       @echo ''
+       @echo 'Use: ${MAKE} [flags] [targets]'
+       @echo ''
+       @echo 'Flags:'
+       @echo ' V=1       Show the full command being executed instead of "BUILD: dns.cpp"'
+       @echo ' D=1       Enable debug build, for module development or crash tracing'
+       @echo ' -j <N>    Run a parallel build using N jobs'
+       @echo ''
+       @echo 'User targets:'
+       @echo ' all       Complete build of InspIRCd, without installing'
+       @echo ' install   Build and install InspIRCd to the directory chosen in ./configure'
+       @echo '           Currently installs to ${BASE}'
+       @echo ' debug     Compile a debug build. Equivalent to "make D=1 all"'
+       @echo ''
+       @echo ' M=m_foo   Builds a single module'
+       @echo ' T=target  Builds a user-specified target'
+       @echo '           Target can be a file path relative to src/, or one of:'
+       @echo '            inspircd  commands  modules'
+       @echo '           Multiple targets may be separated by a space'
+       @echo ''
+       @echo ' clean     Cleans object files produced by the compile'
+       @echo ' distclean Cleans all files produced by compile and ./configure'
+       @echo '           Note: this includes the Makefile'
+       @echo ' deinstall Removes the files created by "make install"'
+       @echo
+
+.PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean launchd_dir configureclean help