]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - .Makefile.inc
Re-implement dependency generation in perl to increase speed
[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 @GNU_ONLY MAKESTYLE = gnu
10 @GNU_ONLY COMPILE_ROOT ?= $(shell pwd)
11 @BSD_ONLY MAKESTYLE = bsd
12 @BSD_ONLY COMPILE_ROOT != pwd
13
14 @IFDEF D
15     NICEFLAGS = @DEVELOPER@
16     HEADER = debug-header
17 @ENDIF
18
19 NICEFLAGS ?= @FLAGS@
20 HEADER ?= std-header
21
22 NICEFLAGS += -I$(COMPILE_ROOT)/include
23
24 CC = @CC@
25 FLAGS = $(NICEFLAGS) -pedantic
26 PICLDFLAGS = -fPIC -DPIC -shared -export-dynamic
27 CORE_FLAGS = @CORE_FLAGS@
28 LDLIBS = @LDLIBS@
29 BASE = "@BASE_DIR@"
30 CONPATH = "@CONFIG_DIR@"
31 MODPATH = "@MODULE_DIR@"
32 BINPATH = "@BINARY_DIR@"
33 LAUNCHDPATH = "/System/Library/LaunchDaemons"
34 LIBPATH = "@LIBRARY_DIR@"
35 INSTMODE = 0755
36 SOCKETENGINE = @SOCKETENGINE@
37 @GNU_ONLY MAKEFLAGS += --no-print-directory
38
39 @IFDEF V
40     RUNCC = $(CC)
41     VERBOSE = -v
42 @ELSE
43     @GNU_ONLY MAKEFLAGS += --silent
44     @BSD_ONLY MAKE += -s
45     RUNCC = $(COMPILE_ROOT)/make/run-cc.pl $(CC)
46 @ENDIF
47
48 @DO_EXPORT RUNCC FLAGS NICEFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORE_FLAGS
49
50 # Default target
51
52 @IFDEF M
53    _all: module
54 @ENDIF
55
56 all: finishmessage
57
58 alldep: $(HEADER)
59         @echo -n "Generating module dependencies..."
60         @$(MAKEENV) $(MAKE) -C src -f ../make/$(MAKESTYLE)-dep.mk alldep
61         @echo 'done'
62
63 allreal: alldep
64         @$(MAKEENV) $(MAKE) -C src -f ../make/$(MAKESTYLE)-real.mk all
65
66 debug:
67         @${MAKE} D=1 all
68
69 debug-header:
70         @echo "*************************************"
71         @echo "*    BUILDING WITH DEBUG SYMBOLS    *"
72         @echo "*                                   *"
73         @echo "*   This will take a *long* time.   *"
74         @echo "*  Please be aware that this build  *"
75         @echo "*  will consume a very large amount *"
76         @echo "*  of disk space (150MB+), and can  *"
77         @echo "*  run slower. Use the debug build  *"
78         @echo "*  for module development or if you *"
79         @echo "*    are experiencing problems.     *"
80         @echo "*                                   *"
81         @echo "*************************************"
82
83 std-header:
84         @echo "*************************************"
85         @echo "*       BUILDING INSPIRCD           *"
86         @echo "*                                   *"
87         @echo "*   This will take a *long* time.   *"
88         @echo "*     Why not read our wiki at      *"
89         @echo "*     http://wiki.inspircd.org      *"
90         @echo "*  while you wait for make to run?  *"
91         @echo "*************************************"
92
93 finishmessage: allreal
94         @echo ""
95         @echo "*************************************"
96         @echo "*        BUILD COMPLETE!            *"
97         @echo "*                                   *"
98         @echo "*   To install InspIRCd, type:      *"
99         @echo "*         make install              *"
100         @echo "*************************************"
101
102 install: allreal@EXTRA_DIR@
103         @-install -d -m $(INSTMODE) $(BASE)
104         @-install -d -m $(INSTMODE) $(LIBPATH)
105         @-install -d -m $(INSTMODE) $(BINPATH)
106         @-install -d -m $(INSTMODE) $(CONPATH)
107         @-install -d -m $(INSTMODE) $(MODPATH)
108         -install -m $(INSTMODE) src/commands/*.so $(LIBPATH)
109         -install -m $(INSTMODE) src/modules/*.so $(MODPATH)
110         -install -m $(INSTMODE) @STARTSCRIPT@ $(@DESTINATION@) 2>/dev/null
111 @INSTALL_LIST@  -install -m $(INSTMODE) src/inspircd $(BINPATH)
112         @echo ""
113         @echo "*************************************"
114         @echo "*        INSTALL COMPLETE!          *"
115         @echo "*                                   *"
116         @echo "* It is safe to ignore any messages *"
117         @echo "* related to copying of conf files. *"
118         @echo "*                                   *"
119         @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *"
120         @echo "*************************************"
121
122 module:
123         @BSD_ONLY @${MAKE} -C src/modules $(MAKEARGS) ${M:S/.so$//}.so
124         @GNU_ONLY @${MAKE} -C src/modules $(MAKEARGS) $(M:.so=).so
125
126 clean:
127         @echo Cleaning...
128         @rm -f src/inspircd src/modes/modeclasses.a
129         @rm -f src/*.so src/modules/*.so src/commands/*.so src/modules/*/*.so
130         @rm -f src/*.o src/*/*.o src/modules/*/*.o
131         @rm -f src/.*.d src/*/.*.d src/modules/*/.*.d
132         @echo Completed.
133
134 modclean:
135         rm -f src/modules/*.so
136         rm -f src/modules/*.o
137         rm -f src/modules/*/*.so
138         rm -f src/modules/*/*.o
139
140 deinstall:
141         -rm $(BINPATH)/inspircd
142         -rm $(LIBPATH)/*.so
143         -rm $(MODPATH)/*.so
144 @UNINSTALL_LIST@
145
146 squeakyclean: distclean
147
148 launchd_dir:
149         @-install -d -m $(INSTMODE) ${LAUNCHDPATH}
150
151 configureclean:
152         rm -f .config.cache
153         rm -f src/modules/Makefile
154         rm -f src/commands/Makefile
155         rm -f src/Makefile
156         -rm -f Makefile
157         rm -f BSDmakefile
158         rm -f GNUmakefile
159         rm -f include/inspircd_config.h
160         rm -f include/inspircd_se_config.h
161
162 distclean: modclean clean configureclean
163
164 help:
165         @echo 'InspIRCd Makefile'
166         @echo ''
167         @echo 'Use: ${MAKE} [flags] [targets]'
168         @echo ''
169         @echo 'Flags:'
170         @echo ' V=1       Show the full command being executed instead of "BUILD: dns.cpp"'
171         @echo ' D=1       Enable debug build, for module development or crash tracing'
172         @echo ' -j <N>    Run a parallel build using N jobs'
173         @echo ''
174         @echo 'User targets:'
175         @echo ' all       Complete build of InspIRCd, without installing'
176         @echo ' install   Build and install InspIRCd to the directory chosen in ./configure'
177         @echo '           Currently installs to ${BASE}'
178         @echo ' debug     Compile a debug build. Equivalent to "make D=1 all"'
179         @echo ' module    Builds a single module, which is specified by "M=m_modname"'
180         @echo '           The command "make M=m_modname" is a shortcut for this target'
181         @echo ''
182         @echo ' clean     Cleans object files produced by the compile'
183         @echo ' distclean Cleans all files produced by compile and ./configure'
184         @echo ' deinstall Removes the files created by "make install"'
185         @echo
186
187 .PHONY: all help debug debug-header std-header ircd mods finishmessage install module clean modclean deinstall squeakyclean launchd_dir configureclean