]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/template/main.mk
Implement support for portable installations.
[user/henk/code/inspircd.git] / make / template / main.mk
index 3f0ba607bfd3ad6155af99d408245d5264cb2210..6bd1d390d82ff8ac81f7d554a3edd370537c10f8 100644 (file)
@@ -2,7 +2,17 @@
 #
 # InspIRCd -- Internet Relay Chat Daemon
 #
+#   Copyright (C) 2018 Puck Meerburg <puck@puckipedia.com>
+#   Copyright (C) 2012-2020 Sadie Powell <sadie@witchery.services>
+#   Copyright (C) 2012, 2015-2016 Attila Molnar <attilamolnar@hush.com>
+#   Copyright (C) 2012 Robby <robby@chatbelgie.be>
+#   Copyright (C) 2012 Christoph Egger <christoph@debian.org>
+#   Copyright (C) 2012 ChrisTX <xpipe@hotmail.de>
+#   Copyright (C) 2010 Dennis Friis <peavey@inspircd.org>
 #   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+#   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
+#   Copyright (C) 2005-2007 Craig Edwards <brain@inspircd.org>
+#   Copyright (C) 2005 Craig McLure <craig@frostycoolslug.com>
 #
 # This file is part of InspIRCd.  InspIRCd is free software: you can
 # redistribute it and/or modify it under the terms of the GNU General Public
 CXX = @CXX@
 COMPILER = @COMPILER_NAME@
 SYSTEM = @SYSTEM_NAME@
-BUILDPATH ?= $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/build
+BUILDPATH ?= $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/build/@COMPILER_NAME@-@COMPILER_VERSION@
 SOCKETENGINE = @SOCKETENGINE@
 CORECXXFLAGS = -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow
 LDLIBS = -lstdc++
 CORELDFLAGS = -rdynamic -L.
 PICLDFLAGS = -fPIC -shared -rdynamic
 
+DESTDIR := $(if $(DESTDIR),$(DESTDIR),"@DESTDIR|@")
 BASE    = "$(DESTDIR)@BASE_DIR@"
 BINPATH = "$(DESTDIR)@BINARY_DIR@"
 CONPATH = "$(DESTDIR)@CONFIG_DIR@"
@@ -210,6 +221,8 @@ install: target
        @-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(BINPATH)
        @-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(CONPATH)
        @-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(DATPATH)
+       @-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(EXAPATH)/codepages
+       @-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(EXAPATH)/providers
        @-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(EXAPATH)/services
        @-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(EXAPATH)/sql
        @-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(LOGPATH)
@@ -219,7 +232,6 @@ install: target
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" $(BINPATH)
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) "$(BUILDPATH)/modules/"*.so $(MODPATH)
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) @CONFIGURE_DIRECTORY@/inspircd $(SCRPATH) 2>/dev/null
-       -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) .gdbargs $(SCRPATH)/.gdbargs 2>/dev/null
 ifeq ($(SYSTEM), darwin)
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) @CONFIGURE_DIRECTORY@/org.inspircd.plist $(SCRPATH) 2>/dev/null
 endif
@@ -230,6 +242,8 @@ endif
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) @CONFIGURE_DIRECTORY@/inspircd-genssl.1 $(MANPATH) 2>/dev/null
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) tools/genssl $(BINPATH)/inspircd-genssl 2>/dev/null
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) docs/conf/*.example $(EXAPATH)
+       -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) docs/conf/codepages/*.example $(EXAPATH)/codepages
+       -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) docs/conf/providers/*.example $(EXAPATH)/providers
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) docs/conf/services/*.example $(EXAPATH)/services
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) docs/sql/*.sql $(EXAPATH)/sql
        -$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_PRV) *.pem $(CONPATH) 2>/dev/null
@@ -260,17 +274,15 @@ clean:
 
 deinstall:
        -rm -f $(BINPATH)/inspircd
-       -rm -rf $(CONPATH)/examples
+       -rm -rf $(EXAPATH)
        -rm -f $(MANPATH)/inspircd.1
        -rm -f $(MANPATH)/inspircd-genssl.1
        -rm -f $(MODPATH)/m_*.so
        -rm -f $(MODPATH)/core_*.so
-       -rm -f $(SCRPATH)/.gdbargs
        -rm -f $(SCRPATH)/inspircd.service
        -rm -f $(SCRPATH)/org.inspircd.plist
 
 configureclean:
-       rm -f .gdbargs
        -rm -f Makefile
        rm -f GNUmakefile
        rm -f include/config.h
@@ -289,7 +301,7 @@ help:
        @echo ' INSPIRCD_VERBOSE=1  Show the full command being executed instead of "BUILD: dns.cpp"'
        @echo ' INSPIRCD_DEBUG=1    Enable debug build, for module development or crash tracing'
        @echo ' INSPIRCD_DEBUG=2    Enable debug build with optimizations, for detailed backtraces'
-       @echo ' INSPIRCD_DEBUG=3    Enable fast build with no optimisations or symbols, for Travis CI'
+       @echo ' INSPIRCD_DEBUG=3    Enable fast build with no optimisations or symbols (only for CI)'
        @echo ' DESTDIR=            Specify a destination root directory (for tarball creation)'
        @echo ' -j <N>              Run a parallel build using N jobs'
        @echo ''