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
40 @ELSIFEQ $(SYSTEM) solaris
41 LDLIBS += -lsocket -lnsl -lrt -lresolv
42 @ELSIFEQ $(SYSTEM) sunos
43 LDLIBS += -lsocket -lnsl -lrt -lresolv
44 @ELSIFEQ $(SYSTEM) darwin
45 CXXFLAGS += -DDARWIN -frtti
47 CORELDFLAGS = -dynamic -bind_at_load -L. $(LDFLAGS)
48 PICLDFLAGS = -fPIC -shared -bundle -twolevel_namespace -undefined dynamic_lookup $(LDFLAGS)
49 @ELSIFEQ $(SYSTEM) interix
50 CXXFLAGS += -D_ALL_SOURCE -I/usr/local/include
61 CXXFLAGS += -O0 -g3 -Werror
67 HEADER = unknown-debug-level
69 FOOTER = finishmessage
73 @GNU_ONLY MAKEFLAGS += --no-print-directory
75 @GNU_ONLY SOURCEPATH = $(shell /bin/pwd)
76 @BSD_ONLY SOURCEPATH != /bin/pwd
83 @GNU_ONLY MAKEFLAGS += --silent
85 RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
86 RUNLD = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
90 CXXFLAGS += -DPURE_STATIC
93 @DO_EXPORT RUNCC RUNLD CXXFLAGS LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
94 @DO_EXPORT SOURCEPATH BUILDPATH PURE_STATIC SPLIT_CC
102 @BSD_ONLY TARGET = modules/${M:S/.so$//}.so
103 @GNU_ONLY TARGET = modules/$(M:.so=).so
115 $(MAKEENV) perl make/calcdep.pl
116 cd $(BUILDPATH); $(MAKEENV) $(MAKE) -f real.mk $(TARGET)
122 @echo "*************************************"
123 @echo "* BUILDING WITH DEBUG SYMBOLS *"
125 @echo "* This will take a *long* time. *"
126 @echo "* Please be aware that this build *"
127 @echo "* will consume a very large amount *"
128 @echo "* of disk space (~350MB), and may *"
129 @echo "* run slower. Use the debug build *"
130 @echo "* for module development or if you *"
131 @echo "* are experiencing problems. *"
133 @echo "*************************************"
137 @echo 'Cannot build single modules in pure-static build'
140 @echo 'Building single module:'
143 @echo 'To install, copy $(BUILDPATH)/$(TARGET) to $(MODPATH)'
144 @echo 'Or, run "make install"'
147 @echo "*************************************"
148 @echo "* BUILDING INSPIRCD *"
150 @echo "* This will take a *long* time. *"
151 @echo "* Why not read our wiki at *"
152 @echo "* http://wiki.inspircd.org *"
153 @echo "* while you wait for make to run? *"
154 @echo "*************************************"
156 finishmessage: target
158 @echo "*************************************"
159 @echo "* BUILD COMPLETE! *"
161 @echo "* To install InspIRCd, type: *"
162 @echo "* make install *"
163 @echo "*************************************"
166 @if [ "$(INSTUID)" = 0 -o "$(INSTUID)" = root ]; then \
168 echo "Error: You must specify a non-root UID for the server"; \
170 echo "If you are making a package, please specify using ./configure --uid"; \
171 echo "Otherwise, rerun using 'make INSTUID=irc install', where 'irc' is the user"; \
172 echo "who will be running the ircd. You will also need to modify the start script."; \
176 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)
177 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/data
178 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/logs
179 @-install -d -m $(INSTMODE_DIR) $(BINPATH)
180 @-install -d -m $(INSTMODE_DIR) $(CONPATH)
181 @-install -d -m $(INSTMODE_DIR) $(MODPATH)
182 [ $(BUILDPATH)/bin/ -ef $(BINPATH) ] || install -m $(INSTMODE_BIN) $(BUILDPATH)/bin/inspircd $(BINPATH)
184 [ $(BUILDPATH)/modules/ -ef $(MODPATH) ] || install -m $(INSTMODE_LIB) $(BUILDPATH)/modules/*.so $(MODPATH)
186 -install -m $(INSTMODE_BIN) @STARTSCRIPT@ $(BASE) 2>/dev/null
187 -install -m $(INSTMODE_LIB) tools/gdbargs $(BASE)/.gdbargs 2>/dev/null
188 -install -m $(INSTMODE_LIB) docs/*.example $(CONPATH)
190 @echo "*************************************"
191 @echo "* INSTALL COMPLETE! *"
192 @echo "*************************************"
194 @echo ' Base install:' $(BASE)
195 @echo ' Configuration:' $(CONPATH)
196 @echo ' Binaries:' $(BINPATH)
197 @echo ' Modules:' $(MODPATH)
198 @echo 'To start the ircd, run:' $(BASE)/inspircd start
199 @echo 'Remember to edit your config file:' $(CONPATH)/inspircd.conf
201 @GNU_ONLY RCS_FILES = $(wildcard .git/index src/version.sh)
202 @BSD_ONLY RCS_FILES = src/version.sh
203 GNUmakefile BSDmakefile: make/template/main.mk configure $(RCS_FILES)
205 @BSD_ONLY .MAKEFILEDEPS: BSDmakefile
209 -rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk
210 -rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules
211 @-rmdir $(BUILDPATH)/bin 2>/dev/null
212 @-rmdir $(BUILDPATH) 2>/dev/null
216 -rm $(BINPATH)/inspircd
219 squeakyclean: distclean
223 rm -f src/modules/Makefile
224 rm -f src/commands/Makefile
229 rm -f include/inspircd_config.h
230 rm -f include/inspircd_version.h
232 distclean: clean configureclean
235 @echo 'InspIRCd Makefile'
237 @echo 'Use: ${MAKE} [flags] [targets]'
240 @echo ' V=1 Show the full command being executed instead of "BUILD: dns.cpp"'
241 @echo ' D=1 Enable debug build, for module development or crash tracing'
242 @echo ' D=2 Enable debug build with optimizations, for detailed backtraces'
243 @echo ' DESTDIR= Specify a destination root directory (for tarball creation)'
244 @echo ' -j <N> Run a parallel build using N jobs'
247 @echo ' all Complete build of InspIRCd, without installing (default)'
248 @echo ' install Build and install InspIRCd to the directory chosen in ./configure'
249 @echo ' Currently installs to ${BASE}'
250 @echo ' debug Compile a debug build. Equivalent to "make D=1 all"'
252 @echo ' M=m_foo Builds a single module (cmd_foo also works here)'
253 @echo ' T=target Builds a user-specified target, such as "inspircd" or "modules"'
254 @echo ' Other targets are specified by their path in the build directory'
255 @echo ' Multiple targets may be separated by a space'
257 @echo ' clean Cleans object files produced by the compile'
258 @echo ' distclean Cleans all files produced by compile and ./configure'
259 @echo ' Note: this includes the Makefile'
260 @echo ' deinstall Removes the files created by "make install"'
263 .PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean configureclean help