]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - .Makefile.inc
Update svn:ignore and .gitignore
[user/henk/code/inspircd.git] / .Makefile.inc
1 #               InspIRCd Main Makefile
2 #
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.
7 #
8
9 CC = @CC@
10 SYSTEM = @SYSTEM@
11 BUILDPATH = @BUILD_DIR@
12 SOCKETENGINE = @SOCKETENGINE@
13 CXXFLAGS += -pipe -fPIC -DPIC
14 LDLIBS = -pthread -lstdc++
15 LDFLAGS = 
16 SHARED = -shared -rdynamic
17 CORELDFLAGS = -rdynamic -L. $(LDFLAGS)
18 PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
19 BASE = "@BASE_DIR@"
20 CONPATH = "@CONFIG_DIR@"
21 MODPATH = "@MODULE_DIR@"
22 BINPATH = "@BINARY_DIR@"
23 LAUNCHDPATH = "/System/Library/LaunchDaemons"
24 INSTMODE = 0755
25
26 @IFEQ $(CC) icc
27   CXXFLAGS += -Wshadow
28 @ELSE
29   CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall
30 @ENDIF
31
32
33 @IFEQ $(SYSTEM) linux
34   LDLIBS += -ldl
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
41   LDLIBS += -ldl
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
46 @ENDIF 
47
48 @IFDEF D
49     CXXFLAGS += -g3
50     HEADER = debug-header
51 @ELSE
52     CXXFLAGS += -g1
53     HEADER = std-header
54 @ENDIF
55 FOOTER = finishmessage
56
57 CXXFLAGS += -Iinclude
58
59 @GNU_ONLY MAKEFLAGS += --no-print-directory
60
61 @GNU_ONLY SOURCEPATH = $(shell /bin/pwd)
62 @BSD_ONLY SOURCEPATH != /bin/pwd
63
64 @IFDEF V
65     RUNCC = $(CC)
66     VERBOSE = -v
67 @ELSE
68     @GNU_ONLY MAKEFLAGS += --silent
69     @BSD_ONLY MAKE += -s
70     RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
71 @ENDIF
72
73 @DO_EXPORT RUNCC CXXFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
74 @DO_EXPORT BASE CONPATH MODPATH BINPATH SOURCEPATH BUILDPATH
75
76 # Default target
77 TARGET = all
78
79 @IFDEF M
80     HEADER = mod-header
81     FOOTER = mod-footer
82     @BSD_ONLY TARGET = modules/${M:S/.so$//}.so
83     @GNU_ONLY TARGET = modules/$(M:.so=).so
84 @ENDIF
85
86 @IFDEF T
87     HEADER =
88     FOOTER = target
89     TARGET = $(T)
90 @ENDIF
91
92 all: $(FOOTER)
93
94 target: $(HEADER)
95         $(MAKEENV) perl make/calcdep.pl
96         $(MAKEENV) $(MAKE) -C $(BUILDPATH) -f real.mk $(TARGET)
97
98 debug:
99         @${MAKE} D=1 all
100
101 debug-header:
102         @echo "*************************************"
103         @echo "*    BUILDING WITH DEBUG SYMBOLS    *"
104         @echo "*                                   *"
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.     *"
112         @echo "*                                   *"
113         @echo "*************************************"
114
115 mod-header:
116         @echo 'Building single module:'
117
118 mod-footer: target
119         @echo 'To install, copy $(BUILDPATH)/$(TARGET) to $(MODPATH)'
120         @echo 'Or, run "make install"'
121
122 std-header:
123         @echo "*************************************"
124         @echo "*       BUILDING INSPIRCD           *"
125         @echo "*                                   *"
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 "*************************************"
131
132 finishmessage: target
133         @echo ""
134         @echo "*************************************"
135         @echo "*        BUILD COMPLETE!            *"
136         @echo "*                                   *"
137         @echo "*   To install InspIRCd, type:      *"
138         @echo "*         make install              *"
139         @echo "*************************************"
140
141 install: target@EXTRA_DIR@
142         @-install -d -m $(INSTMODE) $(BASE)
143         @-install -d -m $(INSTMODE) $(BINPATH)
144         @-install -d -m $(INSTMODE) $(CONPATH)
145         @-install -d -m $(INSTMODE) $(MODPATH)
146         -install -m $(INSTMODE) $(BUILDPATH)/modules/*.so $(MODPATH)
147         -install -m $(INSTMODE) $(BUILDPATH)/bin/inspircd $(BINPATH)
148         -install -m $(INSTMODE) @STARTSCRIPT@ $(@DESTINATION@) 2>/dev/null
149         @$(MAKEENV) make/install-extras.pl install
150         @echo ""
151         @echo "*************************************"
152         @echo "*        INSTALL COMPLETE!          *"
153         @echo "*                                   *"
154         @echo "* It is safe to ignore any messages *"
155         @echo "* related to copying of conf files. *"
156         @echo "*                                   *"
157         @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *"
158         @echo "*************************************"
159
160 @GNU_ONLY RCS_FILES = $(wildcard .git/index .svn/entries)
161 @GNU_ONLY GNUmakefile: .Makefile.inc configure .config.cache $(RCS_FILES)
162 @GNU_ONLY       ./configure -update
163
164 clean:
165         @echo Cleaning...
166         @rm -f src/inspircd src/modes/modeclasses.a
167         @rm -f src/*.so src/modules/*.so src/commands/*.so
168         @rm -f src/*.o src/*/*.o src/modules/*/*.o
169         @rm -f src/.*.d src/*/.*.d src/modules/*/.*.d
170         @rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk
171         @rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules
172         @-rmdir $(BUILDPATH)/bin
173         @-rmdir $(BUILDPATH)
174         @echo Completed.
175
176 deinstall:
177         -rm $(BINPATH)/inspircd
178         -rm $(MODPATH)/*.so
179         @make/install-extras.pl deinstall
180
181 squeakyclean: distclean
182
183 launchd_dir:
184         @-install -d -m $(INSTMODE) ${LAUNCHDPATH}
185
186 configureclean:
187         rm -f .config.cache
188         rm -f src/modules/Makefile
189         rm -f src/commands/Makefile
190         rm -f src/Makefile
191         -rm -f Makefile
192         rm -f BSDmakefile
193         rm -f GNUmakefile
194         rm -f include/inspircd_config.h
195         rm -f include/inspircd_version.h
196         rm -f include/inspircd_se_config.h
197
198 distclean: clean configureclean
199
200 help:
201         @echo 'InspIRCd Makefile'
202         @echo ''
203         @echo 'Use: ${MAKE} [flags] [targets]'
204         @echo ''
205         @echo 'Flags:'
206         @echo ' V=1       Show the full command being executed instead of "BUILD: dns.cpp"'
207         @echo ' D=1       Enable debug build, for module development or crash tracing'
208         @echo ' -j <N>    Run a parallel build using N jobs'
209         @echo ''
210         @echo 'User targets:'
211         @echo ' all       Complete build of InspIRCd, without installing'
212         @echo ' install   Build and install InspIRCd to the directory chosen in ./configure'
213         @echo '           Currently installs to ${BASE}'
214         @echo ' debug     Compile a debug build. Equivalent to "make D=1 all"'
215         @echo ''
216         @echo ' M=m_foo   Builds a single module (cmd_foo also works here)'
217         @echo ' T=target  Builds a user-specified target, such as "inspircd" or "modules"'
218         @echo '           Other targets are specified by their path in the build directory'
219         @echo '           Multiple targets may be separated by a space'
220         @echo ''
221         @echo ' clean     Cleans object files produced by the compile'
222         @echo ' distclean Cleans all files produced by compile and ./configure'
223         @echo '           Note: this includes the Makefile'
224         @echo ' deinstall Removes the files created by "make install"'
225         @echo
226
227 .PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean launchd_dir configureclean help