1#
2# Copyright (C) 2011-2012 Michael Tuexen
3#
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright
12#    notice, this list of conditions and the following disclaimer in the
13#    documentation and/or other materials provided with the distribution.
14# 3. Neither the name of the project nor the names of its contributors
15#    may be used to endorse or promote products derived from this software
16#    without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21# ARE DISCLAIMED.	IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28# SUCH DAMAGE.
29#
30
31CFLAGS=/W3 /WX /I..\usrsctplib
32
33CVARSDLL=-DINET -DINET6
34
35LINKFLAGS=/LIBPATH:..\usrsctplib usrsctp.lib
36
37.c.obj::
38	$(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
39
40all: \
41	programs_helper.obj \
42	client \
43	client_upcall \
44	daytime_server \
45	daytime_server_upcall \
46	discard_server \
47	discard_server_upcall \
48	echo_server \
49	echo_server_upcall \
50	tsctp \
51	rtcweb \
52	ekr_client \
53	ekr_server \
54	ekr_peer \
55	ekr_loop \
56	ekr_loop_offload \
57	ekr_loop_upcall \
58	test_libmgmt \
59	http_client \
60	http_client_upcall \
61	st_client
62
63programs_helper.obj : programs_helper.c programs_helper.h
64	cl $(CVARSDLL) $(CFLAGS) -c programs_helper.c
65
66client:
67	$(CC) $(CFLAGS) $(CVARSDLL) -c client.c
68	link -out:client.exe client.obj programs_helper.obj $(LINKFLAGS)
69
70client_upcall:
71	$(CC) $(CFLAGS) $(CVARSDLL) -c client_upcall.c
72	link -out:client_upcall.exe client_upcall.obj programs_helper.obj $(LINKFLAGS)
73
74daytime_server:
75	$(CC) $(CFLAGS) $(CVARSDLL) -c daytime_server.c
76	link -out:daytime_server.exe daytime_server.obj programs_helper.obj $(LINKFLAGS)
77
78daytime_server_upcall:
79	$(CC) $(CFLAGS) $(CVARSDLL) -c daytime_server_upcall.c
80	link -out:daytime_server_upcall.exe daytime_server_upcall.obj programs_helper.obj $(LINKFLAGS)
81
82discard_server:
83	$(CC) $(CFLAGS) $(CVARSDLL) -c discard_server.c
84	link -out:discard_server.exe discard_server.obj programs_helper.obj $(LINKFLAGS)
85
86discard_server_upcall:
87	$(CC) $(CFLAGS) $(CVARSDLL) -c discard_server_upcall.c
88	link -out:discard_server_upcall.exe discard_server_upcall.obj programs_helper.obj $(LINKFLAGS)
89
90echo_server:
91	$(CC) $(CFLAGS) $(CVARSDLL) -c echo_server.c
92	link -out:echo_server.exe echo_server.obj programs_helper.obj $(LINKFLAGS)
93
94echo_server_upcall:
95	$(CC) $(CFLAGS) $(CVARSDLL) -c echo_server_upcall.c
96	link -out:echo_server_upcall.exe echo_server_upcall.obj programs_helper.obj $(LINKFLAGS)
97
98tsctp:
99	$(CC) $(CFLAGS) $(CVARSDLL) -c tsctp.c
100	link -out:tsctp.exe tsctp.obj programs_helper.obj $(LINKFLAGS)
101
102rtcweb:
103	$(CC) $(CFLAGS) $(CVARSDLL) -c rtcweb.c
104	link -out:rtcweb.exe rtcweb.obj programs_helper.obj $(LINKFLAGS)
105
106ekr_client:
107	$(CC) $(CFLAGS) $(CVARSDLL) -c ekr_client.c
108	link -out:ekr_client.exe ekr_client.obj programs_helper.obj $(LINKFLAGS)
109
110ekr_server:
111	$(CC) $(CFLAGS) $(CVARSDLL) -c ekr_server.c
112	link -out:ekr_server.exe ekr_server.obj programs_helper.obj $(LINKFLAGS)
113
114ekr_peer:
115	$(CC) $(CFLAGS) $(CVARSDLL) -c ekr_peer.c
116	link -out:ekr_peer.exe ekr_peer.obj programs_helper.obj $(LINKFLAGS)
117
118ekr_loop:
119	$(CC) $(CFLAGS) $(CVARSDLL) -c ekr_loop.c
120	link -out:ekr_loop.exe ekr_loop.obj programs_helper.obj $(LINKFLAGS)
121
122ekr_loop_offload:
123	$(CC) $(CFLAGS) $(CVARSDLL) -c ekr_loop_offload.c
124	link -out:ekr_loop_offload.exe ekr_loop_offload.obj programs_helper.obj $(LINKFLAGS)
125
126ekr_loop_upcall:
127	$(CC) $(CFLAGS) $(CVARSDLL) -c ekr_loop_upcall.c
128	link -out:ekr_loop_upcall.exe ekr_loop_upcall.obj programs_helper.obj $(LINKFLAGS)
129
130test_libmgmt:
131	$(CC) $(CFLAGS) $(CVARSDLL) -c test_libmgmt.c
132	link -out:test_libmgmt.exe test_libmgmt.obj programs_helper.obj $(LINKFLAGS)
133
134http_client:
135	$(CC) $(CFLAGS) $(CVARSDLL) -c http_client.c
136	link -out:http_client.exe http_client.obj programs_helper.obj $(LINKFLAGS)
137
138http_client_upcall:
139	$(CC) $(CFLAGS) $(CVARSDLL) -c http_client_upcall.c
140	link -out:http_client_upcall.exe http_client_upcall.obj programs_helper.obj $(LINKFLAGS)
141
142st_client:
143	$(CC) $(CFLAGS) $(CVARSDLL) -c st_client.c
144	link -out:st_client.exe st_client.obj programs_helper.obj $(LINKFLAGS)
145
146clean:
147	del /F client.exe
148	del /F client.obj
149	del /F client_upcall.exe
150	del /F client_upcall.obj
151	del /F daytime_server.exe
152	del /F daytime_server.obj
153	del /F daytime_server_upcall.exe
154	del /F daytime_server_upcall.obj
155	del /F discard_server.exe
156	del /F discard_server.obj
157	del /F discard_server_upcall.exe
158	del /F discard_server_upcall.obj
159	del /F echo_server.exe
160	del /F echo_server.obj
161	del /F echo_server_upcall.exe
162	del /F echo_server_upcall.obj
163	del /F tsctp.exe
164	del /F tsctp.obj
165	del /F rtcweb.exe
166	del /F rtcweb.obj
167	del /F ekr_client.exe
168	del /F ekr_client.obj
169	del /F ekr_server.exe
170	del /F ekr_server.obj
171	del /F ekr_peer.exe
172	del /F ekr_peer.obj
173	del /F ekr_loop.exe
174	del /F ekr_loop.obj
175	del /F ekr_loop_offload.exe
176	del /F ekr_loop_offload.obj
177	del /F ekr_loop_upcall.exe
178	del /F ekr_loop_upcall.obj
179	del /F test_libmgmt.exe
180	del /F test_libmgmt.obj
181	del /F http_client.exe
182	del /F http_client.obj
183	del /F http_client_upcall.exe
184	del /F http_client_upcall.obj
185	del /F st_client.exe
186	del /F st_client.obj
187