include ../makefile.dep

LIBDIR= ../lib/$(HOST)
BINDIR= ../bin/$(HOST)

INCLUDES      = -I../include  -I../adcp/include

TARGETS = chtime db2todb3 delblk fixnbyte lst_prof lstblock \
	      mkblkdir showdb to_date to_day to_week asc_dump \
	      chprodid ldcodas

all:	$(TARGETS)

LIBS1	      = \
      $(LIBDIR)/use_db$(LIB) \
		$(LIBDIR)/dbsource$(LIB) \
		$(LIBDIR)/ioserv$(LIB)

chtime	 : $(BINDIR)/chtime$(EXE)
chtimeOBJECTS = chtime$(OBJ) $(LIBDIR)/main_cnt$(OBJ)
$(BINDIR)/chtime$(EXE): $(chtimeOBJECTS)
	$(CCLINK) -o $@ $(chtimeOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

db2todb3 : $(BINDIR)/db2todb3$(EXE)
db2todb3OBJECTS = db2todb3$(OBJ) vc$(OBJ)
$(BINDIR)/db2todb3$(EXE): $(db2todb3OBJECTS)
	$(CCLINK) -o $@ $(db2todb3OBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

delblk	: $(BINDIR)/delblk$(EXE)
delblkOBJECTS = delblk$(OBJ)
$(BINDIR)/delblk$(EXE): $(delblkOBJECTS)
	$(CCLINK) -o $@ $(delblkOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

fixnbyte  : $(BINDIR)/fixnbyte$(EXE)
fixnbyteOBJECTS = fixnbyte$(OBJ)
$(BINDIR)/fixnbyte$(EXE): $(fixnbyteOBJECTS)
	$(CCLINK) -o $@ $(fixnbyteOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

lst_prof : $(BINDIR)/lst_prof$(EXE)
lst_profOBJECTS = lst_prof$(OBJ) $(LIBDIR)/main_cnt$(OBJ)
$(BINDIR)/lst_prof$(EXE): $(lst_profOBJECTS)
	$(CCLINK) -o $@ $(lst_profOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

lstblock : $(BINDIR)/lstblock$(EXE)
lstblockOBJECTS = lstblock$(OBJ)
$(BINDIR)/lstblock$(EXE): $(lstblockOBJECTS)
	$(CCLINK) -o $@ $(lstblockOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

mkblkdir : $(BINDIR)/mkblkdir$(EXE)
mkblkdirOBJECTS = mkblkdir$(OBJ) mc1$(OBJ) $(LIBDIR)/main_cnt$(OBJ)
$(BINDIR)/mkblkdir$(EXE): $(mkblkdirOBJECTS)
	$(CCLINK) -o $@ $(mkblkdirOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

showdb: $(BINDIR)/showdb$(EXE)
showdbOBJECTS = showdb$(OBJ)
$(BINDIR)/showdb$(EXE): $(showdbOBJECTS)
	$(CCLINK) -o $@ $(showdbOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@


to_date: $(BINDIR)/to_date$(EXE)
to_dateOBJECTS = to_date$(OBJ)
$(BINDIR)/to_date$(EXE): $(to_dateOBJECTS)
	$(CCLINK) -o $@ $(to_dateOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

to_day: $(BINDIR)/to_day$(EXE)
to_dayOBJECTS = to_day$(OBJ)
$(BINDIR)/to_day$(EXE): $(to_dayOBJECTS)
	$(CCLINK) -o $@ $(to_dayOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@


to_week: $(BINDIR)/to_week$(EXE)
to_weekOBJECTS = to_week$(OBJ)
$(BINDIR)/to_week$(EXE): $(to_weekOBJECTS)
	$(CCLINK) -o $@ $(to_weekOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@


asc_dump: $(BINDIR)/asc_dump$(EXE)
asc_dumpOBJECTS = asc_dump$(OBJ) blk_asc$(OBJ)
$(BINDIR)/asc_dump$(EXE): $(asc_dumpOBJECTS)
	$(CCLINK) -o $@ $(asc_dumpOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

chprodid: $(BINDIR)/chprodid$(EXE)
chprodidOBJECTS = chprodid$(OBJ)  $(LIBDIR)/main_cnt$(OBJ)
$(BINDIR)/chprodid$(EXE): $(chprodidOBJECTS)
	$(CCLINK) -o $@ $(chprodidOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@

ldcodas: $(BINDIR)/ldcodas$(EXE)
ldcodasOBJECTS = ldcodas$(OBJ) $(LIBDIR)/main_cnt$(OBJ)
$(BINDIR)/ldcodas$(EXE): $(ldcodasOBJECTS)
	$(CCLINK) -o $@ $(ldcodasOBJECTS) $(LIBS1) $(LDLIBS)
	$(CHMOD) $(BIN_PERMISSION) $@


clean:
	$(RM) $(DIRT)
#
