include ../../makefile.dep

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

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

TARGETS =    bt2tobt3 convadcp convadc2 fixunits getnav \
	     lst_temp lst_hdg pgbin set_bit setpmask \
	     lst_conf lst_alfa

all:	$(TARGETS)

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

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

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

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

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

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

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

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

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

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

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

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

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


clean:
	$(RM) $(DIRT)
#
