summaryrefslogtreecommitdiff
path: root/.Makefile.inc
blob: 870a95bc921486035dcc4de7e5378a42e52f65af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# Inspircd Main Makefile
#
# (C) ChatSpike development team
# DO NOT MODIFY UNLESS YOU KNOW WHAT YOU ARE DOING!
#####
# Original Makefile & ./configure by <Craig@ChatSpike.net>
# Small modifications by <brain@ChatSpike.net>
#
DARWIN = @IS_DARWIN@

CC = @CC@
MAKE = @MAKEPROG@
PROGS = inspircd
FLAGS = @FLAGS@
LDLIBS = @LDLIBS@
BASE = $(DESTDIR)@BASE_DIR@
CONPATH = $(DESTDIR)@CONFIG_DIR@
MODPATH = $(DESTDIR)@MODULE_DIR@
BINPATH = $(DESTDIR)@BINARY_DIR@
LIBPATH = $(DESTDIR)@LIBRARY_DIR@
MODULES = @MODULES@
STATICLIBS = @STATICLIBS@
INSTMODE = 0700
MAKEARGS = 'PROGS=${PROGS}' 'FLAGS=${FLAGS}' 'CC=${CC}' 'LDLIBS=${LDLIBS}' 'MODULES=${MODULES}' 'MODPATH=${MODPATH}' 'LIBPATH=${LIBPATH}' 'STATICLIBS=${STATICLIBS}' 'INSTMODE=${INSTMODE}'

all : @MAKEORDER@ finishmessage

mods:
	@echo "Making modules..."
	${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS)

# Make this depend on 'ircd' and 'mods', so its always output last even with -j
finishmessage: ircd mods
	@echo ""
	@echo "*************************************"
	@echo "*        BUILD COMPLETE!            *"
	@echo "*                                   *"
	@echo "*   To install InspIRCd, type:      *"
	@echo "*         make install              *"
	@echo "*************************************"

ircd:
	@echo "*************************************"
	@echo "*       BUILDING INSPIRCD           *"
	@echo "*                                   *"
	@echo "*   This will take a *long* time.   *"
	@echo "*     Why not read our wiki at      *"
	@echo "*   http://www.inspircd.org/wiki    *"
	@echo "*  while you wait for make to run?  *"
	@echo "*************************************"
	${MAKE} -C src DIRNAME="src" $(MAKEARGS)

install: all
	@-install -d -m $(INSTMODE) ${BASE}
	@-install -d -m $(INSTMODE) $(LIBPATH)
	@-install -d -m $(INSTMODE) $(BINPATH)
	@-install -d -m $(INSTMODE) $(CONPATH)
	@-install -d -m $(INSTMODE) ${MODPATH}
ifeq ($(DARWIN),YES)
	-install -m $(INSTMODE) src/libIRCDasyncdns.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDbase.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDchannels.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDcommand_parse.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDcommands.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDconfigreader.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDcull_list.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDdynamic.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDhash.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDhelper.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDinspsocket.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDmode.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDmodules.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDsocket.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDsocketengine.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDstring.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDuserprocess.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDusers.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDwildcard.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDxline.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDtimer.dylib $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDsnomasks.dylib $(LIBPATH)
else
	-install -m $(INSTMODE) src/libIRCDasyncdns.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDbase.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDchannels.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDcommand_parse.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDcommands.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDconfigreader.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDcull_list.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDdynamic.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDhash.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDhelper.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDinspsocket.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDmode.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDmodules.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDsocket.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDsocketengine.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDstring.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDuserprocess.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDusers.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDwildcard.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDxline.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDtimer.so $(LIBPATH)
	-install -m $(INSTMODE) src/libIRCDsnomasks.so $(LIBPATH)
endif
	-install -m $(INSTMODE) src/inspircd $(BINPATH)
	-install -m $(INSTMODE) inspircd $(BASE) 2>/dev/null
	-install -m $(INSTMODE) src/cmd_admin.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_away.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_clearcache.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_commands.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_connect.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_die.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_eline.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_gline.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_info.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_invite.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_ison.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_join.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_kick.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_kill.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_kline.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_links.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_list.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_loadmodule.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_lusers.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_map.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_modules.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_motd.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_names.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_nick.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_notice.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_oper.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_part.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_pass.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_ping.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_pong.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_privmsg.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_qline.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_quit.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_rehash.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_restart.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_rules.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_server.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_squit.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_stats.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_summon.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_time.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_topic.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_trace.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_unloadmodule.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_user.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_userhost.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_users.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_version.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_wallops.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_who.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_whois.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_whowas.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_zline.so $(LIBPATH)
	-install -m $(INSTMODE) src/cmd_mode.so $(LIBPATH)
	@-cp .gdbargs $(BASE)
	@-cp conf/inspircd.quotes.example $(CONPATH)
	@-cp conf/inspircd.rules.example $(CONPATH)
	@-cp conf/inspircd.motd.example $(CONPATH)
	@-cp conf/inspircd.helpop-full.example $(CONPATH)
	@-cp conf/inspircd.helpop.example $(CONPATH)
	@-cp conf/inspircd.censor.example $(CONPATH)
	@-cp conf/inspircd.filter.example $(CONPATH)
	@-cp conf/key.pem $(CONPATH)
	@-cp conf/cert.pem $(CONPATH)
	@-cp docs/inspircd.conf.example $(CONPATH)
	${MAKE} modinstall

modinstall: mods
	${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) modinst
	@echo ""
	@echo "*************************************"
	@echo "*        INSTALL COMPLETE!          *"
	@echo "*                                   *"
	@echo "* It is safe to ignore any messages *"
	@echo "* related to copying of conf files. *"
	@echo "*                                   *"
	@echo "* REMEMBER TO EDIT YOUR CONFIG FILE *"
	@echo "*************************************"

module:
	${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) ${name}

clean:
	@echo Cleaning...
	@rm -rvf src/*.dylib src/*.so src/*.o src/inspircd src/modules/*.so src/modules/*.o *~ src/*~ src/modules/*~ src/modules/extra/*~ src/modes/*~ src/modes/*.o src/modes/*.a src/modules/*/*.o src/modules/*/*.so
	@echo Completed.

modclean:
	rm -rf modules/*.so
	rm -rf src/modules/*.so
	rm -rf src/modules/*.o
	rm -rf src/modules/*/*.so
	rm -rf src/modules/*/*.o
	rm -rf lib/*.so
	rm -f bin/inspircd

squeakyclean: distclean

distclean: modclean clean