SHELL = /bin/sh

#CCCPEV (Cross-Compiler, Cross-Platform Environment Variables)
INCS = -I"../fes2004_1.0.9"
LINCS=
CC=g++
CCFLAGS=$(INCS) -c
LCFLAGS=
OCFLAG=-o
AR=ar rc
RANLIB=ranlib
DLLW=dllwrap
RM=del
CP=xcopy
H=h
C=cpp
O=o
A=exe
D=tds
L=lib
SO=dll

#Files list
LIBP=..\fes2004_1.0.9\bin
INCP=..\fes2004_1.0.9
TARGET=bin\mohid-tide.$(A)
SRC=mohid-tide.$(C)
LIB=$(LIBP)\netcdf.$(SO) $(LIBP)\WinGsl.$(SO) $(LIBP)\fes2004.$(SO)
OBJ=$(SRC:.$(C)=.$(O))
HDR=$(INCP)\fes2004_lib.h \
    $(INCP)\netcdf.h \
    $(INCP)\WinGsl.h \
    $(INCP)\fes.h

#Action "make all"
.PHONY=all
all : $(TARGET)
	-$(CP) $(LIBP)\fes2004.$(SO) bin

$(TARGET) : $(OBJ) $(LIB)
	$(CC) $(LCFLAGS) $(OCFLAG) $@ $^

$(LIB) $(HDR):
	@echo Warning: $@ is missing.

%.$(O) : %.$(C)
	$(CC) $(CCFLAGS) $<

#Action "make clean"
.PHONY=clean
clean :
	-$(RM) $(OBJ) $(TARGET) $(TARGET:.$(A)=.$(D)) bin\fes2004.$(SO)

#Dependencies list
mohid-tide.$(C) : $(INCP)\fes.$(H)
