1#
2## Copyright (C) 2001-2013 Graeme Walker <graeme_walker@users.sourceforge.net>
3##
4## This program is free software: you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation, either version 3 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program.  If not, see <http://www.gnu.org/licenses/>.
16#
17#
18# mingw.mak
19#
20# See ../mingw-common.mak for help.
21#
22
23console_sources=\
24	admin_enabled.cpp \
25	commandline_full.cpp \
26	configuration.cpp \
27	legal.cpp \
28	news.cpp \
29	output.cpp \
30	run.cpp
31
32console_objects=$(console_sources:.cpp=.o)
33
34window_sources=\
35	winapp.cpp \
36	winform.cpp \
37	winmain.cpp \
38	winmenu.cpp
39
40window_objects=$(window_sources:.cpp=.o)
41
42main_objects=$(console_objects) $(window_objects)
43test_objects=$(console_objects) main.o
44
45libs=../gpop/gpop.a ../gsmtp/gsmtp.a ../gnet/gnet.a ../gauth/gauth.a ../gssl/gssl.a ../win32/gwin32.a ../glib/glib.a $(mk_ssl_libs)
46glib=../glib/glib.a
47syslibs=-lgdi32 -lws2_32 -ladvapi32
48rc=emailrelay.rc
49fake_mc=fakemc.exe
50mc_output=MSG00001.bin messages.rc
51mk_exe_main=emailrelay.exe
52mk_exe_test=emailrelay-test.exe
53mk_exe_filter_copy=emailrelay-filter-copy.exe
54mk_exe_poke=emailrelay-poke.exe
55mk_exe_passwd=emailrelay-passwd.exe
56mk_exe_submit=emailrelay-submit.exe
57mk_exe_service=emailrelay-service.exe
58res=$(rc:.rc=.o)
59
60all: $(mk_exe_main) $(mk_exe_filter_copy) $(mk_exe_poke) $(mk_exe_passwd) $(mk_exe_submit) $(mk_exe_service) $(mk_exe_test)
61
62include ../mingw-common.mak
63
64$(mk_exe_main): $(main_objects) $(res) $(libs)
65	$(mk_link) $(mk_link_flags) -mwindows -o $(mk_exe_main) $(main_objects) $(res) $(libs) $(syslibs)
66
67$(mk_exe_test): $(test_objects) $(res) $(libs)
68	$(mk_link) $(mk_link_flags) -o $(mk_exe_test) $(test_objects) $(libs) $(syslibs)
69
70$(mk_exe_filter_copy): filter_copy.o legal.o filter.o
71	$(mk_link) $(mk_link_flags) -o $@ filter_copy.o legal.o filter.o $(libs) $(syslibs)
72
73$(mk_exe_poke): poke.o
74	$(mk_link) $(mk_link_flags) -o $@ $< $(libs) $(syslibs)
75
76$(mk_exe_passwd): passwd.o legal.o
77	$(mk_link) $(mk_link_flags) -o $@ passwd.o legal.o $(libs) $(syslibs)
78
79$(mk_exe_submit): submit.o legal.o
80	$(mk_link) $(mk_link_flags) -o $@ submit.o legal.o $(libs) $(syslibs)
81
82$(mk_exe_service): service_install.o service_remove.o service_wrapper.o
83	$(mk_link) $(mk_link_flags) -o $@ service_install.o service_remove.o service_wrapper.o $(glib) $(syslibs)
84
85$(fake_mc): fakemc.o
86	$(mk_link) $(mk_link_flags) -o $@ $<
87
88$(mc_output): $(fake_mc) messages.mc
89	$(fake_mc) messages.mc
90
91$(res): $(rc) $(mc_output)
92	$(mk_rc) --include-dir . -i $(rc) -o $@
93
94