# local idiosyncracy - I needed to set the fortran compiler var to the 
# full path to the compiler (I will leave this line here in case
# you need to know how to do this) if your fortran compiler is in your
# default path, then you won't need this
# FC = /usr/lang/f77

FILL = $(ETC)/fill
PGM = $(BIN_ALPHA_CMD)/r.fill.dir

# this program uses a number of sub-programs.
# these we will put in $GIS/etc/fill

PGM1 = $(FILL)/fmt_un
PGM2 = $(FILL)/un_fmt_fill
PGM3 = $(FILL)/dopolys_for
PGM4 = $(FILL)/fillsngl_for
PGM5 = $(FILL)/wtrshed_for
PGM6 = $(FILL)/ppupdate_for

OBJ = fill-dir.o cell_open.o cell_open_new.o
OBJ1 = fmt_un.o
OBJ2 = un_fmt_fill.o
OBJ3 = dopolys.o
OBJ4 = fillsngl.o
OBJ5 = wtrshed.o
OBJ6 = ppupdate.o

all: $(PGM) $(PGM1) $(PGM2) $(PGM3) $(PGM4) $(PGM5) $(PGM6) 

$(PGM): $(OBJ) $(GISLIB)
	$(CC) $(LDFLAGS) $(OBJ) $(GISLIB) $(MATHLIB) -o $@

$(PGM1): $(OBJ1) $(FILL)
	$(FC) $(LDFLAGS) $(OBJ1) -o $@

$(PGM2): $(OBJ2) $(FILL)
	$(FC) $(LDFLAGS) $(OBJ2) -o $@

$(PGM3): $(OBJ3) $(FILL)
	$(FC) $(LDFLAGS) $(OBJ3) -o $@

$(PGM4): $(OBJ4) $(FILL)
	$(FC) $(LDFLAGS) $(OBJ4) -o $@

$(PGM5): $(OBJ5) $(FILL)
	$(FC) $(LDFLAGS) $(OBJ5) -o $@

$(PGM6): $(OBJ6) $(FILL)
	$(FC) $(LDFLAGS) $(OBJ6) -o $@

$(FILL):
	mkdir $(FILL)

$(GISLIB): #

