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.
11 BUILDPATH = @BUILD_DIR@
12 SOCKETENGINE = @SOCKETENGINE@
13 CXXFLAGS += -pipe -fPIC -DPIC
14 LDLIBS = -pthread -lstdc++
16 SHARED = -shared -rdynamic
17 CORELDFLAGS = -rdynamic -L. $(LDFLAGS)
18 PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
20 CONPATH = "@CONFIG_DIR@"
21 MODPATH = "@MODULE_DIR@"
22 BINPATH = "@BINARY_DIR@"
23 LAUNCHDPATH = "/System/Library/LaunchDaemons"
29 CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall
35 @ELSIFEQ $(SYSTEM) solaris
36 LDLIBS += -lsocket -lnsl -lrt -lresolv
37 @ELSIFEQ $(SYSTEM) sunos
38 LDLIBS += -lsocket -lnsl -lrt -lresolv
39 @ELSIFEQ $(SYSTEM) darwin
40 CXXFLAGS += -DDARWIN -frtti
42 SHARED = -bundle -twolevel_namespace -undefined dynamic_lookup
43 CORELDFLAGS = -dynamic -bind_at_load -L.
44 @ELSIFEQ $(SYSTEM) interix
45 CXXFLAGS += -D_ALL_SOURCE -I/usr/local/include
49 CXXFLAGS += -g3 -Werror
55 FOOTER = finishmessage
59 @GNU_ONLY MAKEFLAGS += --no-print-directory
61 @GNU_ONLY SOURCEPATH = $(shell /bin/pwd)
62 @BSD_ONLY SOURCEPATH != /bin/pwd
68 @GNU_ONLY MAKEFLAGS += --silent
70 RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
73 @DO_EXPORT RUNCC CXXFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
74 @DO_EXPORT BASE CONPATH MODPATH BINPATH SOURCEPATH BUILDPATH
82 @BSD_ONLY TARGET = modules/${M:S/.so$//}.so
83 @GNU_ONLY TARGET = modules/$(M:.so=).so
95 $(MAKEENV) perl make/calcdep.pl
96 $(MAKEENV) $(MAKE) -C $(BUILDPATH) -f real.mk $(TARGET)
102 @echo "*************************************"
103 @echo "* BUILDING WITH DEBUG SYMBOLS *"
105 @echo "* This will take a *long* time. *"
106 @echo "* Please be aware that this build *"
107 @echo "* will consume a very large amount *"
108 @echo "* of disk space (150MB+), and can *"
109 @echo "* run slower. Use the debug build *"
110 @echo "* for module development or if you *"
111 @echo "* are experiencing problems. *"
113 @echo "*************************************"
116 @echo 'Building single module:'
119 @echo 'To install, copy $(BUILDPATH)/$(TARGET) to $(MODPATH)'
120 @echo 'Or, run "make install"'
123 @echo "*************************************"
124 @echo "* BUILDING INSPIRCD *"
126 @echo "* This will take a *long* time. *"
127 @echo "* Why not read our wiki at *"
128 @echo "* http://wiki.inspircd.org *"
129 @echo "* while you wait for make to run? *"
130 @echo "*************************************"
132 finishmessage: target
134 @echo "*************************************"
135 @echo "* BUILD COMPLETE! *"
137 @echo "* To install InspIRCd, type: *"
138 @echo "* make install *"
139 @echo "*************************************"
141 install: target@EXTRA_DIR@
142 @-install -d -m $(INSTMODE) $(BASE)
143 @-install -d -m $(INSTMODE) $(BASE)/data
144 @-install -d -m $(INSTMODE) $(BASE)/logs
145 @-install -d -m $(INSTMODE) $(BINPATH)
146 @-install -d -m $(INSTMODE) $(CONPATH)
147 @-install -d -m $(INSTMODE) $(MODPATH)
148 -install -m $(INSTMODE) $(BUILDPATH)/modules/*.so $(MODPATH)
149 -install -m $(INSTMODE) $(BUILDPATH)/bin/inspircd $(BINPATH)
150 -install -m $(INSTMODE) @STARTSCRIPT@ $(@DESTINATION@) 2>/dev/null
151 @$(MAKEENV) make/install-extras.pl install
153 @echo "*************************************"
154 @echo "* INSTALL COMPLETE! *"
156 @echo "* It is safe to ignore any messages *"
157 @echo "* related to copying of conf files. *"
159 @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *"
160 @echo "*************************************"
162 @GNU_ONLY RCS_FILES = $(wildcard .git/index .svn/entries)
163 @GNU_ONLY GNUmakefile: .Makefile.inc configure .config.cache $(RCS_FILES)
164 @GNU_ONLY ./configure -update
168 @-rm -f src/inspircd src/modes/modeclasses.a include/inspircd_se_config.h
169 @-rm -f src/*.so src/modules/*.so src/commands/*.so
170 @-rm -f src/*.o src/*/*.o src/modules/*/*.o
171 @-rm -f src/.*.d src/*/.*.d src/modules/*/.*.d
172 @-rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk
173 @-rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules
174 @-rmdir $(BUILDPATH)/bin 2>/dev/null
175 @-rmdir $(BUILDPATH) 2>/dev/null
179 -rm $(BINPATH)/inspircd
181 @make/install-extras.pl deinstall
183 squeakyclean: distclean
186 @-install -d -m $(INSTMODE) ${LAUNCHDPATH}
190 rm -f src/modules/Makefile
191 rm -f src/commands/Makefile
196 rm -f include/inspircd_config.h
197 rm -f include/inspircd_version.h
199 distclean: clean configureclean
202 @echo 'InspIRCd Makefile'
204 @echo 'Use: ${MAKE} [flags] [targets]'
207 @echo ' V=1 Show the full command being executed instead of "BUILD: dns.cpp"'
208 @echo ' D=1 Enable debug build, for module development or crash tracing'
209 @echo ' -j <N> Run a parallel build using N jobs'
211 @echo 'User targets:'
212 @echo ' all Complete build of InspIRCd, without installing'
213 @echo ' install Build and install InspIRCd to the directory chosen in ./configure'
214 @echo ' Currently installs to ${BASE}'
215 @echo ' debug Compile a debug build. Equivalent to "make D=1 all"'
217 @echo ' M=m_foo Builds a single module (cmd_foo also works here)'
218 @echo ' T=target Builds a user-specified target, such as "inspircd" or "modules"'
219 @echo ' Other targets are specified by their path in the build directory'
220 @echo ' Multiple targets may be separated by a space'
222 @echo ' clean Cleans object files produced by the compile'
223 @echo ' distclean Cleans all files produced by compile and ./configure'
224 @echo ' Note: this includes the Makefile'
225 @echo ' deinstall Removes the files created by "make install"'
228 .PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean launchd_dir configureclean help