1 # InspIRCd Main Makefile
3 # (C) InspIRCd Development Team, 2002-2010
4 # This file is automagically generated by configure, from
5 # make/templates/main.mk. Any changes make to the generated
6 # files will go away whenever it is regenerated!
8 # Please do not edit unless you know what you're doing. This
9 # needs to work in both GNU and BSD make; it is mangled for
15 BUILDPATH = @BUILD_DIR@
16 SOCKETENGINE = @SOCKETENGINE@
17 CXXFLAGS = -pipe -fPIC -DPIC
18 LDLIBS = -pthread -lstdc++
20 CORELDFLAGS = -rdynamic -L. $(LDFLAGS)
21 PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
22 BASE = "$(DESTDIR)@BASE_DIR@"
23 CONPATH = "$(DESTDIR)@CONFIG_DIR@"
24 MODPATH = "$(DESTDIR)@MODULE_DIR@"
25 BINPATH = "$(DESTDIR)@BINARY_DIR@"
34 CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall
41 @IFEQ $(SYSTEM) solaris
42 LDLIBS += -lsocket -lnsl -lrt -lresolv
45 LDLIBS += -lsocket -lnsl -lrt -lresolv
47 @IFEQ $(SYSTEM) darwin
48 CXXFLAGS += -DDARWIN -frtti
50 CORELDFLAGS = -dynamic -bind_at_load -L. $(LDFLAGS)
51 PICLDFLAGS = -fPIC -shared -twolevel_namespace -undefined dynamic_lookup $(LDFLAGS)
53 @IFEQ $(SYSTEM) interix
54 CXXFLAGS += -D_ALL_SOURCE -I/usr/local/include
68 CXXFLAGS += -O0 -g3 -Werror
77 FOOTER = finishmessage
81 @GNU_ONLY MAKEFLAGS += --no-print-directory
83 @GNU_ONLY SOURCEPATH = $(shell /bin/pwd)
84 @BSD_ONLY SOURCEPATH != /bin/pwd
91 @GNU_ONLY MAKEFLAGS += --silent
93 RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
94 RUNLD = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
98 CXXFLAGS += -DPURE_STATIC
101 @DO_EXPORT RUNCC RUNLD CXXFLAGS LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
102 @DO_EXPORT SOURCEPATH BUILDPATH PURE_STATIC SPLIT_CC
110 @BSD_ONLY TARGET = modules/${M:S/.so$//}.so
111 @GNU_ONLY TARGET = modules/$(M:.so=).so
121 HEADER = unknown-debug-level
127 $(MAKEENV) perl make/calcdep.pl
128 cd $(BUILDPATH); $(MAKEENV) $(MAKE) -f real.mk $(TARGET)
134 @echo "*************************************"
135 @echo "* BUILDING WITH DEBUG SYMBOLS *"
137 @echo "* This will take a *long* time. *"
138 @echo "* Please be aware that this build *"
139 @echo "* will consume a very large amount *"
140 @echo "* of disk space (~350MB), and may *"
141 @echo "* run slower. Use the debug build *"
142 @echo "* for module development or if you *"
143 @echo "* are experiencing problems. *"
145 @echo "*************************************"
149 @echo 'Cannot build single modules in pure-static build'
152 @echo 'Building single module:'
155 @echo 'To install, copy $(BUILDPATH)/$(TARGET) to $(MODPATH)'
156 @echo 'Or, run "make install"'
159 @echo "*************************************"
160 @echo "* BUILDING INSPIRCD *"
162 @echo "* This will take a *long* time. *"
163 @echo "* Why not read our wiki at *"
164 @echo "* http://wiki.inspircd.org *"
165 @echo "* while you wait for make to run? *"
166 @echo "*************************************"
168 finishmessage: target
170 @echo "*************************************"
171 @echo "* BUILD COMPLETE! *"
173 @echo "* To install InspIRCd, type: *"
174 @echo "* make install *"
175 @echo "*************************************"
178 @if [ "$(INSTUID)" = 0 -o "$(INSTUID)" = root ]; then \
180 echo "Error: You must specify a non-root UID for the server"; \
182 echo "If you are making a package, please specify using ./configure --uid"; \
183 echo "Otherwise, rerun using 'make INSTUID=irc install', where 'irc' is the user"; \
184 echo "who will be running the ircd. You will also need to modify the start script."; \
188 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)
189 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/data
190 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/logs
191 @-install -d -m $(INSTMODE_DIR) $(BINPATH)
192 @-install -d -m $(INSTMODE_DIR) $(CONPATH)
193 @-install -d -m $(INSTMODE_DIR) $(MODPATH)
194 [ $(BUILDPATH)/bin/ -ef $(BINPATH) ] || install -m $(INSTMODE_BIN) $(BUILDPATH)/bin/inspircd $(BINPATH)
196 [ $(BUILDPATH)/modules/ -ef $(MODPATH) ] || install -m $(INSTMODE_LIB) $(BUILDPATH)/modules/*.so $(MODPATH)
198 -install -m $(INSTMODE_BIN) @STARTSCRIPT@ $(BASE) 2>/dev/null
199 -install -m $(INSTMODE_LIB) tools/gdbargs $(BASE)/.gdbargs 2>/dev/null
200 -install -m $(INSTMODE_LIB) docs/*.example $(CONPATH)
202 @echo "*************************************"
203 @echo "* INSTALL COMPLETE! *"
204 @echo "*************************************"
206 @echo ' Base install:' $(BASE)
207 @echo ' Configuration:' $(CONPATH)
208 @echo ' Binaries:' $(BINPATH)
209 @echo ' Modules:' $(MODPATH)
210 @echo 'To start the ircd, run:' $(BASE)/inspircd start
211 @echo 'Remember to edit your config file:' $(CONPATH)/inspircd.conf
213 @GNU_ONLY RCS_FILES = $(wildcard .git/index src/version.sh)
214 @BSD_ONLY RCS_FILES = src/version.sh
215 GNUmakefile BSDmakefile: make/template/main.mk configure $(RCS_FILES)
217 @BSD_ONLY .MAKEFILEDEPS: BSDmakefile
221 -rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk
222 -rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules
223 @-rmdir $(BUILDPATH)/bin 2>/dev/null
224 @-rmdir $(BUILDPATH) 2>/dev/null
228 -rm $(BINPATH)/inspircd
231 squeakyclean: distclean
235 rm -f src/modules/Makefile
236 rm -f src/commands/Makefile
241 rm -f include/inspircd_config.h
242 rm -f include/inspircd_version.h
244 distclean: clean configureclean
247 @echo 'InspIRCd Makefile'
249 @echo 'Use: ${MAKE} [flags] [targets]'
252 @echo ' V=1 Show the full command being executed instead of "BUILD: dns.cpp"'
253 @echo ' D=1 Enable debug build, for module development or crash tracing'
254 @echo ' D=2 Enable debug build with optimizations, for detailed backtraces'
255 @echo ' DESTDIR= Specify a destination root directory (for tarball creation)'
256 @echo ' -j <N> Run a parallel build using N jobs'
259 @echo ' all Complete build of InspIRCd, without installing (default)'
260 @echo ' install Build and install InspIRCd to the directory chosen in ./configure'
261 @echo ' Currently installs to ${BASE}'
262 @echo ' debug Compile a debug build. Equivalent to "make D=1 all"'
264 @echo ' M=m_foo Builds a single module (cmd_foo also works here)'
265 @echo ' T=target Builds a user-specified target, such as "inspircd" or "modules"'
266 @echo ' Other targets are specified by their path in the build directory'
267 @echo ' Multiple targets may be separated by a space'
269 @echo ' clean Cleans object files produced by the compile'
270 @echo ' distclean Cleans all files produced by compile and ./configure'
271 @echo ' Note: this includes the Makefile'
272 @echo ' deinstall Removes the files created by "make install"'
275 .PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean configureclean help