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 = -O1 -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
65 @GNU_ONLY MAKEFLAGS += --no-print-directory
67 @GNU_ONLY SOURCEPATH = $(shell /bin/pwd)
68 @BSD_ONLY SOURCEPATH != /bin/pwd
74 @GNU_ONLY MAKEFLAGS += --silent
76 RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
80 CXXFLAGS += -DPURE_STATIC
83 @DO_EXPORT RUNCC CXXFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS PURE_STATIC
84 @DO_EXPORT BASE CONPATH MODPATH BINPATH SOURCEPATH BUILDPATH INSTUID
92 @BSD_ONLY TARGET = modules/${M:S/.so$//}.so
93 @GNU_ONLY TARGET = modules/$(M:.so=).so
105 $(MAKEENV) perl make/calcdep.pl
106 cd $(BUILDPATH); $(MAKEENV) $(MAKE) -f real.mk $(TARGET)
112 @echo "*************************************"
113 @echo "* BUILDING WITH DEBUG SYMBOLS *"
115 @echo "* This will take a *long* time. *"
116 @echo "* Please be aware that this build *"
117 @echo "* will consume a very large amount *"
118 @echo "* of disk space (~350MB), and may *"
119 @echo "* run slower. Use the debug build *"
120 @echo "* for module development or if you *"
121 @echo "* are experiencing problems. *"
123 @echo "*************************************"
126 @echo 'Building single module:'
129 @echo 'To install, copy $(BUILDPATH)/$(TARGET) to $(MODPATH)'
130 @echo 'Or, run "make install"'
133 @echo "*************************************"
134 @echo "* BUILDING INSPIRCD *"
136 @echo "* This will take a *long* time. *"
137 @echo "* Why not read our wiki at *"
138 @echo "* http://wiki.inspircd.org *"
139 @echo "* while you wait for make to run? *"
140 @echo "*************************************"
142 finishmessage: target
144 @echo "*************************************"
145 @echo "* BUILD COMPLETE! *"
147 @echo "* To install InspIRCd, type: *"
148 @echo "* make install *"
149 @echo "*************************************"
151 install: target@EXTRA_DIR@
152 @if [ $(INSTUID) = 0 ]; then echo "You must specify a non-root uid for the server"; exit 1; fi
153 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)
154 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/data
155 @-install -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/logs
156 @-install -d -m $(INSTMODE_DIR) $(BINPATH)
157 @-install -d -m $(INSTMODE_DIR) $(CONPATH)
158 @-install -d -m $(INSTMODE_DIR) $(MODPATH)
159 -install -m $(INSTMODE_BIN) @STARTSCRIPT@ $(BASE) 2>/dev/null
160 -install -m $(INSTMODE_BIN) $(BUILDPATH)/bin/inspircd $(BINPATH)
161 -install -m $(INSTMODE_LIB) $(BUILDPATH)/modules/*.so $(MODPATH)
162 @$(MAKEENV) make/install-extras.pl install
164 @echo "*************************************"
165 @echo "* INSTALL COMPLETE! *"
167 @echo "* It is safe to ignore any messages *"
168 @echo "* related to copying of conf files. *"
170 @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *"
171 @echo "*************************************"
173 @GNU_ONLY RCS_FILES = $(wildcard .git/index .svn/entries src/version.sh)
174 @BSD_ONLY RCS_FILES = src/version.sh
175 GNUmakefile BSDmakefile: make/template/main.mk configure $(RCS_FILES)
177 @BSD_ONLY .MAKEFILEDEPS: BSDmakefile
181 -rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk
182 -rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules
183 @-rmdir $(BUILDPATH)/bin 2>/dev/null
184 @-rmdir $(BUILDPATH) 2>/dev/null
188 -rm $(BINPATH)/inspircd
190 @make/install-extras.pl deinstall
192 squeakyclean: distclean
196 rm -f src/modules/Makefile
197 rm -f src/commands/Makefile
202 rm -f include/inspircd_config.h
203 rm -f include/inspircd_version.h
205 distclean: clean configureclean
208 @echo 'InspIRCd Makefile'
210 @echo 'Use: ${MAKE} [flags] [targets]'
213 @echo ' V=1 Show the full command being executed instead of "BUILD: dns.cpp"'
214 @echo ' D=1 Enable debug build, for module development or crash tracing'
215 @echo ' -j <N> Run a parallel build using N jobs'
217 @echo 'User targets:'
218 @echo ' all Complete build of InspIRCd, without installing'
219 @echo ' install Build and install InspIRCd to the directory chosen in ./configure'
220 @echo ' Currently installs to ${BASE}'
221 @echo ' debug Compile a debug build. Equivalent to "make D=1 all"'
223 @echo ' M=m_foo Builds a single module (cmd_foo also works here)'
224 @echo ' T=target Builds a user-specified target, such as "inspircd" or "modules"'
225 @echo ' Other targets are specified by their path in the build directory'
226 @echo ' Multiple targets may be separated by a space'
228 @echo ' clean Cleans object files produced by the compile'
229 @echo ' distclean Cleans all files produced by compile and ./configure'
230 @echo ' Note: this includes the Makefile'
231 @echo ' deinstall Removes the files created by "make install"'
234 .PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean configureclean help