1 # InspIRCd Main Makefile
3 # (C) InspIRCd Development Team, 2002-2009
4 # This file is automagically generated by configure, from
5 # .Makefile.inc. Any changes make will go away!
6 # Please do not edit unless you know what you're doing.
9 @GNU_ONLY MAKESTYLE = gnu
10 @GNU_ONLY COMPILE_ROOT ?= $(shell pwd)
11 @BSD_ONLY MAKESTYLE = bsd
12 @BSD_ONLY COMPILE_ROOT != pwd
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@"
27 LAUNCHDPATH = "/System/Library/LaunchDaemons"
28 LIBPATH = "@LIBRARY_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 SHARED = -bundle -twolevel_namespace -undefined dynamic_lookup
48 CORE_FLAGS = -dynamic -bind_at_load -L.
58 FOOTER = finishmessage
60 CXXFLAGS += -I$(COMPILE_ROOT)/include
62 @GNU_ONLY MAKEFLAGS += --no-print-directory
68 @GNU_ONLY MAKEFLAGS += --silent
70 RUNCC = $(COMPILE_ROOT)/make/run-cc.pl $(CC)
73 @DO_EXPORT RUNCC CXXFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
74 @DO_EXPORT BASE CONPATH MODPATH BINPATH LIBPATH
82 @BSD_ONLY TARGET = modules/${M:S/.so$//}.so
83 @GNU_ONLY TARGET = modules/$(M:.so=).so
95 $(MAKEENV) $(MAKE) -C src -f ../make/$(MAKESTYLE)-real.mk $(TARGET)
101 @echo "*************************************"
102 @echo "* BUILDING WITH DEBUG SYMBOLS *"
104 @echo "* This will take a *long* time. *"
105 @echo "* Please be aware that this build *"
106 @echo "* will consume a very large amount *"
107 @echo "* of disk space (150MB+), and can *"
108 @echo "* run slower. Use the debug build *"
109 @echo "* for module development or if you *"
110 @echo "* are experiencing problems. *"
112 @echo "*************************************"
115 @echo 'Building single module:'
118 @echo 'To install, copy src/$(TARGET) to $(MODPATH)'
119 @echo 'Or, run "make install"'
122 @echo "*************************************"
123 @echo "* BUILDING INSPIRCD *"
125 @echo "* This will take a *long* time. *"
126 @echo "* Why not read our wiki at *"
127 @echo "* http://wiki.inspircd.org *"
128 @echo "* while you wait for make to run? *"
129 @echo "*************************************"
131 finishmessage: target
133 @echo "*************************************"
134 @echo "* BUILD COMPLETE! *"
136 @echo "* To install InspIRCd, type: *"
137 @echo "* make install *"
138 @echo "*************************************"
140 install: target@EXTRA_DIR@
141 @-install -d -m $(INSTMODE) $(BASE)
142 @-install -d -m $(INSTMODE) $(LIBPATH)
143 @-install -d -m $(INSTMODE) $(BINPATH)
144 @-install -d -m $(INSTMODE) $(CONPATH)
145 @-install -d -m $(INSTMODE) $(MODPATH)
146 -install -m $(INSTMODE) src/commands/*.so $(LIBPATH)
147 -install -m $(INSTMODE) src/modules/*.so $(MODPATH)
148 -install -m $(INSTMODE) @STARTSCRIPT@ $(@DESTINATION@) 2>/dev/null
149 -install -m $(INSTMODE) src/inspircd $(BINPATH)
150 @$(MAKEENV) make/install-extras.pl install
152 @echo "*************************************"
153 @echo "* INSTALL COMPLETE! *"
155 @echo "* It is safe to ignore any messages *"
156 @echo "* related to copying of conf files. *"
158 @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *"
159 @echo "*************************************"
163 @rm -f src/inspircd src/modes/modeclasses.a
164 @rm -f src/*.so src/modules/*.so src/commands/*.so src/modules/*/*.so
165 @rm -f src/*.o src/*/*.o src/modules/*/*.o
166 @rm -f src/.*.d src/*/.*.d src/modules/*/.*.d
170 -rm $(BINPATH)/inspircd
173 @make/install-extras.pl deinstall
175 squeakyclean: distclean
178 @-install -d -m $(INSTMODE) ${LAUNCHDPATH}
182 rm -f src/modules/Makefile
183 rm -f src/commands/Makefile
188 rm -f include/inspircd_config.h
189 rm -f include/inspircd_se_config.h
191 distclean: clean configureclean
194 @echo 'InspIRCd Makefile'
196 @echo 'Use: ${MAKE} [flags] [targets]'
199 @echo ' V=1 Show the full command being executed instead of "BUILD: dns.cpp"'
200 @echo ' D=1 Enable debug build, for module development or crash tracing'
201 @echo ' -j <N> Run a parallel build using N jobs'
203 @echo 'User targets:'
204 @echo ' all Complete build of InspIRCd, without installing'
205 @echo ' install Build and install InspIRCd to the directory chosen in ./configure'
206 @echo ' Currently installs to ${BASE}'
207 @echo ' debug Compile a debug build. Equivalent to "make D=1 all"'
209 @echo ' M=m_foo Builds a single module'
210 @echo ' T=target Builds a user-specified target'
211 @echo ' Target can be a file path relative to src/, or one of:'
212 @echo ' inspircd commands modules'
213 @echo ' Multiple targets may be separated by a space'
215 @echo ' clean Cleans object files produced by the compile'
216 @echo ' distclean Cleans all files produced by compile and ./configure'
217 @echo ' Note: this includes the Makefile'
218 @echo ' deinstall Removes the files created by "make install"'
221 .PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean launchd_dir configureclean help