# Makefile for snTest
# Menu-driven test program to test snLib functionality
# 28 May 2013
#

# Which C compiler to use - (cc, gcc xlc, etc.).
CC = gcc

# Compiler Flags
CFLAGS = -Wall -c -I. -I.. -I/usr/local/include -I/usr/local/include/modbus

LIBFLAGS = -L/usr/local/lib -lmodbus

SNLIB  = ../snLib.a

.c.o :
	$(CC) $(CFLAGS) $< 

ifdef CYGWIN
TARGET	= snTest.exe
else
TARGET  = snTest
endif

SOURCE	= snTest.c

OBJECTS     = $(SOURCE:%.c=%.o)


# Linking object files
$(TARGET): $(OBJECTS)
	$(CC) -o $(TARGET) $(OBJECTS) $(SNLIB) $(LIBFLAGS)

termMode.exe: termMode.o
	$(CC) -o termMode.exe termMode.o

# Remove executable and object files
clean:
	rm -f $(OBJECTS) $(TARGET)
