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 SHARED = -shared -rdynamic
21 CORELDFLAGS = -rdynamic -L. $(LDFLAGS)
22 PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
24 CONPATH = "@CONFIG_DIR@"
25 MODPATH = "@MODULE_DIR@"
26 BINPATH = "@BINARY_DIR@"
35 CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall
41 @ELSIFEQ $(SYSTEM) solaris
42 LDLIBS += -lsocket -lnsl -lrt -lresolv
43 @ELSIFEQ $(SYSTEM) sunos
44 LDLIBS += -lsocket -lnsl -lrt -lresolv
45 @ELSIFEQ $(SYSTEM) darwin
46 CXXFLAGS += -DDARWIN -frtti
48 SHARED = -bundle -twolevel_namespace -undefined dynamic_lookup
49 CORELDFLAGS = -dynamic -bind_at_load -L.
50 @ELSIFEQ $(SYSTEM) interix
51 CXXFLAGS += -D_ALL_SOURCE -I/usr/local/include
55 CXXFLAGS += -g3 -Werror
61 FOOTER = finishmessage
71 @GNU_ONLY MAKEFLAGS += --no-print-directory
73 @GNU_ONLY SOURCEPATH = $(shell /bin/pwd)
74 @BSD_ONLY SOURCEPATH != /bin/pwd
80 @GNU_ONLY MAKEFLAGS += --silent
82 RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
86 CXXFLAGS += -DPURE_STATIC
89 @DO_EXPORT RUNCC CXXFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS PURE_STATIC
90 @DO_EXPORT SOURCEPATH BUILDPATH
98 @BSD_ONLY TARGET = modules/${M:S/.so$//}.so
99 @GNU_ONLY TARGET = modules/$(M:.so=).so
111 $(MAKEENV) perl make/calcdep.pl
112 cd $(BUILDPATH); $(MAKEENV) $(MAKE) -f real.mk $(TARGET)
118 @echo "*************************************"
119 @echo "* BUILDING WITH DEBUG SYMBOLS *"
121 @echo "* This will take a *long* time. *"
122 @echo "* Please be aware that this build *"
123 @echo "* will consume a very large amount *"
124 @echo "* of disk space (~350MB), and may *"
125 @echo "* run slower. Use the debug build *"
126 @echo "* for module development or if you *"
127 @echo "* are experiencing problems. *"
129 @echo "*************************************"
132 @echo 'Building single module:'
135 @echo 'To install, copy $(BUILDPATH)/$(TARGET) to $(MODPATH)'
136 @echo 'Or, run "make install"'
139 @echo "*************************************"
140 @echo "* BUILDING INSPIRCD *"
142 @echo "* This will take a *long* time. *"
143 @echo "* Why not read our wiki at *"
144 @echo "* http://wiki.inspircd.org *"
145 @echo "* while you wait for make to run? *"
146 @echo "*************************************"
148 finishmessage: target
150 @echo "*************************************"
151 @echo "* BUILD COMPLETE! *"
153 @echo "* To install InspIRCd, type: *"
154 @echo "* make install *"
155 @echo "*************************************"
157 install: target@EXTRA_DIR@
158 @if [ $(INSTUID) = 0 ]; then echo "You must specify a non-root uid for the server"; exit 1; fi
159 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)
160 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/data
161 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/logs
162 @-install -d -m $(INSTMODE_DIR) $(BINPATH)
163 @-install -d -m $(INSTMODE_DIR) $(CONPATH)
164 @-install -d -m $(INSTMODE_DIR) $(MODPATH)
165 -install -m $(INSTMODE_BIN) @STARTSCRIPT@ $(BASE) 2>/dev/null
166 -install -m $(INSTMODE_BIN) $(BUILDPATH)/bin/inspircd $(BINPATH)
167 -install -m $(INSTMODE_LIB) $(BUILDPATH)/modules/*.so $(MODPATH)
168 -install -m $(INSTMODE_LIB) tools/gdbargs $(BASE)/.gdbargs 2>/dev/null
169 -install -m $(INSTMODE_LIB) docs/*.example $(CONPATH)
171 @echo "*************************************"
172 @echo "* INSTALL COMPLETE! *"
174 @echo "* It is safe to ignore any messages *"
175 @echo "* related to copying of conf files. *"
177 @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *"
178 @echo "*************************************"
180 @GNU_ONLY RCS_FILES = $(wildcard .git/index .svn/entries src/version.sh)
181 @BSD_ONLY RCS_FILES = src/version.sh
182 GNUmakefile BSDmakefile: make/template/main.mk configure $(RCS_FILES)
184 @BSD_ONLY .MAKEFILEDEPS: BSDmakefile
188 -rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk
189 -rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules
190 @-rmdir $(BUILDPATH)/bin 2>/dev/null
191 @-rmdir $(BUILDPATH) 2>/dev/null
195 -rm $(BINPATH)/inspircd
198 squeakyclean: distclean
202 rm -f src/modules/Makefile
203 rm -f src/commands/Makefile
208 rm -f include/inspircd_config.h
209 rm -f include/inspircd_version.h
211 distclean: clean configureclean
214 @echo 'InspIRCd Makefile'
216 @echo 'Use: ${MAKE} [flags] [targets]'
219 @echo ' V=1 Show the full command being executed instead of "BUILD: dns.cpp"'
220 @echo ' D=1 Enable debug build, for module development or crash tracing'
221 @echo ' -j <N> Run a parallel build using N jobs'
223 @echo 'User targets:'
224 @echo ' all Complete build of InspIRCd, without installing'
225 @echo ' install Build and install InspIRCd to the directory chosen in ./configure'
226 @echo ' Currently installs to ${BASE}'
227 @echo ' debug Compile a debug build. Equivalent to "make D=1 all"'
229 @echo ' M=m_foo Builds a single module (cmd_foo also works here)'
230 @echo ' T=target Builds a user-specified target, such as "inspircd" or "modules"'
231 @echo ' Other targets are specified by their path in the build directory'
232 @echo ' Multiple targets may be separated by a space'
234 @echo ' clean Cleans object files produced by the compile'
235 @echo ' distclean Cleans all files produced by compile and ./configure'
236 @echo ' Note: this includes the Makefile'
237 @echo ' deinstall Removes the files created by "make install"'
240 .PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean configureclean help