4 # Get make-3.82-5-mingw32-bin.tar.lzma from
5 # http://sourceforge.net/projects/mingw/files/MinGW/Extension/make/make-3.82-mingw32/
7 # Set CC=gcc or CC=cl for the pre-defined compilers
8 # before using this Makefile
10 # Compile and link the bandwidth and random tests.
11 # Build modbus.dll and the import library before building the tests
12 # modbus.lib/libmodbus.a (the import library) should be in this directory
13 # modbus.dll should be in this directory or in path
15 INCLUDES:=-I../.. -I.. -I.
18 DEFS+=-D_CRT_SECURE_NO_DEPRECATE=1 -D_CRT_NONSTDC_NO_DEPRECATE=1
19 CFLAGS=-Zi -W3 -MT -ID:/include/msvc_std
20 LDOPTS=-link -incremental:NO
21 LDLIBS=-Fe$@ ws2_32.lib modbus.lib $(LDOPTS)
27 CFLAGS=-g -Wall -O -static -static-libgcc
28 LDLIBS=-o$@ -lws2_32 -luser32 -L. -lmodbus
34 CFLAGS+=-DHAVE_CONFIG_H $(DEFS) $(INCLUDES)
37 .SUFFIXES: .c .rc .$(RES) .$(oo)
39 # pattern rule for resources
46 all: random-test-client random-test-server bandwidth-client bandwidth-server-one
48 random-test-client: random-test-client.c
49 $(LINK.c) $^ $(LDLIBS)
51 random-test-server: random-test-server.c
52 $(LINK.c) $^ $(LDLIBS)
54 bandwidth-server-one: bandwidth-server-one.c
55 $(LINK.c) $^ $(LDLIBS)
57 bandwidth-client: bandwidth-client.c
58 $(LINK.c) $^ $(LDLIBS)
62 -@cmd "/c del /Q /S $(OBJS) *.o *.obj *.exe *.pdb *.ilk *.ncb *.res *.dll *.exp *.lib *.ncb *.a *.map *.asm" > NUL: 2>&1