#
# Copyright (C) 2003, 2004, 2005 Alex Karev
#
# This file is part of Modb library.
# 
# Modb library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
# 
# Modb library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Modb library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
CC=gcc
CFLAGS=$(OPTIFLAGS) -Wall -Wno-parentheses -Wstrict-prototypes -D_REENTRANT

# Floppy modbus test
MOD_CFLAGS=$(MOD_OPTIFLAGS) -static -Wall -Wno-parentheses -Wstrict-prototypes -D_REENTRANT
MOD_OPTIFLAGS=-DNDEBUG -Os -s -march=i386 -fomit-frame-pointer

RS_PATH=../rs
RS_SRC=rs.c

all: testmb
	@echo "Building 'all' finished."

testmb:	$(RS_PATH)/$(RS_SRC) testmb.c modb.c
	$(CC) $(MOD_CFLAGS) -o $@ $^ -I$(RS_PATH)

.PHONY: clean all

clean:
	rm -f ./*.o ./*~ ./a.out ./testmb
