#
# This make file uses the Cygwin tool set to compile the application.
# The tool set is shipped with NET+OS for GNU.  If do not have the
# tool set, you can download it free of charge from http://www.cygwin.com/.
#

# GNU set up
GNU_PATH=/bin


PREFIX=$(GNU_PATH)
CC= $(PREFIX)/gcc
LD= $(PREFIX)/ld
AR= $(PREFIX)/ar
AS= $(PREFIX)/as
NM= $(PREFIX)/nm
RM= $(PREFIX)/rm

# debug flag
DEBUG_FLAG= -g


# search path for source header file
INC_DIR=../../../h
INC += -I. -I/usr/i686-cygwin/include -I/usr/i686-cygwin/include/cygwin 
INC += -I/usr/include/cygwin -I$(INC_DIR)


CRC_DIR=../../bsp/common
OBJDIR=.
OBJECTS=$(OBJDIR)/tcpsend.o 
DEPEND=depend.mk
SOURCE_DIRECTORY=.
CFILES=$(SOURCE_DIRECTORY)/tcpsend.c 
BIN_DIR=../../../bin
TARGET=$(BIN_DIR)/tcpsend.exe

# search path(s) for source file or library
VPATH= $(SOURCE_DIRECTORY)

# goal(s)
all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(CC) -o $@ $(OBJECTS)
	$(RM) -f $(OBJECTS) $(DEPEND)

$(OBJDIR)/%.o: %.c
	$(CC) -c $(INC) -O3 $(DEBUG_FLAG) $< -o $@




# clean up
clean:
	$(RM) -f $(OBJECTS)
	$(RM) -f $(TARGET)
	$(RM) -f $(DEPEND)

# generate dependencies
$(DEPEND): $(CFILES) Makefile
	$(CC) $(INC) -M $(CFILES) > $(DEPEND)


# header dep.
-include $(DEPEND)
